652 changed files with 0 additions and 77471 deletions
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
|
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.Reporting.Tests.Factory |
||||
{ |
||||
[TestFixture] |
||||
public class ReportingFactoryFixture |
||||
{ |
||||
private const string nS = "ICSharpCode.Reporting.Tests.TestReports."; |
||||
private const string reportName = "PlainModel.srd"; |
||||
private Stream stream; |
||||
|
||||
[Test] |
||||
public void CreateFormSheetBuilder() |
||||
{ |
||||
var r = new ReportingFactory(); |
||||
var x = r.CreatePageBuilder(stream); |
||||
Assert.That(x,Is.Null); |
||||
} |
||||
|
||||
[SetUp] |
||||
public void LoadFromStream() |
||||
{ |
||||
System.Reflection.Assembly asm = Assembly.GetExecutingAssembly(); |
||||
stream = asm.GetManifestResourceStream(nS + reportName); |
||||
} |
||||
} |
||||
} |
@ -1,96 +0,0 @@
@@ -1,96 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
|
||||
using ICSharpCode.Reporting.Globals; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.Reporting.Tests.Model |
||||
{ |
||||
[TestFixture] |
||||
public class LoadPlainModelFixture |
||||
{ |
||||
private const string nS = "ICSharpCode.Reporting.Tests.TestReports."; |
||||
private const string reportName = "PlainModel.srd"; |
||||
private Stream stream; |
||||
|
||||
[Test] |
||||
public void CanLoadFromResource() |
||||
{ |
||||
Assert.IsNotNull(stream); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void LoadPlainModel() |
||||
{ |
||||
var rf = new ReportingFactory(); |
||||
var model = rf.LoadReportModel(stream); |
||||
Assert.IsNotNull(model); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void ReportSettingsFromPlainModel() |
||||
{ |
||||
var rf = new ReportingFactory(); |
||||
var model = rf.LoadReportModel(stream); |
||||
Assert.That(model.ReportSettings,Is.Not.Null); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void ReportSettingsReportName() |
||||
{ |
||||
var rf = new ReportingFactory(); |
||||
var model = rf.LoadReportModel(stream); |
||||
Assert.That(model.ReportSettings.ReportName,Is.EqualTo(Globals.GlobalValues.DefaultReportName)); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void ReportSettingsDataModelFormSheet() |
||||
{ |
||||
var rf = new ReportingFactory(); |
||||
var model = rf.LoadReportModel(stream); |
||||
Assert.That(model.ReportSettings.DataModel,Is.EqualTo(GlobalEnums.PushPullModel.FormSheet)); |
||||
} |
||||
|
||||
[Test] |
||||
public void ReportSettingsPageSize() |
||||
{ |
||||
var rf = new ReportingFactory(); |
||||
var model = rf.LoadReportModel(stream); |
||||
Assert.That(model.ReportSettings.PageSize,Is.EqualTo(Globals.GlobalValues.DefaultPageSize)); |
||||
} |
||||
|
||||
|
||||
|
||||
[SetUp] |
||||
public void LoadFromStream() |
||||
{ |
||||
System.Reflection.Assembly asm = Assembly.GetExecutingAssembly(); |
||||
stream = asm.GetManifestResourceStream(nS + reportName); |
||||
} |
||||
|
||||
|
||||
} |
||||
} |
@ -1,58 +0,0 @@
@@ -1,58 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Reporting.Items; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.Reporting.Tests.Model |
||||
{ |
||||
[TestFixture] |
||||
public class ReportModelFixture |
||||
{ |
||||
private ReportModel model; |
||||
|
||||
[Test] |
||||
public void CanCreateReportModel() |
||||
{ |
||||
Assert.That(model,Is.Not.Null); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void ModelInitializeReportSettings() |
||||
{ |
||||
Assert.That(model.ReportSettings,Is.Not.Null); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void ModelReturnsPlainReportName() |
||||
{ |
||||
Assert.That(model.ReportSettings.ReportName,Is.EqualTo(Globals.GlobalValues.DefaultReportName)); |
||||
} |
||||
|
||||
|
||||
[SetUp] |
||||
public void CreateModel() |
||||
{ |
||||
model = ReportModel.Create(); |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,61 +0,0 @@
@@ -1,61 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reporting.Globals; |
||||
using ICSharpCode.Reporting.Items; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.Reporting.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class ReportSettingsFixture |
||||
{ |
||||
ReportSettings reportSettings; |
||||
|
||||
[Test] |
||||
public void DefaultConstructureShouldReturnStandardValues() |
||||
{ |
||||
Assert.IsNotNull(reportSettings,"Should not be 'null'"); |
||||
Assert.AreEqual(GlobalValues.DefaultReportName,reportSettings.ReportName); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void DefaultPageSize () |
||||
{ |
||||
Assert.AreEqual(GlobalValues.DefaultPageSize,reportSettings.PageSize); |
||||
} |
||||
|
||||
|
||||
[Test] |
||||
public void LandScape_True_Return_PageSize_For_LandScape () |
||||
{ |
||||
reportSettings.Landscape = true; |
||||
var landscapeSize = new Size(Globals.GlobalValues.DefaultPageSize.Height, |
||||
Globals.GlobalValues.DefaultPageSize.Width); |
||||
Assert.That(reportSettings.PageSize,Is.EqualTo(landscapeSize)); |
||||
} |
||||
|
||||
[SetUp] |
||||
public void Setup () { |
||||
reportSettings = new ReportSettings(); |
||||
} |
||||
} |
||||
} |
@ -1,86 +0,0 @@
@@ -1,86 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<ReportModel> |
||||
<ReportSettings> |
||||
<ReportSettings> |
||||
<DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont> |
||||
<DataModel>FormSheet</DataModel> |
||||
<FileName>D:\SharpDevelop3.0_CHECKOUT\SharpDevelop\bin\Raaaaaeport1.srd</FileName> |
||||
<RightMargin>50</RightMargin> |
||||
<UseStandardPrinter>True</UseStandardPrinter> |
||||
<SortColumnCollection /> |
||||
<AvailableFieldsCollection /> |
||||
<NoDataMessage>No Data for this Report</NoDataMessage> |
||||
<LeftMargin>50</LeftMargin> |
||||
<PageSize>827, 1169</PageSize> |
||||
<Padding>5, 5, 5, 5</Padding> |
||||
<BottomMargin>50</BottomMargin> |
||||
<CommandType>Text</CommandType> |
||||
<ParameterCollection /> |
||||
<Landscape>False</Landscape> |
||||
<ReportName>Report1</ReportName> |
||||
<TopMargin>50</TopMargin> |
||||
<GroupColumnsCollection /> |
||||
<GraphicsUnit>Millimeter</GraphicsUnit> |
||||
<CommandText /> |
||||
<ReportType>FormSheet</ReportType> |
||||
<ConnectionString /> |
||||
</ReportSettings> |
||||
</ReportSettings> |
||||
<SectionCollection> |
||||
<BaseSection> |
||||
<Size>727, 60</Size> |
||||
<Name>ReportHeader</Name> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<SectionMargin>0</SectionMargin> |
||||
<SectionOffset>0</SectionOffset> |
||||
<BackColor>White</BackColor> |
||||
<Items /> |
||||
<Location>50, 50</Location> |
||||
<DrawBorder>False</DrawBorder> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Size>727, 60</Size> |
||||
<Name>ReportPageHeader</Name> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<SectionMargin>0</SectionMargin> |
||||
<SectionOffset>0</SectionOffset> |
||||
<BackColor>White</BackColor> |
||||
<Items /> |
||||
<Location>50, 125</Location> |
||||
<DrawBorder>False</DrawBorder> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Size>727, 60</Size> |
||||
<Name>ReportDetail</Name> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<SectionMargin>0</SectionMargin> |
||||
<SectionOffset>0</SectionOffset> |
||||
<BackColor>White</BackColor> |
||||
<Items /> |
||||
<Location>50, 200</Location> |
||||
<DrawBorder>False</DrawBorder> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Size>727, 60</Size> |
||||
<Name>ReportPageFooter</Name> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<SectionMargin>0</SectionMargin> |
||||
<SectionOffset>0</SectionOffset> |
||||
<BackColor>White</BackColor> |
||||
<Items /> |
||||
<Location>50, 275</Location> |
||||
<DrawBorder>False</DrawBorder> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Size>727, 60</Size> |
||||
<Name>ReportFooter</Name> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<SectionMargin>0</SectionMargin> |
||||
<SectionOffset>0</SectionOffset> |
||||
<BackColor>White</BackColor> |
||||
<Items /> |
||||
<Location>50, 350</Location> |
||||
<DrawBorder>False</DrawBorder> |
||||
</BaseSection> |
||||
</SectionCollection> |
||||
</ReportModel> |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0"?> |
||||
<Template author="Peter Forstmeier" version="2.1"> |
||||
|
||||
<Config |
||||
name = "${res:SharpReport.AddinName}" |
||||
icon = "Icons.32x32.TextFileIcon" |
||||
category = "${res:Templates.File.Categories.Misc}" |
||||
defaultname = "Report${Number}.srd" |
||||
language = "SharpDevelopReports"/> |
||||
|
||||
<Description>${res:Templates.SharpReport.NewReport}</Description> |
||||
|
||||
<Files> |
||||
<File name="${FullName}" language="SharpDevelopReports"/> |
||||
</Files> |
||||
|
||||
<AdditionalOptions/> |
||||
</Template> |
||||
|
||||
|
@ -1,217 +0,0 @@
@@ -1,217 +0,0 @@
|
||||
<AddIn name = "SharpDevelopReports" |
||||
author = "Forstmeier Peter" |
||||
url = "http://www.sharpdevelopreports.net/" |
||||
description = "Reporting Tool For SharpDevelop" |
||||
addInManagerHidden = "preinstalled"> |
||||
|
||||
<!-- <Manifest> |
||||
<Identity name="ICSharpCode.Reports.Addin" /> |
||||
|
||||
<Dependency addin="SharpDevelop" /> |
||||
<Dependency addin="ICSharpCode.Data.Addin" requirePreload="true" /> |
||||
</Manifest> |
||||
--> |
||||
<!-- <Runtime> |
||||
<Import assembly = "ICSharpCode.Reports.Core.dll" /> |
||||
<Import assembly = "ICSharpCode.Reports.Addin.dll"> |
||||
<Doozer name="ReportDialogPanel" class="ICSharpCode.Reports.Addin.ReportWizard.DialogPanelDoozer"/> |
||||
</Import> |
||||
</Runtime>--> |
||||
|
||||
<!-- DisplayBinding --> |
||||
|
||||
<!--<Path name ="/SharpDevelop/Workbench/DisplayBindings"> |
||||
<DisplayBinding id="SharpDevelopReportsBinding" |
||||
insertbefore="Text" |
||||
fileNamePattern="\.(srd)$" |
||||
languagePattern="^SharpDevelopReports$" |
||||
class="ICSharpCode.Reports.Addin.ReportDesignerDisplayBinding"/> |
||||
</Path>--> |
||||
|
||||
<!-- File Filter --> |
||||
<!-- <Path name ="/SharpDevelop/Workbench/FileFilter"> |
||||
<FileFilter id="SharpDevelopReports" |
||||
insertbefore="AllFiles" |
||||
name="SharpDevelop Reports (*.srd)" |
||||
extensions="*.srd" |
||||
mimeType = "text/xml"/> |
||||
</Path>--> |
||||
|
||||
<!-- ReportExplorer --> |
||||
|
||||
<Path name = "/SharpDevelop/Workbench/Pads"> |
||||
<Pad id="reportexplorer" |
||||
category = "Tools" |
||||
icon="Icons.16x16.SharpQuery.Refresh" |
||||
title = "ReportExplorer" |
||||
class="ICSharpCode.Reports.Addin.ReportExplorerPad" |
||||
defaultPosition = "Right, Hidden" /> |
||||
</Path> |
||||
|
||||
|
||||
<Path name = "/SharpDevelop/ReportDesigner/ContextMenus/ContainerMenu"> |
||||
<MenuItem id = "ViewCode" |
||||
label = "${res:SharpDevelop.FormsDesigner.ContextMenus.ViewCodeCommand}" |
||||
icon = "Icons.16x16.FormsDesigner.ViewCode" |
||||
class = "ICSharpCode.Reports.Addin.Commands.ViewCode"/> |
||||
|
||||
<MenuItem id = "ShowProperties" |
||||
label = "${res:XML.MainMenu.FormatMenu.ShowProperties}" |
||||
icon = "Icons.16x16.Property" |
||||
class = "ICSharpCode.Reports.Addin.Commands.ShowProperties"/> |
||||
|
||||
<MenuItem id = "PageMarginSeparator" type = "Separator"/> |
||||
|
||||
<MenuItem id = "PageMargin" |
||||
label = "PageMargin" |
||||
icon = "Icons.16x16.Property" |
||||
class = "ICSharpCode.Reports.Addin.Commands.TogglePageMargin"/> |
||||
|
||||
<MenuItem id = "DesignerSeparator" type = "Separator"/> |
||||
|
||||
<MenuItem id = "Paste" |
||||
label = "${res:XML.MainMenu.EditMenu.Paste}" |
||||
icon = "Icons.16x16.PasteIcon" |
||||
command = "Paste"/> |
||||
|
||||
<MenuItem id = "DesignerVerbsSeparator" type = "Separator"/> |
||||
|
||||
<MenuItem id = "DesignerVerbsBuilder" |
||||
type = "Builder" |
||||
class = "ICSharpCode.Reports.Addin.Commands.DesignerVerbSubmenuBuilder" /> |
||||
</Path> |
||||
|
||||
<Path name = "/SharpDevelop/ReportDesigner/ContextMenus/TraySelectionMenu"> |
||||
<MenuItem id = "ViewCode" |
||||
label = "${res:SharpDevelop.FormsDesigner.ContextMenus.ViewCodeCommand}" |
||||
icon = "Icons.16x16.FormsDesigner.ViewCode" |
||||
class = "ICSharpCode.Reports.Addin.Commands.ViewCode"/> |
||||
|
||||
<MenuItem id = "ShowProperties" |
||||
label = "${res:XML.MainMenu.FormatMenu.ShowProperties}" |
||||
icon = "Icons.16x16.Property" |
||||
class = "ICSharpCode.Reports.Addin.Commands.ShowProperties"/> |
||||
|
||||
|
||||
<MenuItem id = "DesignerVerbsSeparator" type = "Separator"/> |
||||
|
||||
<MenuItem id = "DesignerVerbsBuilder" |
||||
type = "Builder" |
||||
class = "ICSharpCode.Reports.Addin.Commands.DesignerVerbSubmenuBuilder" /> |
||||
</Path> |
||||
|
||||
|
||||
<Path name = "/SharpDevelop/ReportDesigner/ContextMenus/SelectionMenu"> |
||||
|
||||
<MenuItem id = "ViewCode" |
||||
label = "${res:SharpDevelop.FormsDesigner.ContextMenus.ViewCodeCommand}" |
||||
icon = "Icons.16x16.FormsDesigner.ViewCode" |
||||
class = "ICSharpCode.Reports.Addin.Commands.ViewCode"/> |
||||
|
||||
<MenuItem id = "ShowProperties" |
||||
label = "${res:XML.MainMenu.FormatMenu.ShowProperties}" |
||||
icon = "Icons.16x16.Property" |
||||
class = "ICSharpCode.Reports.Addin.Commands.ShowProperties"/> |
||||
|
||||
<MenuItem id = "PropertySeparator" type = "Separator"/> |
||||
|
||||
<MenuItem id = "Cut" |
||||
label = "${res:XML.MainMenu.EditMenu.Cut}" |
||||
icon = "Icons.16x16.CutIcon" |
||||
command = "Cut"/> |
||||
|
||||
<MenuItem id = "Copy" |
||||
label = "${res:XML.MainMenu.EditMenu.Copy}" |
||||
icon = "Icons.16x16.CopyIcon" |
||||
command = "Copy"/> |
||||
<MenuItem id = "Paste" |
||||
label = "${res:XML.MainMenu.EditMenu.Paste}" |
||||
icon = "Icons.16x16.PasteIcon" |
||||
command = "Paste"/> |
||||
|
||||
<MenuItem id = "Delete" |
||||
label = "${res:XML.MainMenu.EditMenu.Delete}" |
||||
icon = "Icons.16x16.DeleteIcon" |
||||
command = "Delete"/> |
||||
|
||||
<MenuItem id = "DesignerVerbsSeparator" type = "Separator"/> |
||||
|
||||
<MenuItem id = "DesignerVerbsBuilder" |
||||
type = "Builder" |
||||
class = "ICSharpCode.Reports.Addin.Commands.DesignerVerbSubmenuBuilder" /> |
||||
</Path> |
||||
|
||||
|
||||
|
||||
<!-- ReportExplorer ContextMenu's --> |
||||
|
||||
<Path name ="/SharpDevelopReports/ContextMenu/FieldsExplorer/SectionTreeNode"> |
||||
<MenuItem id="removenodes" |
||||
label="${res:SharpReport.FieldsExplorer.ContextMenu.Section.Clear}" |
||||
class="ICSharpCode.Reports.Addin.Commands.ClearSelectedNodeCommand"/> |
||||
</Path> |
||||
|
||||
<!-- Sorting --> |
||||
|
||||
<Path name = "/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnSortTreeNode"> |
||||
<MenuItem id="toggle" |
||||
label="${res:SharpReport.FieldsExplorer.ContextMenu.Columns.ToggleSort}" |
||||
class="ICSharpCode.Reports.Addin.Commands.ToggleOrderCommand"/> |
||||
plorer |
||||
<MenuItem id="removesortnode" |
||||
label="${res:SharpReport.FieldsExplorer.ContextMenu.Columns.Remove}" |
||||
class="ICSharpCode.Reports.Addin.Commands.RemoveSortNodeCommand"/> |
||||
|
||||
</Path> |
||||
|
||||
<!-- Grouping --> |
||||
<Path name = "/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnGroupTreeNode"> |
||||
<MenuItem id="toggle" |
||||
label="${res:SharpReport.FieldsExplorer.ContextMenu.Columns.ToggleSort}" |
||||
class="ICSharpCode.Reports.Addin.Commands.ToggleOrderCommand"/> |
||||
|
||||
<MenuItem id="removegroupnode" |
||||
label="${res:SharpReport.FieldsExplorer.ContextMenu.Columns.Remove}" |
||||
class="ICSharpCode.Reports.Addin.Commands.RemoveGroupNodeCommand"/> |
||||
</Path> |
||||
|
||||
|
||||
<!-- Run Expression Editor --> |
||||
<Path name = "/SharpDevelopReports/ContextMenu/FieldsExplorer/ParameterNode"> |
||||
<MenuItem id="params" |
||||
label="${res:SharpReport.FieldsExplorer.Parameters}" |
||||
class="ICSharpCode.Reports.Addin.Commands.ParameterEditorCommand"/> |
||||
</Path> |
||||
|
||||
<!-- Start SharpDevelop Reports from MainMenu --> |
||||
|
||||
<!--<Path name = "/SharpDevelop/Workbench/Tools"> |
||||
<MenuItem id = "ReportGeneratorPad" |
||||
label = "${res:SharpReport.ReportGenerator}" |
||||
|
||||
class = "ICSharpCode.Reports.Addin.Commands.StartViewCommand"/> |
||||
</Path>--> |
||||
|
||||
<!-- Report wizard --> |
||||
|
||||
<Path name = "/ReportGenerator/ReportGeneratorWizard"> |
||||
<ReportDialogPanel id="Base" label = "${res:SharpReport.Wizard.BaseSettings}" class="ICSharpCode.Reports.Addin.ReportWizard.BaseSettingsPanel"/> |
||||
<ReportDialogPanel id="PushModel" label="${res:SharpReport.Wizard.PushModel}" class="ICSharpCode.Reports.Addin.ReportWizard.PushModelPanel"/> |
||||
<ReportDialogPanel id="PullModel" label="${res:SharpReport.Wizard.PullModel}" class="ICSharpCode.Reports.Addin.ReportWizard.PullModelPanel"/> |
||||
<ReportDialogPanel id="QueryResult" label="${res:SharpReport.Wizard.ShowQueryResult}" class ="ICSharpCode.Reports.Addin.ReportWizard.ResultPanel"/> |
||||
<ReportDialogPanel id="Layout" label="Layout" class ="ICSharpCode.Reports.Addin.ReportWizard.LayoutPanel"/> |
||||
|
||||
</Path> |
||||
|
||||
<!-- ContextMenu Sections --> |
||||
<!-- Save Data from Resultpanel as *xsd File --> |
||||
<Path name ="/ReportGenerator/ResultPanel/ContextMenuDefault"> |
||||
<MenuItem id="xsdcomplete" label="${res:SharpReport.Wizard.ResultPanel.SaveXsdComplete}" class="ICSharpCode.Reports.Addin.ReportWizard.XsdSchemaAndDataCommand"/> |
||||
<MenuItem id="xsdschema" label="${res:SharpReport.Wizard.ResultPanel.SaveXsdSchemaOnly}" class="ICSharpCode.Reports.Addin.ReportWizard.XsdSchemaOnlyCommand"/> |
||||
</Path> |
||||
|
||||
<!-- Tell SharpDevelop to look for the file template (EmptyReport.xft) in the AddIn directory --> |
||||
<Path name = "/SharpDevelop/BackendBindings/Templates"> |
||||
<TemplateFile id = "ICSharpCode.Reports" path = "." /> |
||||
</Path> |
||||
</AddIn> |
@ -1,363 +0,0 @@
@@ -1,363 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>ICSharpCode.Reports.Addin</RootNamespace> |
||||
<AssemblyName>ICSharpCode.Reports.Addin</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||
<ProjectGuid>{35D002D7-C78B-44FB-92AA-104BEB431678}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
||||
<OutputPath>..\..\..\..\..\AddIns\Misc\SharpDevelopReports\</OutputPath> |
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
||||
<SourceAnalysisOverrideSettingsFile>"C:\Program Files\SharpDevelop\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis"</SourceAnalysisOverrideSettingsFile> |
||||
<PublishUrl>publish\</PublishUrl> |
||||
<Install>true</Install> |
||||
<InstallFrom>Disk</InstallFrom> |
||||
<UpdateEnabled>false</UpdateEnabled> |
||||
<UpdateMode>Foreground</UpdateMode> |
||||
<UpdateInterval>7</UpdateInterval> |
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> |
||||
<UpdatePeriodically>false</UpdatePeriodically> |
||||
<UpdateRequired>false</UpdateRequired> |
||||
<MapFileExtensions>true</MapFileExtensions> |
||||
<ApplicationRevision>0</ApplicationRevision> |
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
||||
<IsWebBootstrapper>false</IsWebBootstrapper> |
||||
<UseApplicationTrust>false</UseApplicationTrust> |
||||
<BootstrapperEnabled>true</BootstrapperEnabled> |
||||
<TargetFrameworkProfile> |
||||
</TargetFrameworkProfile> |
||||
<NoWin32Manifest>False</NoWin32Manifest> |
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
<StartAction>Project</StartAction> |
||||
<StartProgram>..\..\..\..\..\bin\SharpDevelop.exe</StartProgram> |
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> |
||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> |
||||
<BaseAddress>125829120</BaseAddress> |
||||
<PlatformTarget>x86</PlatformTarget> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<FileAlignment>4096</FileAlignment> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="itextsharp"> |
||||
<HintPath>..\Libraries\itextsharp.dll</HintPath> |
||||
</Reference> |
||||
<Reference Include="PresentationCore"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="PresentationFramework"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Core"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Design" /> |
||||
<Reference Include="System.Drawing.Design" /> |
||||
<Reference Include="System.Printing"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Xaml"> |
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Xml.Linq"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="WindowsBase" /> |
||||
<Reference Include="WindowsFormsIntegration" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs"> |
||||
<Link>Project\Configuration\GlobalAssemblyInfo.cs</Link> |
||||
</Compile> |
||||
<Compile Include="Project\Commands\ExplorerCommands.cs" /> |
||||
<Compile Include="Project\Commands\PreviewCommands.cs" /> |
||||
<Compile Include="Project\DesignerBinding\IDesignerGenerator.cs" /> |
||||
<Compile Include="Project\DesignerBinding\ReportDefinitionDeserializer.cs" /> |
||||
<Compile Include="Project\DesignerBinding\ReportDesignerDisplayBinding.cs" /> |
||||
<Compile Include="Project\DesignerBinding\ReportDesignerGenerator.cs" /> |
||||
<Compile Include="Project\DesignerBinding\ReportDesignerLoader.cs" /> |
||||
<Compile Include="Project\DesignerBinding\InternalReportLoader.cs" /> |
||||
<Compile Include="Project\Designer\DataItemDesigner.cs" /> |
||||
<Compile Include="Project\Designer\DesignerHelper.cs" /> |
||||
<Compile Include="Project\Designer\GroupedRowDesigner.cs" /> |
||||
<Compile Include="Project\Designer\GroupeHeaderDesigner.cs" /> |
||||
<Compile Include="Project\Designer\ImageDesigner.cs" /> |
||||
<Compile Include="Project\Designer\LineDesigner.cs" /> |
||||
<Compile Include="Project\Designer\ContainerItemDesigner.cs" /> |
||||
<Compile Include="Project\Designer\Ruler.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\Designer\SectionDesigner.cs" /> |
||||
<Compile Include="Project\Commands\FormsCommand.cs" /> |
||||
<Compile Include="Project\Commands\ViewCommands.cs" /> |
||||
<Compile Include="Project\Configuration\AssemblyInfo.cs" /> |
||||
<None Include="EmptyReport.xft"> |
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory> |
||||
</None> |
||||
<Compile Include="Project\Designer\SmartTagTransactions.cs" /> |
||||
<Compile Include="Project\Designer\TextBasedDesignerActionList.cs" /> |
||||
<Compile Include="Project\Designer\TextItemDesigner.cs" /> |
||||
<Compile Include="Project\Designer\RootDesigner\ReportItemsContainer.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\Designer\RootDesigner\ReportRootDesigner.cs" /> |
||||
<Compile Include="Project\Designer\ShapeDesigner.cs" /> |
||||
<Compile Include="Project\Designer\TableDesigner.cs" /> |
||||
<Compile Include="Project\Dialogs\DataTypeStringConverter.cs" /> |
||||
<Compile Include="Project\Dialogs\ExpressionEditor.cs"> |
||||
<SubType>Form</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\Dialogs\ExpressionEditor.Designer.cs"> |
||||
<DependentUpon>ExpressionEditor.cs</DependentUpon> |
||||
</Compile> |
||||
<Compile Include="Project\Dialogs\FormatStringConverte.cs" /> |
||||
<Compile Include="Project\Globals\FormsDesignerLoadException.cs" /> |
||||
<Compile Include="Project\Globals\GlobalsDesigner.cs" /> |
||||
<Compile Include="Project\Globals\StringWriterWithEncoding.cs" /> |
||||
<Compile Include="Project\ReportDesignerView.cs" /> |
||||
<Compile Include="Project\ReportExplorer\ExplorerNodes.cs" /> |
||||
<Compile Include="Project\ReportExplorer\ExplorerTree.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportExplorer\ReportExplorerPad.cs" /> |
||||
<Compile Include="Project\ReportItems\AbstractItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseCircleItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseDataItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\GroupFooter.cs" /> |
||||
<Compile Include="Project\ReportItems\BaseImageItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseLine.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseRectangleItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseRowItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseTableItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseTextItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\BaseSection.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\ErrorItem.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\GroupHeader.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportItems\TypeProviders\AbstractItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\CircleItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\DataItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\GroupedRowTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\ImageItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\LineItemTypeDescriptor.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\RectangleItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\RowItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\SectionItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\TableItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportItems\TypeProviders\TextItemTypeProvider.cs" /> |
||||
<Compile Include="Project\ReportManagers\BaseManager.cs" /> |
||||
<Compile Include="Project\ReportManagers\StandartPreviewManager.cs" /> |
||||
<Compile Include="Project\ReportWizard\Generators\AbstractReportGenerator.cs" /> |
||||
<Compile Include="Project\ReportWizard\Generators\GenerateFormSheetReport.cs" /> |
||||
<Compile Include="Project\ReportWizard\Generators\GeneratePlainReport.cs" /> |
||||
<Compile Include="Project\ReportWizard\Generators\GeneratePullDataReport.cs" /> |
||||
<Compile Include="Project\ReportWizard\Generators\GeneratePushDataReport.cs" /> |
||||
<Compile Include="Project\ReportWizard\Generators\GeneratorFactory.cs" /> |
||||
<Compile Include="Project\ReportWizard\Generators\WizardHelper.cs" /> |
||||
<Compile Include="Project\ReportWizard\ReportLayout\AbstractLayout.cs" /> |
||||
<Compile Include="Project\ReportWizard\ReportLayout\ListLayout.cs" /> |
||||
<Compile Include="Project\ReportWizard\ReportLayout\TableLayout.cs" /> |
||||
<Compile Include="Project\ReportWizard\ReportStructure.cs" /> |
||||
<Compile Include="Project\ReportWizard\ReportWizardCommand.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardCommands.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\BaseSettingsPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\DataGridViewColumnHeaderCheckBoxCell.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\LayoutPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\PullModelPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\PushModelPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\ResultPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\LayoutPanelControl.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\LayoutPanelControl.Designer.cs"> |
||||
<DependentUpon>LayoutPanelControl.cs</DependentUpon> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\AbstractOptionPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\AbstractWizardPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\CurrentPanelPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\DefaultDialogPanelDescriptor.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\DialogPanelDoozer.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\IDialogPanel.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\IDialogPanelDescriptor.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\IWizardPanel.cs" /> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\StatusPanel.cs"> |
||||
<SubType>UserControl</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\ReportWizard\WizardPanels\Wizard\WizardDialog.cs"> |
||||
<SubType>Form</SubType> |
||||
</Compile> |
||||
<Compile Include="Project\SecondaryViews\ReportPreview.cs" /> |
||||
<Compile Include="Project\SecondaryViews\ReportViewerMessages.cs"> |
||||
<DependentUpon>ReportViewerSecondaryView.cs</DependentUpon> |
||||
</Compile> |
||||
<Compile Include="Project\SecondaryViews\ReportViewerSecondaryView.cs" /> |
||||
<Compile Include="Project\SecondaryViews\WPFReportPreview.cs" /> |
||||
<Compile Include="Project\SecondaryViews\XmlView.cs" /> |
||||
<Compile Include="Project\Services\DefaultMemberRelationshipService.cs" /> |
||||
<Compile Include="Project\Services\DefaultServiceContainer.cs" /> |
||||
<Compile Include="Project\Services\DesignerSerializationService.cs" /> |
||||
<Compile Include="Project\Services\HelpService.cs" /> |
||||
<Compile Include="Project\Services\MenuCommandService.cs" /> |
||||
<Compile Include="Project\Services\NameCreationService.cs" /> |
||||
<Compile Include="Project\Services\ToolboxService.cs" /> |
||||
<Compile Include="Project\Services\TypeDiscoveryService.cs" /> |
||||
<Compile Include="Project\Services\TypeResolutionService.cs" /> |
||||
<Compile Include="Project\Services\UIService.cs" /> |
||||
<Compile Include="Project\Toolbox\SideTabItemDesigner.cs" /> |
||||
<Compile Include="Project\Toolbox\ToolboxProvider.cs" /> |
||||
<Compile Include="Project\UndoRedo\UndoEngine.cs" /> |
||||
<Compile Include="Project\Xml\MycroWriter.cs" /> |
||||
<Compile Include="Project\Xml\ReportDefinitionParser.cs" /> |
||||
<Compile Include="Project\Xml\ReportDesignerWriter.cs" /> |
||||
<Compile Include="Project\Xml\XmlHelper.cs" /> |
||||
<EmbeddedResource Include="Project\Dialogs\ExpressionEditor.resx"> |
||||
<DependentUpon>ExpressionEditor.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<EmbeddedResource Include="Project\ReportItems\AbstractItem.resx"> |
||||
<DependentUpon>AbstractItem.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<EmbeddedResource Include="Project\ReportWizard\WizardPanels\LayoutPanelControl.resx"> |
||||
<DependentUpon>LayoutPanelControl.Designer.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<EmbeddedResource Include="Project\ReportWizard\WizardPanels\PullModelPanel.resx"> |
||||
<DependentUpon>PullModelPanel.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<EmbeddedResource Include="Project\ReportWizard\WizardPanels\PushModelPanel.resx"> |
||||
<DependentUpon>PushModelPanel.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<EmbeddedResource Include="Project\ReportWizard\WizardPanels\ResultPanel.resx"> |
||||
<DependentUpon>ResultPanel.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj"> |
||||
<Project>{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}</Project> |
||||
<Name>ICSharpCode.Core.WinForms</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj"> |
||||
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project> |
||||
<Name>ICSharpCode.SharpDevelop.Widgets</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\DisplayBindings\Data\ICSharpCode.Data.Core.UI\ICSharpCode.Data.Core.UI.csproj"> |
||||
<Project>{BAD94D6E-4159-4CB6-B991-486F412D9BB6}</Project> |
||||
<Name>ICSharpCode.Data.Core.UI</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\DisplayBindings\Data\ICSharpCode.Data.Core\ICSharpCode.Data.Core.csproj"> |
||||
<Project>{B7823AE9-4B43-4859-8796-2EBDC116FBB8}</Project> |
||||
<Name>ICSharpCode.Data.Core</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\DisplayBindings\Data\ICSharpCode.Data.SQLServer\ICSharpCode.Data.SQLServer.csproj"> |
||||
<Project>{AFE34868-AFA1-4E1C-9450-47AB4BE329D5}</Project> |
||||
<Name>ICSharpCode.Data.SQLServer</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\ICSharpCode.Reports.Core\ICSharpCode.Reports.Core.csproj"> |
||||
<Project>{4B2239FF-8FD6-431D-9D22-1B8049BA6917}</Project> |
||||
<Name>ICSharpCode.Reports.Core</Name> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0"> |
||||
<Visible>False</Visible> |
||||
<ProductName>Microsoft .NET Framework 4 %28x86 und x64%29</ProductName> |
||||
<Install>true</Install> |
||||
</BootstrapperPackage> |
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> |
||||
<Visible>False</Visible> |
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> |
||||
<Install>false</Install> |
||||
</BootstrapperPackage> |
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> |
||||
<Visible>False</Visible> |
||||
<ProductName>.NET Framework 3.5 SP1</ProductName> |
||||
<Install>false</Install> |
||||
</BootstrapperPackage> |
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> |
||||
<Visible>False</Visible> |
||||
<ProductName>Windows Installer 3.1</ProductName> |
||||
<Install>true</Install> |
||||
</BootstrapperPackage> |
||||
</ItemGroup> |
||||
<ItemGroup /> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -1,101 +0,0 @@
@@ -1,101 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Dialogs; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Commands |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ExplorerCommands
|
||||
/// </summary>
|
||||
public class ToggleOrderCommand : AbstractCommand |
||||
{ |
||||
/// <summary>
|
||||
/// Starts the command
|
||||
/// </summary>
|
||||
public override void Run() |
||||
{ |
||||
ReportExplorerPad r = this.Owner as ReportExplorerPad; |
||||
if (r != null) { |
||||
r.ToggleOrder(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public class RemoveSortNodeCommand : AbstractCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ReportExplorerPad r = this.Owner as ReportExplorerPad; |
||||
if (r != null) { |
||||
r.RemoveSortNode(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class RemoveGroupNodeCommand : AbstractCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ReportExplorerPad r = this.Owner as ReportExplorerPad; |
||||
if (r != null) { |
||||
r.RemoveGroupNode(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public class ClearSelectedNodeCommand : AbstractCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ReportExplorerPad r = this.Owner as ReportExplorerPad; |
||||
if (r != null) { |
||||
r.ClearNodes(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public class ParameterEditorCommand : AbstractCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ReportExplorerPad pad = this.Owner as ReportExplorerPad; |
||||
if (pad != null) { |
||||
using (ParameterDialog paramDialog = new ParameterDialog(pad.ReportModel.ReportSettings.SqlParameters)) { |
||||
paramDialog.ShowDialog(); |
||||
if (paramDialog.DialogResult == System.Windows.Forms.DialogResult.OK) { |
||||
foreach (SqlParameter bp in paramDialog.SqlParameterCollection) |
||||
{ |
||||
if (bp.ParameterName != null) |
||||
{ |
||||
pad.ReportModel.ReportSettings.SqlParameters.Add (bp); |
||||
} |
||||
} |
||||
pad.RefreshParameters(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,525 +0,0 @@
@@ -1,525 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel.Design; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Core.WinForms; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Commands |
||||
{ |
||||
|
||||
|
||||
/// <summary>
|
||||
/// This is the base class for all designer menu commands
|
||||
/// </summary>
|
||||
public abstract class AbstractFormsDesignerCommand : AbstractMenuCommand |
||||
{ |
||||
public abstract CommandID CommandID { |
||||
get; |
||||
} |
||||
|
||||
protected virtual bool CanExecuteCommand(IDesignerHost host) |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
protected static ReportDesignerView ReportDesigner { |
||||
get { |
||||
// IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
|
||||
IWorkbenchWindow window =SD.Workbench.ActiveWorkbenchWindow; |
||||
if (window == null) { |
||||
return null; |
||||
} |
||||
return window.ActiveViewContent as ReportDesignerView; |
||||
} |
||||
} |
||||
|
||||
|
||||
public override void Run() |
||||
{ |
||||
ReportDesignerView formDesigner = ReportDesigner; |
||||
if (formDesigner != null && CanExecuteCommand(formDesigner.Host)) { |
||||
IMenuCommandService menuCommandService = (IMenuCommandService)formDesigner.Host.GetService(typeof(IMenuCommandService)); |
||||
menuCommandService.GlobalInvoke(CommandID); |
||||
} |
||||
} |
||||
|
||||
internal virtual void CommandCallBack(object sender, EventArgs e) |
||||
{ |
||||
this.Run(); |
||||
} |
||||
} |
||||
|
||||
public class ViewCode : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.ViewCode; |
||||
} |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
IWorkbenchWindow window = SD.Workbench.ActiveWorkbenchWindow; |
||||
if (window == null) { |
||||
return; |
||||
} |
||||
|
||||
ReportDesignerView formDesigner = AbstractFormsDesignerCommand.ReportDesigner; |
||||
if (formDesigner != null) { |
||||
formDesigner.ShowSourceCode(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class ShowProperties : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.PropertiesWindow; |
||||
} |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
PadDescriptor padContent = SD.Workbench.GetPad(typeof(ICSharpCode.SharpDevelop.Gui.PropertyPad)); |
||||
if (padContent != null) { |
||||
padContent.BringPadToFront(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public class TogglePageMargin:AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { return null; } |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
ReportDesignerView formDesigner = AbstractFormsDesignerCommand.ReportDesigner; |
||||
if (formDesigner != null) { |
||||
formDesigner.TogglePageMargin(); |
||||
} |
||||
} |
||||
|
||||
} |
||||
/* |
||||
public class DesignerVerbSubmenuBuilder : IMenuItemBuilder |
||||
{ |
||||
public ToolStripItem[] BuildSubmenu(Codon codon, object owner) |
||||
{ |
||||
IMenuCommandService menuCommandService = (IMenuCommandService)owner; |
||||
|
||||
List<ToolStripItem> items = new List<ToolStripItem>(); |
||||
|
||||
foreach (DesignerVerb verb in menuCommandService.Verbs) { |
||||
System.Console.WriteLine("{0}",verb.Text); |
||||
items.Add(new ContextMenuCommand(verb)); |
||||
} |
||||
|
||||
// add separator at the end of custom designer verbs
|
||||
if (items.Count > 0) { |
||||
items.Add(new MenuSeparator()); |
||||
} |
||||
|
||||
return items.ToArray(); |
||||
} |
||||
|
||||
class ContextMenuCommand : ICSharpCode.Core.WinForms.MenuCommand |
||||
{ |
||||
DesignerVerb verb; |
||||
|
||||
public ContextMenuCommand(DesignerVerb verb) : base(verb.Text) |
||||
{ |
||||
this.Enabled = verb.Enabled; |
||||
// this.Checked = verb.Checked;
|
||||
this.verb = verb; |
||||
Click += new EventHandler(InvokeCommand); |
||||
} |
||||
|
||||
void InvokeCommand(object sender, EventArgs e) |
||||
{ |
||||
try { |
||||
verb.Invoke(); |
||||
} catch (Exception ex) { |
||||
MessageService.ShowException(ex); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
|
||||
#region Align Commands
|
||||
/* |
||||
public class AlignToGrid : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.AlignToGrid; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class AlignLeft : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.AlignLeft; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class AlignRight : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.AlignRight; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class AlignTop : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.AlignTop; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class AlignBottom : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.AlignBottom; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class AlignHorizontalCenters : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.AlignHorizontalCenters; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class AlignVerticalCenters : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.AlignVerticalCenters; |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
#region Make Same Size Commands
|
||||
/* |
||||
public class SizeToGrid : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.SizeToGrid; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class SizeToControl : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.SizeToControl; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class SizeToControlHeight : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.SizeToControlHeight; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class SizeToControlWidth : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.SizeToControlWidth; |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
#region Horizontal Spacing Commands
|
||||
/* |
||||
public class HorizSpaceMakeEqual : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.HorizSpaceMakeEqual; |
||||
} |
||||
} |
||||
|
||||
protected override bool CanExecuteCommand(IDesignerHost host) |
||||
{ |
||||
ISelectionService selectionService = (ISelectionService)host.GetService(typeof(ISelectionService)); |
||||
return selectionService.SelectionCount > 1; |
||||
} |
||||
} |
||||
|
||||
public class HorizSpaceIncrease : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.HorizSpaceIncrease; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class HorizSpaceDecrease : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.HorizSpaceDecrease; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class HorizSpaceConcatenate : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.HorizSpaceConcatenate; |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
#region Vertical Spacing Commands
|
||||
/* |
||||
public class VertSpaceMakeEqual : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.VertSpaceMakeEqual; |
||||
} |
||||
} |
||||
|
||||
protected override bool CanExecuteCommand(IDesignerHost host) |
||||
{ |
||||
ISelectionService selectionService = (ISelectionService)host.GetService(typeof(ISelectionService)); |
||||
return selectionService.SelectionCount > 1; |
||||
} |
||||
|
||||
} |
||||
|
||||
public class VertSpaceIncrease : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.VertSpaceIncrease; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class VertSpaceDecrease : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.VertSpaceDecrease; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class VertSpaceConcatenate : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.VertSpaceConcatenate; |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
#region Center Commands
|
||||
/* |
||||
public class CenterHorizontally : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.CenterHorizontally; |
||||
} |
||||
} |
||||
} |
||||
public class CenterVertically : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.CenterVertically; |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
#region Order Commands
|
||||
/* |
||||
public class SendToBack : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.SendToBack; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class BringToFront : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.BringToFront; |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
#region Tray Commands
|
||||
/* |
||||
public class LineUpIcons : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.LineupIcons; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class ShowLargeIcons : AbstractCheckableMenuCommand |
||||
{ |
||||
ReportDesignerView FormDesigner { |
||||
get { |
||||
IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; |
||||
if (window == null) { |
||||
return null; |
||||
} |
||||
return window.ActiveViewContent as ReportDesignerView; |
||||
} |
||||
} |
||||
public override bool IsChecked { |
||||
get { |
||||
ComponentTray tray = Tray; |
||||
if (tray != null) { |
||||
return tray.ShowLargeIcons; |
||||
} |
||||
return false; |
||||
} |
||||
set { |
||||
ComponentTray tray = Tray; |
||||
if (tray != null) { |
||||
tray.ShowLargeIcons = value; |
||||
} |
||||
} |
||||
} |
||||
ComponentTray Tray { |
||||
get { |
||||
ReportDesignerView formDesigner = FormDesigner; |
||||
if (formDesigner != null) { |
||||
return formDesigner.Host.GetService(typeof(ComponentTray)) as ComponentTray; |
||||
} |
||||
return null; |
||||
|
||||
} |
||||
} |
||||
public override void Run() |
||||
{ |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
#region Global Commands
|
||||
/* |
||||
public class LockControls : AbstractFormsDesignerCommand |
||||
{ |
||||
public override CommandID CommandID { |
||||
get { |
||||
return StandardCommands.LockControls; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Displays the tab order mode.
|
||||
/// </summary>
|
||||
public class ViewTabOrder : AbstractCheckableMenuCommand |
||||
{ |
||||
public override bool IsChecked { |
||||
get { |
||||
ReportDesignerView formDesigner = FormDesigner; |
||||
if (formDesigner != null) { |
||||
return formDesigner.IsTabOrderMode; |
||||
} |
||||
return false; |
||||
} |
||||
set { |
||||
SetTabOrder(value); |
||||
} |
||||
} |
||||
ReportDesignerView FormDesigner { |
||||
get { |
||||
IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; |
||||
if (window == null) { |
||||
return null; |
||||
} |
||||
return window.ActiveViewContent as ReportDesignerView; |
||||
} |
||||
} |
||||
|
||||
void SetTabOrder(bool show) |
||||
{ |
||||
ReportDesignerView formDesigner = FormDesigner; |
||||
if (formDesigner != null) { |
||||
if (show) { |
||||
formDesigner.ShowTabOrder(); |
||||
} else { |
||||
formDesigner.HideTabOrder(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
} |
@ -1,108 +0,0 @@
@@ -1,108 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Commands |
||||
{ |
||||
|
||||
public class AbstractPreviewCommand :AbstractCommand |
||||
{ |
||||
|
||||
public AbstractPreviewCommand(ReportModel model, ICSharpCode.Reports.Core.ReportViewer.PreviewControl reportViewer) |
||||
{ |
||||
if (model == null) { |
||||
throw new ArgumentNullException ("model"); |
||||
} |
||||
if (reportViewer == null) { |
||||
throw new ArgumentNullException("reportViewer"); |
||||
} |
||||
|
||||
this.Model = model; |
||||
this.ReportViewer = reportViewer; |
||||
} |
||||
|
||||
|
||||
public override void Run() |
||||
{ |
||||
CollectParametersCommand cmd = new CollectParametersCommand(Model.ReportSettings); |
||||
cmd.Run(); |
||||
} |
||||
|
||||
|
||||
public ICSharpCode.Reports.Core.ReportViewer.PreviewControl ReportViewer {get;private set;} |
||||
|
||||
|
||||
public ReportModel Model {get;private set;} |
||||
|
||||
} |
||||
|
||||
|
||||
public class FormSheetToReportViewerCommand:AbstractPreviewCommand |
||||
{ |
||||
public FormSheetToReportViewerCommand(ReportModel model, |
||||
ICSharpCode.Reports.Core.ReportViewer.PreviewControl reportViewer):base (model,reportViewer) |
||||
{ |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
base.Run(); |
||||
base.ReportViewer.RunReport (base.Model,(ReportParameters)null); |
||||
} |
||||
} |
||||
|
||||
|
||||
public class PullModelToReportViewerCommand:AbstractPreviewCommand |
||||
{ |
||||
|
||||
public PullModelToReportViewerCommand(ReportModel model, ICSharpCode.Reports.Core.ReportViewer.PreviewControl reportViewer):base (model,reportViewer) |
||||
{ |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
base.Run(); |
||||
SD.StatusBar.SetMessage("Connect..."); |
||||
base.ReportViewer.RunReport(base.Model,(ReportParameters)null); |
||||
} |
||||
} |
||||
|
||||
|
||||
public class PushModelToReportViewerCommand:AbstractPreviewCommand |
||||
{ |
||||
public PushModelToReportViewerCommand(ReportModel model, ICSharpCode.Reports.Core.ReportViewer.PreviewControl reportViewer):base (model,reportViewer) |
||||
{ |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
base.Run(); |
||||
DataSetFromXsdCommand cmd = new DataSetFromXsdCommand(); |
||||
cmd.Run(); |
||||
System.Data.DataSet ds = cmd.DataSet; |
||||
SD.StatusBar.SetMessage("Connect..."); |
||||
base.ReportViewer.RunReport(base.Model,ds.Tables[0],null); |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,108 +0,0 @@
@@ -1,108 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Dialogs; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Commands |
||||
{ |
||||
/// <summary>
|
||||
/// Description of StartView
|
||||
/// </summary>
|
||||
public class CreateDesignViewCommand : AbstractMenuCommand |
||||
{ |
||||
readonly OpenedFile openedFile; |
||||
|
||||
public CreateDesignViewCommand (OpenedFile openedFile) { |
||||
if (openedFile == null) |
||||
throw new ArgumentNullException("openedFile"); |
||||
this.openedFile = openedFile; |
||||
} |
||||
|
||||
public override void Run(){ |
||||
var generator = new ReportDesignerGenerator(); |
||||
DesignerView = new ReportDesignerView(openedFile, generator); |
||||
} |
||||
|
||||
public ReportDesignerView DesignerView {get; private set;} |
||||
} |
||||
|
||||
|
||||
public class CollectParametersCommand :AbstractCommand |
||||
{ |
||||
readonly ReportSettings reportSettings; |
||||
|
||||
public CollectParametersCommand (ReportSettings reportSettings) |
||||
{ |
||||
if (reportSettings == null) { |
||||
throw new ArgumentNullException("reportSettings"); |
||||
} |
||||
this.reportSettings = reportSettings; |
||||
} |
||||
|
||||
|
||||
public override void Run() |
||||
{ |
||||
if (reportSettings.SqlParameters.Count > 0) { |
||||
using (var paramDialog = new ParameterDialog(reportSettings.SqlParameters)) |
||||
{ |
||||
paramDialog.ShowDialog(); |
||||
if (paramDialog.DialogResult == System.Windows.Forms.DialogResult.OK) { |
||||
foreach (SqlParameter bp in paramDialog.SqlParameterCollection) |
||||
{ |
||||
var p = reportSettings.SqlParameters.Find (bp.ParameterName); |
||||
p.ParameterValue = bp.ParameterValue; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public class DataSetFromXsdCommand:AbstractCommand{ |
||||
System.Data.DataSet dataSet; |
||||
public override void Run() |
||||
{ |
||||
using (OpenFileDialog openFileDialog = new OpenFileDialog()){ |
||||
openFileDialog.Filter = GlobalValues.XsdFileFilter; |
||||
openFileDialog.DefaultExt = GlobalValues.XsdExtension; |
||||
openFileDialog.AddExtension = true; |
||||
if(openFileDialog.ShowDialog() == DialogResult.OK){ |
||||
if (openFileDialog.FileName.Length > 0) { |
||||
this.dataSet = new System.Data.DataSet(); |
||||
this.dataSet.ReadXml (openFileDialog.FileName); |
||||
this.dataSet.Locale = CultureInfo.InvariantCulture; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public System.Data.DataSet DataSet { |
||||
get { return dataSet; } |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,31 +0,0 @@
@@ -1,31 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System.Reflection; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
@ -1,111 +0,0 @@
@@ -1,111 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Drawing.Design; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of RowItemDesigner.
|
||||
/// </summary>
|
||||
public class ContainerItemDesigner:ParentControlDesigner |
||||
{ |
||||
|
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
|
||||
public ContainerItemDesigner() |
||||
{ |
||||
} |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
if (component == null) { |
||||
throw new ArgumentNullException("component"); |
||||
} |
||||
base.Initialize(component); |
||||
GetService (); |
||||
} |
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
|
||||
protected override void OnDragDrop(DragEventArgs de) |
||||
{ |
||||
base.OnDragDrop(de); |
||||
IToolboxService it = (IToolboxService)this.GetService(typeof(IToolboxService)); |
||||
it.SetSelectedToolboxItem(null); |
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
private void GetService () |
||||
{ |
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
|
||||
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) |
||||
{ |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
} |
||||
|
||||
|
||||
#region Dispose
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
|
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,106 +0,0 @@
@@ -1,106 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of DataItemDesigner.
|
||||
/// </summary>
|
||||
public class DataItemDesigner:ControlDesigner |
||||
{ |
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
base.Initialize(component); |
||||
GetService(); |
||||
} |
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
|
||||
#region SmartTags
|
||||
|
||||
public override DesignerActionListCollection ActionLists { |
||||
get { |
||||
DesignerActionListCollection actions = new DesignerActionListCollection (); |
||||
actions.Add (new TextBasedDesignerActionList(this.Component)); |
||||
|
||||
return actions; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void GetService () |
||||
{ |
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
|
||||
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
} |
||||
|
||||
|
||||
#region Dispose
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,146 +0,0 @@
@@ -1,146 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Collections; |
||||
using System.ComponentModel; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of DesignerHelper.
|
||||
/// </summary>
|
||||
internal sealed class DesignerHelper |
||||
{ |
||||
|
||||
private DesignerHelper() |
||||
{ |
||||
} |
||||
|
||||
public static void RemoveProperties (IDictionary properties) |
||||
{ |
||||
if (properties == null){ |
||||
throw new ArgumentNullException("properties"); |
||||
} |
||||
properties.Remove("AccessibleDescription"); |
||||
properties.Remove("AccessibleName"); |
||||
properties.Remove("AccessibleRole"); |
||||
properties.Remove("AllowDrop"); |
||||
properties.Remove("Anchor"); |
||||
properties.Remove("AutoScroll"); |
||||
properties.Remove("AutoSize"); |
||||
properties.Remove("BackgroundImage"); |
||||
properties.Remove("BackgroundImageLayout"); |
||||
properties.Remove("Cursor"); |
||||
properties.Remove("CausesValidation"); |
||||
properties.Remove("ContextMenuStrip"); |
||||
properties.Remove("DataBindings"); |
||||
properties.Remove("Dock"); |
||||
|
||||
properties.Remove("Enabled"); |
||||
|
||||
properties.Remove("ImeMode"); |
||||
properties.Remove("Locked"); |
||||
properties.Remove("Padding"); |
||||
properties.Remove("RightToLeft"); |
||||
properties.Remove("TabIndex"); |
||||
properties.Remove("TabStop"); |
||||
properties.Remove("Tag"); |
||||
properties.Remove("UseWaitCursor"); |
||||
properties.Remove("Visible"); |
||||
} |
||||
|
||||
public static void Remove (IDictionary properties,string[] toRemove) |
||||
{ |
||||
if (properties == null){ |
||||
throw new ArgumentNullException("properties"); |
||||
} |
||||
if (toRemove == null) { |
||||
throw new ArgumentNullException("toRemove"); |
||||
} |
||||
foreach (String str in toRemove) |
||||
{ |
||||
properties.Remove(str); |
||||
} |
||||
} |
||||
|
||||
public static void AddDefaultProperties (List<PropertyDescriptor> allProperties, |
||||
PropertyDescriptorCollection props ) |
||||
{ |
||||
PropertyDescriptor prop = props.Find("Location",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Size",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("BackColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
// prop = props.Find ("VisibleInReport",true);
|
||||
// allProperties.Add(prop);
|
||||
|
||||
|
||||
// need this for Contextmenu's
|
||||
prop = props.Find("ContextMenu",true); |
||||
allProperties.Add(prop); |
||||
} |
||||
|
||||
public static void AddTextBasedProperties (List<PropertyDescriptor> allProperties, |
||||
PropertyDescriptorCollection props) |
||||
{ |
||||
PropertyDescriptor prop = props.Find("Font",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FormatString",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("StringTrimming",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ContentAlignment",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("CanGrow",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("CanShrink",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DataType",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("RTL",true); |
||||
allProperties.Add(prop); |
||||
} |
||||
|
||||
public static void AddGraphicProperties (List<PropertyDescriptor> allProperties, |
||||
PropertyDescriptorCollection props) |
||||
{ |
||||
PropertyDescriptor prop = null; |
||||
prop = props.Find("ForeColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DashStyle",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Thickness",true); |
||||
allProperties.Add(prop); |
||||
} |
||||
} |
||||
} |
@ -1,172 +0,0 @@
@@ -1,172 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
public class DragObject |
||||
{ |
||||
private ReportRootDesigner m_designer; |
||||
private Control m_dragControl; |
||||
private ArrayList m_dragShapes; |
||||
private object m_hitObject; |
||||
private int m_initialX; |
||||
private int m_initialY; |
||||
private Point m_screenOffset; |
||||
private Point m_mouseOffset; |
||||
private bool m_removeOldDrag; |
||||
|
||||
public DragObject(ReportRootDesigner designer, Control dragControl, object hitTestObject, int initialX, int initialY) |
||||
{ |
||||
m_designer = designer; |
||||
m_dragControl = dragControl; |
||||
m_hitObject = hitTestObject; |
||||
m_initialX = initialX; |
||||
m_initialY = initialY; |
||||
m_mouseOffset = new Point(0, 0); |
||||
m_screenOffset = new Point(0, 0); |
||||
m_screenOffset = dragControl.PointToScreen(m_screenOffset); |
||||
|
||||
// The drag actually consists of all objects that are currently selected.
|
||||
//
|
||||
ISelectionService ss = designer.SelectionService; |
||||
IDesignerHost host = designer.Host; |
||||
|
||||
m_dragShapes = new ArrayList(); |
||||
|
||||
if (ss != null && host != null) |
||||
{ |
||||
ICollection selectedObjects = ss.GetSelectedComponents(); |
||||
foreach(object o in selectedObjects) |
||||
{ |
||||
IComponent comp = o as IComponent; |
||||
if (comp != null) |
||||
{ |
||||
ItemDesigner des = host.GetDesigner(comp) as ItemDesigner; |
||||
if (des != null) |
||||
{ |
||||
m_dragShapes.Add(des); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This is the control that initiated the drag.
|
||||
/// </summary>
|
||||
public Control DragControl |
||||
{ |
||||
get |
||||
{ |
||||
return m_dragControl; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Called to clear any feedback drawing we have already done.
|
||||
/// </summary>
|
||||
public void ClearFeedback() |
||||
{ |
||||
if (m_removeOldDrag) |
||||
{ |
||||
m_removeOldDrag = false; |
||||
foreach(ItemDesigner sd in m_dragShapes) |
||||
{ |
||||
sd.DrawDragFeedback(m_hitObject, m_dragControl.BackColor, m_screenOffset, m_mouseOffset); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This performs the actual drop, which just moves all of our components
|
||||
/// to the drop location.
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
public void Drop(int x, int y) |
||||
{ |
||||
System.Console.WriteLine("\tDragObject:Drop"); |
||||
ClearFeedback(); |
||||
Point pt = new Point(x, y); |
||||
pt = m_dragControl.PointToClient(pt); |
||||
x = pt.X - m_initialX; |
||||
y = pt.Y - m_initialY; |
||||
|
||||
// If we have more than one shape, we need to wrap
|
||||
// in a designer transaction.
|
||||
//
|
||||
if (m_dragShapes.Count > 1) |
||||
{ |
||||
IDesignerHost host = this.m_designer.Host; |
||||
if (host != null) |
||||
{ |
||||
using(DesignerTransaction trans = host.CreateTransaction("Drag " + m_dragShapes.Count + " components")) |
||||
{ |
||||
foreach(ItemDesigner sd in m_dragShapes) |
||||
{ |
||||
sd.Drag(m_hitObject, x, y); |
||||
} |
||||
|
||||
trans.Commit(); |
||||
} |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
foreach(ItemDesigner sd in m_dragShapes) |
||||
{ |
||||
sd.Drag(m_hitObject, x, y); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Called during dragging so we can update our feedback.
|
||||
/// </summary>
|
||||
public void GiveFeedback() |
||||
{ |
||||
// First, if we had prior feedback, clear it.
|
||||
ClearFeedback(); |
||||
|
||||
// Now, draw new feedback. The feedback coordinates
|
||||
// are global and designed in such a way so that they
|
||||
// can be added to the shape coordinates directly.
|
||||
// To do this we take the global mouse position and
|
||||
// subtract off this position in client coordinates
|
||||
// of the drag control.
|
||||
//
|
||||
Point currentPosition = Control.MousePosition; |
||||
m_mouseOffset.X = currentPosition.X - m_screenOffset.X - m_initialX; |
||||
m_mouseOffset.Y = currentPosition.Y - m_screenOffset.Y - m_initialY; |
||||
|
||||
foreach(ItemDesigner sd in m_dragShapes) |
||||
{ |
||||
sd.DrawDragFeedback(m_hitObject, m_dragControl.BackColor, m_screenOffset, m_mouseOffset); |
||||
} |
||||
|
||||
m_removeOldDrag = true; |
||||
} |
||||
} |
||||
} |
@ -1,87 +0,0 @@
@@ -1,87 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GroupeHeaderDesigner.
|
||||
/// </summary>
|
||||
public class GroupHeaderDesigner:DataItemDesigner |
||||
{ |
||||
|
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
|
||||
public GroupHeaderDesigner() |
||||
{ |
||||
} |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
base.Initialize(component); |
||||
} |
||||
|
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void GetService () |
||||
{ |
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
|
||||
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,96 +0,0 @@
@@ -1,96 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GroupedRowDesigner.
|
||||
/// </summary>
|
||||
public class GroupedRowDesigner:ContainerItemDesigner |
||||
{ |
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
|
||||
public GroupedRowDesigner() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
base.Initialize(component); |
||||
GetService(); |
||||
} |
||||
|
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
|
||||
private void GetService () |
||||
{ |
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
|
||||
} |
||||
|
||||
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Text = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
} |
@ -1,109 +0,0 @@
@@ -1,109 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
|
||||
{ |
||||
/// <summary>
|
||||
/// Description of ShapeDesigner.
|
||||
/// </summary>
|
||||
public class ImageDesigner:ControlDesigner |
||||
{ |
||||
ISelectionService selectionService; |
||||
IComponentChangeService componentChangeService; |
||||
|
||||
public ImageDesigner() |
||||
{ |
||||
} |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
if (component == null) { |
||||
throw new ArgumentNullException("component"); |
||||
} |
||||
base.Initialize(component); |
||||
|
||||
this.componentChangeService = (IComponentChangeService)component.Site.GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentChanging += OnComponentChanging; |
||||
componentChangeService.ComponentChanged += OnComponentChanged; |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
|
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
|
||||
} |
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
private void OnComponentChanging (object sender,ComponentChangingEventArgs e) |
||||
{ |
||||
// System.Console.WriteLine("changing");
|
||||
// System.Console.WriteLine("{0}",this.baseLine.ClientRectangle);
|
||||
} |
||||
|
||||
|
||||
private void OnComponentChanged(object sender,ComponentChangedEventArgs e) |
||||
{ |
||||
// System.Console.WriteLine("changed");
|
||||
// System.Console.WriteLine("{0}",this.baseLine.ClientRectangle);
|
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
|
||||
if (this.componentChangeService != null) { |
||||
componentChangeService.ComponentChanging -= OnComponentChanging; |
||||
componentChangeService.ComponentChanged -= OnComponentChanged; |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
} |
@ -1,259 +0,0 @@
@@ -1,259 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of LineDesigner.
|
||||
/// </summary>
|
||||
public class LineDesigner:ControlDesigner |
||||
{ |
||||
private BaseLineItem baseLine; |
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
private bool dragging; |
||||
private bool overToPoint; |
||||
private bool overFromPoint; |
||||
|
||||
|
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
if (component == null) { |
||||
throw new ArgumentNullException("component"); |
||||
} |
||||
base.Initialize(component); |
||||
this.baseLine = (BaseLineItem)component; |
||||
|
||||
this.componentChangeService = (IComponentChangeService)component.Site.GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentChanging += OnComponentChanging; |
||||
componentChangeService.ComponentChanged += OnComponentChanged; |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
|
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
|
||||
} |
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
|
||||
#region events
|
||||
|
||||
private void OnComponentChanging (object sender,ComponentChangingEventArgs e) |
||||
{ |
||||
// System.Console.WriteLine("changing");
|
||||
// System.Console.WriteLine("{0}",this.baseLine.ClientRectangle);
|
||||
} |
||||
|
||||
|
||||
private void OnComponentChanged(object sender,ComponentChangedEventArgs e) |
||||
{ |
||||
System.Console.WriteLine("changed"); |
||||
System.Console.WriteLine("{0}",this.baseLine.ClientRectangle); |
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
protected override void OnPaintAdornments(PaintEventArgs pe) |
||||
{ |
||||
BaseLineItem label = (BaseLineItem) Control; |
||||
|
||||
if (selectionService != null) |
||||
{ |
||||
if (selectionService.GetComponentSelected(label)) |
||||
{ |
||||
// Paint grab handles.
|
||||
Rectangle grapRectangle = GetHandle(label.FromPoint); |
||||
ControlPaint.DrawGrabHandle(pe.Graphics, grapRectangle, true, true); |
||||
grapRectangle = GetHandle(label.ToPoint); |
||||
ControlPaint.DrawGrabHandle(pe.Graphics, grapRectangle, true, true); |
||||
|
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
private static Rectangle GetHandle(Point pt) |
||||
{ |
||||
Rectangle handle = new Rectangle(pt, new Size(7, 7)); |
||||
handle.Offset(-3, -3); |
||||
return handle; |
||||
} |
||||
|
||||
|
||||
protected override void OnSetCursor( ) |
||||
{ |
||||
// Get mouse cursor position relative to
|
||||
// the control's coordinate space.
|
||||
|
||||
BaseLineItem label = (BaseLineItem) Control; |
||||
Point p = label.PointToClient(Cursor.Position); |
||||
|
||||
// Display a resize cursor if the mouse is
|
||||
// over a grab handle; otherwise show a
|
||||
// normal arrow.
|
||||
if (GetHandle(label.FromPoint).Contains(p) || |
||||
GetHandle(label.ToPoint).Contains(p)) |
||||
{ |
||||
Cursor.Current = Cursors.SizeAll; |
||||
} |
||||
else |
||||
{ |
||||
Cursor.Current = Cursors.Default; |
||||
} |
||||
} |
||||
|
||||
|
||||
#region Drag handling state and methods
|
||||
|
||||
protected override void OnMouseDragBegin(int x, int y) |
||||
{ |
||||
System.Console.WriteLine("DragBegib"); |
||||
Point p = this.baseLine.PointToClient(new Point(x, y)); |
||||
overFromPoint = GetHandle(this.baseLine.FromPoint).Contains(p); |
||||
this.overToPoint = GetHandle(this.baseLine.ToPoint).Contains(p); |
||||
if (overFromPoint || overToPoint ) |
||||
{ |
||||
dragging = true; |
||||
// PropertyDescriptor pd =
|
||||
// TypeDescriptor.GetProperties(this.baseLine)["FromPoint"];
|
||||
// pd.SetValue(this.baseLine, p);
|
||||
// dragDirection = overToPoint;
|
||||
// Point current = dragDirection ?
|
||||
// (label.Origin + label.Direction) :
|
||||
// label.Origin;
|
||||
// dragOffset = current - new Size(p);
|
||||
} |
||||
else |
||||
{ |
||||
dragging = false; |
||||
base.OnMouseDragBegin(x, y); |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void OnMouseDragMove(int x, int y) |
||||
{ |
||||
if (dragging) |
||||
{ |
||||
Point p = this.baseLine.PointToClient(new Point(x, y)); |
||||
if (this.overToPoint) { |
||||
this.baseLine.ToPoint = p; |
||||
} else { |
||||
this.baseLine.FromPoint = p; |
||||
} |
||||
|
||||
// this.baseLine.Invalidate();
|
||||
// this.dragOffset = p;
|
||||
} |
||||
else |
||||
{ |
||||
base.OnMouseDragMove(x, y); |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void OnMouseDragEnd(bool cancel) |
||||
{ |
||||
if (dragging) |
||||
{ |
||||
// Update property via PropertyDescriptor to
|
||||
// make sure that VS.NET notices.
|
||||
|
||||
// PropertyDescriptor pd =
|
||||
// TypeDescriptor.GetProperties(this.baseLine)["ToPoint"];
|
||||
// pd.SetValue(this.baseLine, this.dragOffset);
|
||||
/* |
||||
DirectionalLabel label = (DirectionalLabel) Control; |
||||
if (dragDirection) |
||||
{ |
||||
Size d = label.Direction; |
||||
PropertyDescriptor pd = |
||||
TypeDescriptor.GetProperties(label)["Direction"]; |
||||
pd.SetValue(label, d); |
||||
} |
||||
else |
||||
{ |
||||
Point o = label.Origin; |
||||
PropertyDescriptor pd = |
||||
TypeDescriptor.GetProperties(label)["Origin"]; |
||||
pd.SetValue(label, o); |
||||
} |
||||
*/ |
||||
dragging = false; |
||||
this.baseLine.Invalidate(); |
||||
} |
||||
|
||||
// Always call base class.
|
||||
base.OnMouseDragEnd(cancel); |
||||
|
||||
} |
||||
//
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
|
||||
if (this.componentChangeService != null) { |
||||
componentChangeService.ComponentChanging -= OnComponentChanging; |
||||
componentChangeService.ComponentChanged -= OnComponentChanged; |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
} |
@ -1,114 +0,0 @@
@@ -1,114 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Drawing.Printing; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportItemsContainer.
|
||||
/// </summary>
|
||||
public class RootReportModel:RootDesignedComponent |
||||
{ |
||||
|
||||
bool showDebugFrame; |
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea) |
||||
{ |
||||
base.OnPaint(pea); |
||||
if (this.showDebugFrame) { |
||||
PrintMargin(pea.Graphics); |
||||
} |
||||
using (Font f = GlobalsDesigner.DesignerFont) { |
||||
foreach(System.Windows.Forms.Control ctrl in this.Controls) |
||||
{ |
||||
pea.Graphics.DrawString(ctrl.Name, |
||||
f, |
||||
Brushes.LightGray, |
||||
ctrl.Location.X,ctrl.Location.Y - (int)f.GetHeight() - 3); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public void Toggle () |
||||
{ |
||||
this.showDebugFrame = !this.showDebugFrame; |
||||
this.Invalidate(true); |
||||
} |
||||
|
||||
private void PrintMargin( Graphics e) |
||||
{ |
||||
string s = String.Format(System.Globalization.CultureInfo.CurrentCulture, |
||||
"[Size : {0}] [Landscape : {1}] [Bounds : {2}]", |
||||
this.Page,this.Landscape,this.PageMargin); |
||||
using (Font f = GlobalsDesigner.DesignerFont){ |
||||
SizeF size = e.MeasureString(s,f); |
||||
e.DrawString(s,f, |
||||
new SolidBrush(Color.LightGray), |
||||
new Rectangle(this.PageMargin.Left + 100, |
||||
this.PageMargin.Top - (int)f.GetHeight() - 3, |
||||
(int)size.Width, |
||||
(int)size.Height)); |
||||
|
||||
Rectangle rect = new Rectangle(this.PageMargin.Left - 2,this.PageMargin.Top - 2, |
||||
this.Page.Width - this.PageMargin.Left - this.PageMargin.Right + 2, |
||||
this.Size.Height - this.PageMargin.Top - this.PageMargin.Bottom + 2); |
||||
e.DrawRectangle(new Pen(Color.LightGray,1),rect); |
||||
} |
||||
} |
||||
|
||||
|
||||
public Margins PageMargin {get;set;} |
||||
|
||||
|
||||
public Rectangle Page {get;set;} |
||||
|
||||
public bool Landscape {get;set;} |
||||
} |
||||
|
||||
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.ReportRootDesigner), typeof(IRootDesigner))] |
||||
public class RootDesignedComponent : System.Windows.Forms.UserControl |
||||
{ |
||||
public RootDesignedComponent() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.SuspendLayout(); |
||||
//
|
||||
// UserControl1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.BackColor = System.Drawing.SystemColors.Window; |
||||
this.Name = "UserControl1"; |
||||
this.Size = new System.Drawing.Size(800, 800); |
||||
this.ResumeLayout(false); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,394 +0,0 @@
@@ -1,394 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Drawing.Design; |
||||
using System.Drawing.Printing; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportRootDesigner.
|
||||
/// </summary>
|
||||
|
||||
public class ReportRootDesigner: DocumentDesigner |
||||
{ |
||||
private ICollection currentSelection; |
||||
private IDesignerHost host; |
||||
private MenuCommandService menuCommandService; |
||||
private IToolboxService toolboxService; |
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
private List<BaseSection> sections; |
||||
private ReportSettings reportSettings; |
||||
private RootReportModel rootReportModel; |
||||
|
||||
public ReportRootDesigner() |
||||
{ |
||||
} |
||||
|
||||
|
||||
private void ShowMessage(Exception e) |
||||
{ |
||||
base.DisplayError(e); |
||||
IUIService s = (IUIService)host.GetService(typeof(IUIService)); |
||||
if (s != null) { |
||||
s.ShowError(e); |
||||
} |
||||
} |
||||
|
||||
// private new void DisplayError(Exception ex)
|
||||
// {
|
||||
// MessageBox.Show(ex.Message + "\n" + ex.StackTrace, "Fehler im Designer", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
// }
|
||||
|
||||
|
||||
private void InitializeGUI() |
||||
{ |
||||
reportSettings = host.Container.Components[1] as ReportSettings; |
||||
InitializeRootReportModel(); |
||||
} |
||||
|
||||
|
||||
private void InitializeRootReportModel () |
||||
{ |
||||
this.rootReportModel = host.Container.Components[0] as RootReportModel; |
||||
this.rootReportModel.PageMargin = CalculateMargins(); |
||||
this.rootReportModel.Page = new Rectangle(new Point(0,0),this.reportSettings.PageSize); |
||||
this.rootReportModel.Landscape = this.reportSettings.Landscape; |
||||
this.rootReportModel.Invalidate(); |
||||
} |
||||
|
||||
|
||||
private Margins CalculateMargins () |
||||
{ |
||||
return new Margins(this.reportSettings.LeftMargin,reportSettings.RightMargin, |
||||
reportSettings.TopMargin,reportSettings.BottomMargin); |
||||
} |
||||
|
||||
#region overrides
|
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
base.Initialize(component); |
||||
sections = new List<BaseSection>(); |
||||
|
||||
// We need to listen to change events. If a shape changes,
|
||||
// we need to invalidate our view.
|
||||
//
|
||||
|
||||
this.componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (this.componentChangeService != null) |
||||
{ |
||||
this.componentChangeService.ComponentAdded += new ComponentEventHandler(OnComponentAdded); |
||||
// this.componentChangeService.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving);
|
||||
// this.componentChangeService.ComponentRemoved += new ComponentEventHandler(OnComponentRemoved);
|
||||
this.componentChangeService.ComponentChanged += new ComponentChangedEventHandler(OnComponentChanged); |
||||
this.componentChangeService.ComponentChanging += new ComponentChangingEventHandler(OnComponentChanging); |
||||
} |
||||
|
||||
|
||||
// Add the menu commands we support. We must be a member of the VSIP program to
|
||||
// define new menu items, but we can handle any item located within the StandardCommands
|
||||
// class because Visual Studio already defines them.
|
||||
//
|
||||
|
||||
menuCommandService = (MenuCommandService)GetService(typeof(MenuCommandService)); |
||||
/* |
||||
if (menuCommandService != null) |
||||
{ |
||||
/* |
||||
m_menuCommands = new MenuCommand[] |
||||
{ |
||||
new MenuCommand(new EventHandler(OnMenuCut), StandardCommands.Cut), |
||||
new MenuCommand(new EventHandler(OnMenuCopy), StandardCommands.Copy), |
||||
// new ImmediateMenuCommand(new EventHandler(OnMenuPasteStatus), new EventHandler(OnMenuPaste), StandardCommands.Paste),
|
||||
new MenuCommand(new EventHandler(OnMenuDelete), StandardCommands.Delete) |
||||
}; |
||||
|
||||
foreach(MenuCommand mc in m_menuCommands) |
||||
{ |
||||
m_menuCommandService.AddCommand(mc); |
||||
} |
||||
|
||||
System.Console.WriteLine("RootDesigner menuService set"); |
||||
} |
||||
*/ |
||||
// Select our base shape. By default there is nothing selected but that looks
|
||||
// strange (the property grid is empty).
|
||||
//
|
||||
|
||||
this.selectionService = (ISelectionService)GetService(typeof(ISelectionService)); |
||||
if (this.selectionService != null) |
||||
{ |
||||
this.selectionService.SetSelectedComponents(new object[] {component}, SelectionTypes.Replace); |
||||
this.selectionService.SelectionChanged += new EventHandler(OnSelectionChanged); |
||||
} |
||||
|
||||
this.host = (IDesignerHost)GetService(typeof(IDesignerHost)); |
||||
|
||||
this.menuCommandService = (MenuCommandService)host.GetService(typeof(MenuCommandService)); |
||||
if (host != null) |
||||
{ |
||||
host.LoadComplete += new EventHandler(OnLoadComplete); |
||||
} |
||||
//Dragdropp only allowed in Section
|
||||
this.Control.AllowDrop = false; |
||||
} |
||||
|
||||
|
||||
public override SelectionRules SelectionRules { |
||||
get { |
||||
return SelectionRules.BottomSizeable; |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void PostFilterProperties(IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
string [] s = new string[]{"Visible","BackColor","Text","MaximumSize","MinimumSize","Size", |
||||
"AutoScaleDimensions","DataBindings"}; |
||||
DesignerHelper.Remove(properties,s); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
public override bool CanParent(ControlDesigner controlDesigner) |
||||
{ |
||||
return base.CanParent(controlDesigner); |
||||
} |
||||
|
||||
|
||||
public override bool CanBeParentedTo(IDesigner parentDesigner) |
||||
{ |
||||
return base.CanBeParentedTo(parentDesigner); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Events
|
||||
|
||||
private void OnSectionSizeChanged (object sender, EventArgs e) |
||||
{ |
||||
this.RecalculateSections(); |
||||
} |
||||
|
||||
|
||||
private void RecalculateSections() |
||||
{ |
||||
int locY = 50; |
||||
if (this.reportSettings == null) { |
||||
reportSettings = host.Container.Components[1] as ReportSettings; |
||||
} |
||||
|
||||
foreach (BaseSection s in sections) |
||||
{ |
||||
s.Location = new Point(this.reportSettings.LeftMargin,locY); |
||||
locY = locY + s.Size.Height + GlobalsDesigner.GabBetweenSection; |
||||
} |
||||
this.Control.Invalidate(); |
||||
} |
||||
|
||||
|
||||
|
||||
private void OnLoadComplete(object sender, EventArgs e) |
||||
{ |
||||
IDesignerHost host = (IDesignerHost)sender; |
||||
host.LoadComplete -= new EventHandler(this.OnLoadComplete); |
||||
InitializeGUI(); |
||||
} |
||||
|
||||
|
||||
private void OnComponentAdded(object sender, ComponentEventArgs ce) |
||||
{ |
||||
BaseSection section = ce.Component as BaseSection; |
||||
|
||||
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); |
||||
} |
||||
|
||||
this.Control.Controls.Add(section); |
||||
RecalculateSections(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void AddToHost (Control ctrl) |
||||
{ |
||||
if (ctrl.Controls.Count > 0) { |
||||
foreach (Control c1 in ctrl.Controls) { |
||||
AddToHost (c1); |
||||
} |
||||
} |
||||
this.host.Container.Add(ctrl as IComponent); |
||||
} |
||||
|
||||
/* |
||||
private void OnComponentRemoving (object sender, ComponentEventArgs ce) |
||||
|
||||
// System.Console.WriteLine("RootDesigner:OnComponentRemoving {0}",ce.Component.ToString());
|
||||
} |
||||
|
||||
|
||||
private void OnComponentRemoved (object sender, ComponentEventArgs ce) |
||||
{ |
||||
// System.Console.WriteLine("RootDesigner:OnComponentRemoved {0}",ce.Component.ToString());
|
||||
} |
||||
*/ |
||||
|
||||
|
||||
private void OnComponentChanged(object sender, ComponentChangedEventArgs ce) |
||||
{ |
||||
LoggingService.InfoFormatted("RootDesigner:OnComponentChanged"); |
||||
String str = String.Format("RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue); |
||||
LoggingService.InfoFormatted(str); |
||||
|
||||
BaseSection section = ce.Component as BaseSection; |
||||
if (section != null) { |
||||
foreach (BaseSection s in sections) |
||||
{ |
||||
if (s.Name == section.Name) { |
||||
s.Size = section.Size; |
||||
} |
||||
} |
||||
RecalculateSections(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnComponentChanging(object sender, ComponentChangingEventArgs ce) |
||||
{ |
||||
System.Console.WriteLine("RootDesigner:OnComponentChanging"); |
||||
// Host.CreateTransaction();
|
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
currentSelection = ((ISelectionService)sender).GetSelectedComponents(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
public IDesignerHost Host { |
||||
get { |
||||
if (this.host == null) { |
||||
this.host = (IDesignerHost)this.GetService(typeof(IDesignerHost)); |
||||
} |
||||
return host; } |
||||
} |
||||
|
||||
|
||||
public IToolboxService ToolboxService |
||||
{ |
||||
get |
||||
{ |
||||
if (toolboxService == null) |
||||
{ |
||||
toolboxService = (IToolboxService)this.GetService(typeof(IToolboxService)); |
||||
} |
||||
return toolboxService; |
||||
} |
||||
} |
||||
|
||||
|
||||
public ISelectionService SelectionService { |
||||
get { |
||||
if (this.selectionService == null) { |
||||
this.selectionService = (ISelectionService)this.GetService(typeof(ISelectionService)); |
||||
} |
||||
return selectionService; } |
||||
} |
||||
|
||||
|
||||
public IComponentChangeService ComponentChangeService { |
||||
get { |
||||
if (this.componentChangeService == null) { |
||||
this.componentChangeService = (IComponentChangeService)this.GetService(typeof(IComponentChangeService)); |
||||
} |
||||
return componentChangeService; } |
||||
} |
||||
|
||||
public MenuCommandService MenuCommandService { |
||||
get { |
||||
if (this.menuCommandService == null) { |
||||
this.menuCommandService = (MenuCommandService)Host.GetService(typeof(IMenuCommandService)); |
||||
} |
||||
return (MenuCommandService)host.GetService(typeof(IMenuCommandService)); |
||||
} |
||||
} |
||||
|
||||
|
||||
public ICollection CurrentSelection { |
||||
get { return currentSelection; } |
||||
} |
||||
|
||||
|
||||
#region Dispose
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) |
||||
{ |
||||
IComponentChangeService cs = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (cs != null) |
||||
{ |
||||
cs.ComponentChanged -= new ComponentChangedEventHandler(OnComponentChanged); |
||||
cs.ComponentChanging -= new ComponentChangingEventHandler(OnComponentChanging); |
||||
} |
||||
|
||||
ISelectionService ss = (ISelectionService)GetService(typeof(ISelectionService)); |
||||
if (ss != null) |
||||
{ |
||||
ss.SelectionChanged -= new EventHandler(OnSelectionChanged); |
||||
} |
||||
/* |
||||
if (m_menuCommands != null && m_menuCommandService != null) |
||||
{ |
||||
foreach(MenuCommand mc in m_menuCommands) |
||||
{ |
||||
m_menuCommandService.RemoveCommand(mc); |
||||
} |
||||
m_menuCommands = null; |
||||
} |
||||
*/ |
||||
} |
||||
|
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,379 +0,0 @@
@@ -1,379 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ctrlRuler.
|
||||
/// </summary>
|
||||
public class Ruler : System.Windows.Forms.UserControl |
||||
{ |
||||
public enum RulerDirection |
||||
{ |
||||
Horizontal, |
||||
Vertical |
||||
} |
||||
|
||||
int leftMargin; |
||||
int rightMargin; |
||||
int startValue; |
||||
int endValue; |
||||
int bigStep ; |
||||
int smallStep; |
||||
bool drawFrame; |
||||
|
||||
Size paperSize; |
||||
System.Drawing.GraphicsUnit scaleUnit; |
||||
RulerDirection direction; |
||||
|
||||
System.Drawing.Color marginColor; |
||||
|
||||
public event EventHandler StartValueChange; |
||||
public event EventHandler EndValueChange; |
||||
|
||||
public Ruler() |
||||
{ |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
InitializeComponent(); |
||||
scaleUnit = GraphicsUnit.Millimeter; |
||||
} |
||||
|
||||
#region privates
|
||||
|
||||
private void Line(Graphics g, int x1, int y1, int x2, int y2) |
||||
{ |
||||
g.DrawLine(new Pen(new SolidBrush(this.ForeColor)), x1, y1, x2, y2); |
||||
} |
||||
|
||||
private static void Line(Graphics g, Pen pen,int x1, int y1, int x2, int y2) |
||||
{ |
||||
g.DrawLine(pen, x1, y1, x2, y2); |
||||
} |
||||
|
||||
private static SizeF CalcReciprocals(Graphics g) |
||||
{ |
||||
switch(g.PageUnit) |
||||
{ |
||||
case GraphicsUnit.World: |
||||
case GraphicsUnit.Pixel: |
||||
|
||||
return new SizeF(1f,1f); |
||||
|
||||
case GraphicsUnit.Inch: |
||||
|
||||
return new SizeF(1f/g.DpiX,1f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Millimeter: |
||||
|
||||
return new SizeF(25.4f/g.DpiX,25.4f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Point: |
||||
|
||||
return new SizeF(72f/g.DpiX,72f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Display: |
||||
|
||||
return new SizeF(75f/g.DpiX,75f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Document: |
||||
|
||||
return new SizeF(300f/g.DpiX,300f/g.DpiY); |
||||
|
||||
} |
||||
return new SizeF(10,10);//never gets here...
|
||||
} |
||||
|
||||
|
||||
|
||||
private void SetSize (GraphicsUnit unit) |
||||
{ |
||||
if (unit == GraphicsUnit.Millimeter) { |
||||
bigStep = 10; |
||||
smallStep = 5; |
||||
paperSize = new Size (210,297); |
||||
} else { |
||||
throw new System.NotImplementedException (); |
||||
} |
||||
} |
||||
|
||||
|
||||
void PaintVertical (Graphics g) |
||||
{ |
||||
int bigStep = 0; |
||||
Pen pen = new System.Drawing.Pen (System.Drawing.Color.Black,0.25f); |
||||
Brush brush = new SolidBrush(System.Drawing.Color.Black); |
||||
|
||||
switch (scaleUnit) { |
||||
case GraphicsUnit.Millimeter: |
||||
g.PageUnit = GraphicsUnit.Millimeter; |
||||
g.PageScale = 1; |
||||
SetSize (scaleUnit); |
||||
bigStep = 10; |
||||
smallStep = 5; |
||||
break; |
||||
case GraphicsUnit.Inch: |
||||
break; |
||||
|
||||
} |
||||
SizeF size = CalcReciprocals (g); |
||||
int bLine,sLine; |
||||
sLine = (int)(this.Width / 3 * size.Width); |
||||
bLine = sLine * 2; |
||||
|
||||
int start = 0; |
||||
if (startValue > 0) { |
||||
start = (int)(startValue / 10); |
||||
} |
||||
|
||||
endValue = paperSize.Height; |
||||
|
||||
int i = 0; |
||||
int drawPos = 0; |
||||
while (i < this.Height) { |
||||
drawPos = i * bigStep; |
||||
g.DrawString ((i + start).ToString(System.Globalization.CultureInfo.CurrentCulture), |
||||
this.Font,brush,3,drawPos); |
||||
Line (g,pen,0,drawPos,bLine,drawPos); |
||||
Line (g,pen, |
||||
0,drawPos - smallStep, |
||||
sLine,drawPos - smallStep); |
||||
i ++; |
||||
} |
||||
pen.Dispose(); |
||||
brush.Dispose(); |
||||
} |
||||
|
||||
void PaintHorizontal (Graphics g) |
||||
{ |
||||
Pen pen = new System.Drawing.Pen (System.Drawing.Color.Black,0.25f); |
||||
Brush brush = new SolidBrush(System.Drawing.Color.Black); |
||||
|
||||
switch (scaleUnit) { |
||||
case GraphicsUnit.Millimeter: |
||||
g.PageUnit = GraphicsUnit.Millimeter; |
||||
g.PageScale = 1; |
||||
SetSize (scaleUnit); |
||||
break; |
||||
case GraphicsUnit.Inch: |
||||
break; |
||||
|
||||
} |
||||
|
||||
SizeF size = CalcReciprocals (g); |
||||
int bLine,sLine; |
||||
sLine = (int)(this.Height / 3 * size.Height); |
||||
bLine = sLine * 2; |
||||
|
||||
int start = 0; |
||||
if (startValue > 0) { |
||||
start = (int)(startValue / 10); |
||||
} |
||||
|
||||
endValue = paperSize.Width; |
||||
|
||||
if (drawFrame == true) { |
||||
g.DrawRectangle (pen,0,0,(this.Width - 1) * size.Width,(this.Height - 1) * size.Width); |
||||
} |
||||
|
||||
|
||||
int i = 0; |
||||
int drawPos = 0; |
||||
|
||||
while (i < (int)((endValue / 10) + 1)) { |
||||
drawPos = i * bigStep; |
||||
g.DrawString ((i + start).ToString(System.Globalization.CultureInfo.CurrentCulture), |
||||
this.Font,brush,drawPos,sLine); |
||||
Line (g,pen,drawPos,0,i * bigStep,bLine); |
||||
Line (g,pen,drawPos - smallStep,0,drawPos - smallStep,sLine); |
||||
i ++; |
||||
} |
||||
// MarginMarker
|
||||
if (leftMargin > 0) { |
||||
Line (g, |
||||
(int)(leftMargin),0, |
||||
(int)(leftMargin),bLine); |
||||
} |
||||
pen.Dispose(); |
||||
brush.Dispose(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint (e); |
||||
e.Graphics.Clear (this.BackColor); |
||||
if (this.direction == RulerDirection.Horizontal) { |
||||
PaintHorizontal (e.Graphics); |
||||
} else { |
||||
PaintVertical (e.Graphics); |
||||
} |
||||
} |
||||
|
||||
protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) |
||||
{ |
||||
pevent.Graphics.FillRectangle(Brushes.White, |
||||
new Rectangle(0, |
||||
0, |
||||
Width, |
||||
Height)); |
||||
|
||||
} |
||||
|
||||
|
||||
protected override void OnResize(System.EventArgs e) |
||||
{ |
||||
base.OnResize (e); |
||||
if (this.Width < this.Height) { |
||||
direction = RulerDirection.Vertical; |
||||
} else { |
||||
direction = RulerDirection.Horizontal; |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Getter/Setter
|
||||
[Description("Left Margin")] |
||||
[Category("Ruler")] |
||||
public int LeftMargin { |
||||
get { |
||||
return leftMargin; |
||||
} |
||||
set { |
||||
leftMargin = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("RightMargin")] |
||||
[Category("Ruler")] |
||||
public int RightMargin { |
||||
get { |
||||
return rightMargin; |
||||
} |
||||
set { |
||||
rightMargin = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("A value from which the ruler marking should be shown. Default is zero.")] |
||||
[Category("Ruler")] |
||||
public int StartValue { |
||||
get { |
||||
return startValue; |
||||
} |
||||
set { |
||||
startValue = value; |
||||
if (StartValueChange != null) { |
||||
StartValueChange (this,new System.EventArgs()); |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("A value to which the ruler marking should be shown. Default is zero.")] |
||||
[Category("Ruler")] |
||||
public int EndValue { |
||||
get { |
||||
return endValue; |
||||
} |
||||
set { |
||||
endValue = value; |
||||
if (EndValueChange != null) { |
||||
EndValueChange (this,new System.EventArgs()); |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("The scale to use")] |
||||
[Category("Ruler")] |
||||
public System.Drawing.GraphicsUnit ScaleUnit { |
||||
get { |
||||
return scaleUnit; |
||||
} |
||||
set { |
||||
scaleUnit = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("Horizontal or vertical layout")] |
||||
[Category("Ruler")] |
||||
public RulerDirection Direction { |
||||
get { |
||||
return direction; |
||||
} |
||||
set { |
||||
direction = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("Frame around the Ruler")] |
||||
[Category("Ruler")] |
||||
public bool DrawFrame { |
||||
get { |
||||
return drawFrame; |
||||
} |
||||
set { |
||||
drawFrame = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("Not used now Color with withch the left and right Margins are painted")] |
||||
[Category("Ruler")] |
||||
public System.Drawing.Color MarginColor { |
||||
get { |
||||
return marginColor; |
||||
} |
||||
set { |
||||
marginColor = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ctrlRuler
|
||||
//
|
||||
this.DockPadding.All = 0; |
||||
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); |
||||
this.Name = "ctrlRuler"; |
||||
this.Size = new System.Drawing.Size(40, 32); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,114 +0,0 @@
@@ -1,114 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Drawing.Design; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
using ICSharpCode.Reports.Core; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of SectionDesigner.
|
||||
/// </summary>
|
||||
public class SectionDesigner:ParentControlDesigner |
||||
{ |
||||
BaseSection section; |
||||
ISelectionService selectionService; |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
if (component == null) { |
||||
throw new ArgumentNullException("component"); |
||||
} |
||||
base.Initialize(component); |
||||
this.section = (BaseSection)component; |
||||
if (String.IsNullOrEmpty(component.Site.Name)) { |
||||
component.Site.Name = section.Name; |
||||
} else { |
||||
section.Name = component.Site.Name; |
||||
} |
||||
GetService (); |
||||
} |
||||
|
||||
|
||||
public override SelectionRules SelectionRules { |
||||
get { |
||||
return SelectionRules.BottomSizeable|SelectionRules.TopSizeable; |
||||
} |
||||
} |
||||
|
||||
protected override void OnPaintAdornments(PaintEventArgs pe) |
||||
{ |
||||
base.OnPaintAdornments(pe); |
||||
} |
||||
|
||||
|
||||
|
||||
protected override void OnDragDrop(DragEventArgs de) |
||||
{ |
||||
base.OnDragDrop(de); |
||||
IToolboxService it = (IToolboxService)this.GetService(typeof(IToolboxService)); |
||||
it.SetSelectedToolboxItem(null); |
||||
} |
||||
|
||||
|
||||
public override bool CanBeParentedTo(System.ComponentModel.Design.IDesigner parentDesigner) |
||||
{ |
||||
return false; |
||||
} |
||||
|
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
private void GetService () |
||||
{ |
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
} |
@ -1,111 +0,0 @@
@@ -1,111 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ShapeDesigner.
|
||||
/// </summary>
|
||||
public class ShapeDesigner:ControlDesigner |
||||
{ |
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
|
||||
public ShapeDesigner() |
||||
{ |
||||
} |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
if (component == null) { |
||||
throw new ArgumentNullException("component"); |
||||
} |
||||
base.Initialize(component); |
||||
|
||||
this.componentChangeService = (IComponentChangeService)component.Site.GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentChanging += OnComponentChanging; |
||||
componentChangeService.ComponentChanged += OnComponentChanged; |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
|
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
private void OnComponentChanging (object sender,ComponentChangingEventArgs e) |
||||
{ |
||||
// System.Console.WriteLine("changing");
|
||||
// System.Console.WriteLine("{0}",this.baseLine.ClientRectangle);
|
||||
} |
||||
|
||||
|
||||
private void OnComponentChanged(object sender,ComponentChangedEventArgs e) |
||||
{ |
||||
// System.Console.WriteLine("changed");
|
||||
// System.Console.WriteLine("{0}",this.baseLine.ClientRectangle);
|
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
|
||||
if (this.componentChangeService != null) { |
||||
componentChangeService.ComponentChanging -= OnComponentChanging; |
||||
componentChangeService.ComponentChanged -= OnComponentChanged; |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
} |
@ -1,60 +0,0 @@
@@ -1,60 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of SmartTagTransactions.
|
||||
/// </summary>
|
||||
public class SmartTagTransactions |
||||
{ |
||||
IDesignerHost host; |
||||
IComponentChangeService changeService; |
||||
DesignerTransaction transaction; |
||||
Control ctrl; |
||||
DesignerActionList actionList; |
||||
|
||||
public SmartTagTransactions(string transactionname,DesignerActionList list,Control ctrl) |
||||
{ |
||||
|
||||
this.actionList = list; |
||||
this.ctrl = ctrl; |
||||
host = (IDesignerHost)this.actionList.GetService(typeof(IDesignerHost)); |
||||
this.transaction = host.CreateTransaction(transactionname); |
||||
changeService = (IComponentChangeService)this.actionList.GetService(typeof(IComponentChangeService)); |
||||
changeService.OnComponentChanging(ctrl,null); |
||||
} |
||||
|
||||
|
||||
|
||||
public void Commit () |
||||
{ |
||||
changeService.OnComponentChanged (ctrl,null,null,null); |
||||
this.transaction.Commit(); |
||||
DesignerActionUIService designerActionUISvc = |
||||
(DesignerActionUIService)this.actionList.GetService(typeof(DesignerActionUIService)); |
||||
designerActionUISvc.Refresh(this.actionList.Component); |
||||
|
||||
} |
||||
} |
||||
} |
@ -1,134 +0,0 @@
@@ -1,134 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing.Design; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of TableDesigner.
|
||||
/// </summary>
|
||||
public class TableDesigner:ParentControlDesigner |
||||
{ |
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
|
||||
public TableDesigner():base() |
||||
{ |
||||
|
||||
} |
||||
|
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
if (component == null) { |
||||
throw new ArgumentNullException("component"); |
||||
} |
||||
base.Initialize(component); |
||||
GetService (); |
||||
} |
||||
|
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
|
||||
public override bool CanParent(Control control) |
||||
{ |
||||
return base.CanParent(control); |
||||
} |
||||
|
||||
protected override Control GetParentForComponent(IComponent component) |
||||
{ |
||||
return base.GetParentForComponent(component); |
||||
} |
||||
|
||||
protected override void OnDragDrop(DragEventArgs de) |
||||
{ |
||||
base.OnDragDrop(de); |
||||
IToolboxService it = (IToolboxService)this.GetService(typeof(IToolboxService)); |
||||
it.SetSelectedToolboxItem(null); |
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void GetService () |
||||
{ |
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
} |
||||
|
||||
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
private void SetValues (string propName,object value) |
||||
{ |
||||
PropertyDescriptor p = TypeDescriptor.GetProperties(Control)[propName]; |
||||
if ( p == null) { |
||||
throw new ArgumentException (propName); |
||||
} else { |
||||
p.SetValue(Control,value); |
||||
} |
||||
} |
||||
|
||||
|
||||
#region Dispose
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,121 +0,0 @@
@@ -1,121 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
|
||||
using ICSharpCode.Reports.Addin.Dialogs; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of TextBasedDesignerActionList.
|
||||
/// </summary>
|
||||
internal class TextBasedDesignerActionList :DesignerActionList |
||||
{ |
||||
private IComponent component; |
||||
private DesignerActionUIService designerActionUISvc; |
||||
|
||||
public TextBasedDesignerActionList(IComponent component):base(component) |
||||
{ |
||||
this.component = component; |
||||
this.designerActionUISvc = |
||||
GetService(typeof(DesignerActionUIService)) |
||||
as DesignerActionUIService; |
||||
|
||||
} |
||||
|
||||
|
||||
public override DesignerActionItemCollection GetSortedActionItems() |
||||
{ |
||||
DesignerActionItemCollection actions = new DesignerActionItemCollection(); |
||||
actions.Add (new DesignerActionPropertyItem ("DrawBorder","DrawBorder","Appearance")); |
||||
actions.Add (new DesignerActionPropertyItem ("Font","Font","Appearance")); |
||||
actions.Add (new DesignerActionPropertyItem ("ContentAlignment","ContentAlignment","Appearance")); |
||||
actions.Add (new DesignerActionPropertyItem ("StringTrimming","StringTrimming","Appearance")); |
||||
actions.Add (new DesignerActionPropertyItem ("FormatString","FormatString","Appearance")); |
||||
return actions; |
||||
} |
||||
|
||||
|
||||
public bool DrawBorder |
||||
{ |
||||
get {return this.Item.DrawBorder;} |
||||
set { |
||||
SmartTagTransactions t = new SmartTagTransactions("border",this,this.Item); |
||||
this.SetProperty ("DrawBorder",value); |
||||
t.Commit(); |
||||
} |
||||
} |
||||
|
||||
public System.Drawing.Font Font |
||||
{ |
||||
get {return this.Item.Font;} |
||||
set {SmartTagTransactions t = new SmartTagTransactions("font",this,this.Item); |
||||
this.SetProperty ("Font",value); |
||||
t.Commit(); |
||||
} |
||||
} |
||||
|
||||
|
||||
public System.Drawing.ContentAlignment ContentAlignment |
||||
{ |
||||
get {return this.Item.ContentAlignment;} |
||||
set {SmartTagTransactions t = new SmartTagTransactions("contentalignment",this,this.Item); |
||||
this.SetProperty ("ContentAlignment",value); |
||||
t.Commit(); |
||||
} |
||||
} |
||||
|
||||
public System.Drawing.StringTrimming StringTrimming |
||||
{ |
||||
get {return this.Item.StringTrimming;} |
||||
set {SmartTagTransactions t = new SmartTagTransactions("trimming",this,this.Item); |
||||
this.SetProperty ("StringTrimming",value); |
||||
t.Commit();} |
||||
} |
||||
|
||||
|
||||
[TypeConverter(typeof(FormatStringConverter))] |
||||
public string FormatString |
||||
{ |
||||
get {return this.Item.FormatString;} |
||||
set {SmartTagTransactions t = new SmartTagTransactions("format",this,this.Item); |
||||
this.SetProperty("FormatString",value); |
||||
t.Commit();} |
||||
} |
||||
|
||||
|
||||
private BaseTextItem Item |
||||
{ |
||||
get {return (BaseTextItem) this.component;} |
||||
} |
||||
|
||||
|
||||
private void SetProperty (string propName, object value) |
||||
{ |
||||
PropertyDescriptor property = TypeDescriptor.GetProperties(this.Item)[propName]; |
||||
if (property == null) { |
||||
throw new ArgumentException (this.Item.Text); |
||||
} else { |
||||
property.SetValue (this.Item,value); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,146 +0,0 @@
@@ -1,146 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Dialogs; |
||||
using ICSharpCode.Reports.Core.Interfaces; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportItemDesigner.
|
||||
/// </summary>
|
||||
public class TextItemDesigner:ControlDesigner |
||||
{ |
||||
|
||||
private ISelectionService selectionService; |
||||
private IComponentChangeService componentChangeService; |
||||
private BaseTextItem ctrl; |
||||
|
||||
public override void Initialize(IComponent component) |
||||
{ |
||||
base.Initialize(component); |
||||
GetService(); |
||||
this.ctrl = (BaseTextItem) component; |
||||
} |
||||
|
||||
protected override void PostFilterProperties(System.Collections.IDictionary properties) |
||||
{ |
||||
DesignerHelper.RemoveProperties(properties); |
||||
base.PostFilterProperties(properties); |
||||
} |
||||
|
||||
|
||||
private void GetService () |
||||
{ |
||||
selectionService = GetService(typeof(ISelectionService)) as ISelectionService; |
||||
if (selectionService != null) |
||||
{ |
||||
selectionService.SelectionChanged += OnSelectionChanged; |
||||
|
||||
} |
||||
|
||||
componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
private void OnSelectionChanged(object sender, EventArgs e) |
||||
{ |
||||
Control.Invalidate( ); |
||||
} |
||||
|
||||
|
||||
private void OnComponentRename(object sender,ComponentRenameEventArgs e) { |
||||
if (e.Component == this.Component) { |
||||
Control.Name = e.NewName; |
||||
Control.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
#region SmartTag
|
||||
|
||||
public override DesignerActionListCollection ActionLists { |
||||
get { |
||||
DesignerActionListCollection actions = new DesignerActionListCollection (); |
||||
actions.Add (new TextBasedDesignerActionList(this.Component)); |
||||
return actions; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region ContextMenu
|
||||
|
||||
public override DesignerVerbCollection Verbs { |
||||
get { |
||||
DesignerVerbCollection verbs = new DesignerVerbCollection(); |
||||
DesignerVerb v1 = new DesignerVerb ("TextEditor",OnRunTextEditor); |
||||
verbs.Add (v1); |
||||
return verbs; |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnRunTextEditor (object sender,EventArgs e) |
||||
{ |
||||
IStringBasedEditorDialog ed = new TextEditorDialog (ctrl.Text,ctrl.Name); |
||||
if (ed.ShowDialog() == DialogResult.OK) { |
||||
ctrl.Text = ed.TextValue; |
||||
this.SetProperty ("Name",ed.TextValue); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void SetProperty (string prop, object value) |
||||
{ |
||||
PropertyDescriptor p = TypeDescriptor.GetProperties(Control)[prop]; |
||||
if (p == null) { |
||||
throw new ArgumentException (this.ctrl.Text); |
||||
} else { |
||||
p.SetValue (Control,value); |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (this.selectionService != null) { |
||||
selectionService.SelectionChanged -= OnSelectionChanged; |
||||
} |
||||
|
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentRename -= OnComponentRename; |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
} |
@ -1,51 +0,0 @@
@@ -1,51 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.CodeDom; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
|
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of IDesignerGenerator.
|
||||
/// </summary>
|
||||
public interface IDesignerGenerator |
||||
{ |
||||
System.CodeDom.Compiler.CodeDomProvider CodeDomProvider { |
||||
get; |
||||
} |
||||
void Attach(ReportDesignerView viewContent); |
||||
void Detach(); |
||||
ReportDesignerView ViewContent { get; } |
||||
/// <summary>
|
||||
/// Gets the collection of OpenedFiles that contain code which belongs
|
||||
/// to the designed form, not including resource files.
|
||||
/// </summary>
|
||||
/// <param name="designerCodeFile">Receives the file which contains the code to be modified by the forms designer.</param>
|
||||
/// <returns>A collection of OpenedFiles that contain code which belongs to the designed form.</returns>
|
||||
/// <remarks>The returned collection must include the <paramref name="designerCodeFile"/>.</remarks>
|
||||
IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile); |
||||
void MergeFormChanges(CodeCompileUnit unit); |
||||
bool InsertComponentEvent(IComponent component, EventDescriptor edesc, string eventMethodName, string body, out string file, out int position); |
||||
} |
||||
} |
@ -1,99 +0,0 @@
@@ -1,99 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design.Serialization; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportLoader.
|
||||
/// </summary>
|
||||
internal class InternalReportLoader |
||||
{ |
||||
private IDesignerLoaderHost host; |
||||
private Stream stream; |
||||
private IDesignerGenerator generator; |
||||
|
||||
public InternalReportLoader(IDesignerLoaderHost host,IDesignerGenerator generator, Stream stream) |
||||
{ |
||||
if (host == null) { |
||||
throw new ArgumentNullException("host"); |
||||
} |
||||
|
||||
if (generator == null) { |
||||
throw new ArgumentNullException("generator"); |
||||
} |
||||
if (stream == null) { |
||||
throw new ArgumentNullException("stream"); |
||||
} |
||||
Console.WriteLine("---------InternalReportLoader------------"); |
||||
this.host = host; |
||||
this.generator = generator; |
||||
this.stream = stream; |
||||
} |
||||
|
||||
public void LoadOrCreateReport() |
||||
{ |
||||
Console.WriteLine("LoadOrCreateReport()"); |
||||
Application.UseWaitCursor = true; |
||||
try { |
||||
IComponent cc = this.host.CreateComponent(typeof(ICSharpCode.Reports.Addin.Designer.RootReportModel),"RootReportModel"); |
||||
ICSharpCode.Reports.Addin.Designer.RootReportModel rootControl = cc as ICSharpCode.Reports.Addin.Designer.RootReportModel; |
||||
UpdateStatusbar(); |
||||
this.CreateNamedSurface(); |
||||
rootControl.Size = this.ReportModel.ReportSettings.PageSize; |
||||
|
||||
} catch (Exception e) { |
||||
MessageService.ShowException(e,"LoadOrCreateReport"); |
||||
} finally { |
||||
Application.UseWaitCursor = false; |
||||
} |
||||
} |
||||
|
||||
|
||||
private void UpdateStatusbar () |
||||
{ |
||||
string message; |
||||
if (this.generator.ViewContent.PrimaryFile.IsDirty) { |
||||
message = String.Format("Create Report <{0}> ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); |
||||
} else { |
||||
message = String.Format("Load Report <{0}> ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); |
||||
} |
||||
SD.StatusBar.SetMessage(message); |
||||
} |
||||
|
||||
|
||||
private void CreateNamedSurface () |
||||
{ |
||||
ReportDefinitionDeserializer rl = new ReportDefinitionDeserializer(this.host,stream); |
||||
this.ReportModel = rl.LoadObjectFromFileDefinition(); |
||||
} |
||||
|
||||
|
||||
public ReportModel ReportModel {get; private set;} |
||||
|
||||
} |
||||
} |
@ -1,156 +0,0 @@
@@ -1,156 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.ComponentModel.Design; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
using System.Xml; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Interfaces; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
internal class ReportDefinitionDeserializer : ReportDefinitionParser |
||||
{ |
||||
private IDesignerHost host; |
||||
private ReportSettings reportSettings; |
||||
private Stream stream; |
||||
|
||||
#region Constructor
|
||||
|
||||
public ReportDefinitionDeserializer(IDesignerHost host,Stream stream) |
||||
{ |
||||
if (host == null) { |
||||
throw new ArgumentNullException("host"); |
||||
} |
||||
if (stream == null) { |
||||
throw new ArgumentNullException("stream"); |
||||
} |
||||
Console.WriteLine("ReportDefinitionDeserializer"); |
||||
this.host = host; |
||||
this.stream = stream; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
public ReportModel LoadObjectFromFileDefinition() |
||||
{ |
||||
Console.WriteLine("LoadObjectFromFileDefinition()"); |
||||
XmlDocument doc = new XmlDocument(); |
||||
doc.Load(this.stream); |
||||
if (doc.FirstChild.NodeType == XmlNodeType.XmlDeclaration) |
||||
{ |
||||
XmlDeclaration xmlDeclaration = (XmlDeclaration)doc.FirstChild; |
||||
xmlDeclaration.Encoding = "utf-8"; |
||||
} |
||||
return LoadObjectFromXmlDocument(doc.DocumentElement); |
||||
} |
||||
|
||||
|
||||
private ReportModel LoadObjectFromXmlDocument(XmlElement elem) |
||||
{ |
||||
Console.WriteLine("LoadObjectFromXmlDocumen)"); |
||||
//ReportSettings
|
||||
OpenedFile file =(OpenedFile) host.GetService(typeof(OpenedFile)); |
||||
BaseItemLoader baseItemLoader = new BaseItemLoader(); |
||||
XmlNodeList n = elem.FirstChild.ChildNodes; |
||||
XmlElement rse = (XmlElement) n[0]; |
||||
ReportModel model = ReportModel.Create(); |
||||
|
||||
// manipulate reportSettings if Filename differs
|
||||
this.reportSettings = baseItemLoader.Load(rse) as ReportSettings; |
||||
if (this.reportSettings.FileName.CompareTo(file.FileName) != 0) { |
||||
System.Diagnostics.Trace.WriteLine("LoadObjectFromXmlDocument - filename changed" ); |
||||
this.reportSettings.FileName = file.FileName; |
||||
} |
||||
|
||||
model.ReportSettings = this.reportSettings; |
||||
|
||||
host.Container.Add(this.reportSettings); |
||||
|
||||
//Move to SectionCollection
|
||||
XmlNodeList sectionList = elem.LastChild.ChildNodes; |
||||
|
||||
foreach (XmlNode sectionNode in sectionList) { |
||||
try { |
||||
object o = this.Load(sectionNode as XmlElement,null); |
||||
BaseSection section = o as BaseSection; |
||||
ConvertAbsolut2RelativePath(section.Controls,this.reportSettings.FileName); |
||||
// ConvertAbsolut2RelativePath(section,this.reportSettings.FileName);
|
||||
host.Container.Add(section); |
||||
} catch (Exception e) { |
||||
MessageService.ShowException(e); |
||||
} |
||||
} |
||||
return model; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
private static void ConvertAbsolut2RelativePath (System.Windows.Forms.Control.ControlCollection controls, string fileName) |
||||
{ |
||||
foreach (Control control in controls) { |
||||
|
||||
if (control.Controls.Count > 0) { |
||||
ConvertAbsolut2RelativePath(control.Controls,fileName); |
||||
} |
||||
|
||||
BaseImageItem baseImageItem = control as BaseImageItem; |
||||
if (baseImageItem != null) { |
||||
baseImageItem.ReportFileName = fileName; |
||||
|
||||
if (Path.IsPathRooted(baseImageItem.ImageFileName)) { |
||||
Console.WriteLine("Absolut2RelativePath"); |
||||
Console.WriteLine("Image Filename {0}",fileName); |
||||
Console.WriteLine("Image Filename {0}",baseImageItem.ImageFileName); |
||||
string d = ICSharpCode.Reports.Core.Globals.FileUtility.GetRelativePath( |
||||
Path.GetDirectoryName(fileName), |
||||
Path.GetDirectoryName(baseImageItem.ImageFileName)); |
||||
|
||||
baseImageItem.RelativeFileName = d + Path.DirectorySeparatorChar + Path.GetFileName(baseImageItem.ImageFileName); |
||||
Console.WriteLine("Rel Filename {0}",baseImageItem.RelativeFileName); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override Type GetTypeByName(string ns, string name) |
||||
{ |
||||
Type t = typeof(BaseSection).Assembly.GetType(typeof(BaseSection).Namespace + "." + name); |
||||
return t; |
||||
} |
||||
|
||||
/* |
||||
#region Properties
|
||||
|
||||
public string ReportName { |
||||
get { return this.reportSettings.ReportName; } |
||||
} |
||||
|
||||
#endregion
|
||||
*/ |
||||
} |
||||
} |
@ -1,68 +0,0 @@
@@ -1,68 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using ICSharpCode.Reports.Addin.Commands; |
||||
using ICSharpCode.Reports.Addin.ReportWizard; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportDesignerDisplayBinding.
|
||||
/// </summary>
|
||||
public class ReportDesignerDisplayBinding:IDisplayBinding |
||||
{ |
||||
|
||||
public bool CanCreateContentForFile(ICSharpCode.Core.FileName fileName) |
||||
{ |
||||
return Path.GetExtension(fileName).Equals(".srd", StringComparison.OrdinalIgnoreCase); |
||||
} |
||||
|
||||
|
||||
public IViewContent CreateContentForFile(OpenedFile file) |
||||
{ |
||||
if (file.IsDirty) { |
||||
var cmd = new ReportWizardCommand(file); |
||||
cmd.Run(); |
||||
if (cmd.Canceled) { |
||||
return null; |
||||
} |
||||
file.SetData(cmd.GeneratedReport.ToArray()); |
||||
} |
||||
var viewCmd = new CreateDesignViewCommand(file); |
||||
viewCmd.Run(); |
||||
return viewCmd.DesignerView; |
||||
} |
||||
|
||||
|
||||
public bool IsPreferredBindingForFile(ICSharpCode.Core.FileName fileName) |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
|
||||
public double AutoDetectFileContent(ICSharpCode.Core.FileName fileName, System.IO.Stream fileContent, string detectedMimeType) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -1,132 +0,0 @@
@@ -1,132 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.CodeDom; |
||||
using System.CodeDom.Compiler; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
using System.Xml; |
||||
|
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of AbstractDesignerLoader.
|
||||
/// </summary>
|
||||
|
||||
public class ReportDesignerGenerator:IDesignerGenerator |
||||
{ |
||||
private ReportDesignerView viewContent; |
||||
|
||||
public ReportDesignerGenerator() |
||||
{ |
||||
Console.WriteLine("Create ReportDesignerGenerator()"); |
||||
} |
||||
|
||||
public CodeDomProvider CodeDomProvider { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
|
||||
public ReportDesignerView ViewContent { |
||||
get { return this.viewContent; } |
||||
} |
||||
|
||||
|
||||
public void Attach(ReportDesignerView viewContent) |
||||
{ |
||||
Console.WriteLine("ReportDesignerGenerator:Attach"); |
||||
if (viewContent == null) { |
||||
throw new ArgumentNullException("viewContent"); |
||||
} |
||||
this.viewContent = viewContent; |
||||
} |
||||
|
||||
|
||||
public void Detach() |
||||
{ |
||||
this.viewContent = null; |
||||
} |
||||
|
||||
|
||||
public IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile) |
||||
{ |
||||
Console.WriteLine("ReportDesignerGenerator:getSourceFile"); |
||||
designerCodeFile = this.viewContent.PrimaryFile; |
||||
return new [] {designerCodeFile}; |
||||
} |
||||
|
||||
|
||||
public void MergeFormChanges(CodeCompileUnit unit){ |
||||
Console.WriteLine("ReportDesignerGenerator:MergeFormChanges"); |
||||
System.Diagnostics.Trace.WriteLine("Generator:MergeFormChanges"); |
||||
StringWriterWithEncoding writer = new StringWriterWithEncoding(System.Text.Encoding.UTF8); |
||||
XmlTextWriter xml = XmlHelper.CreatePropperWriter(writer); |
||||
this.InternalMergeFormChanges(xml); |
||||
viewContent.ReportFileContent = writer.ToString(); |
||||
} |
||||
|
||||
|
||||
|
||||
private void InternalMergeFormChanges(XmlTextWriter xml) |
||||
{ |
||||
if (xml == null) { |
||||
throw new ArgumentNullException("xml"); |
||||
} |
||||
Console.WriteLine("ReportDesignerGenerator:internalMergeFormChanges"); |
||||
ReportDesignerWriter rpd = new ReportDesignerWriter(); |
||||
XmlHelper.CreatePropperDocument(xml); |
||||
|
||||
foreach (IComponent component in viewContent.Host.Container.Components) { |
||||
if (!(component is Control)) { |
||||
rpd.Save(component,xml); |
||||
} |
||||
} |
||||
xml.WriteEndElement(); |
||||
xml.WriteStartElement("SectionCollection"); |
||||
|
||||
// we look only for Sections
|
||||
foreach (IComponent component in viewContent.Host.Container.Components) { |
||||
BaseSection b = component as BaseSection; |
||||
if (b != null) { |
||||
Console.WriteLine(b.BackColor.ToString()); |
||||
rpd.Save(component,xml); |
||||
} |
||||
} |
||||
//SectionCollection
|
||||
xml.WriteEndElement(); |
||||
//Reportmodel
|
||||
xml.WriteEndElement(); |
||||
xml.WriteEndDocument(); |
||||
xml.Close(); |
||||
} |
||||
|
||||
|
||||
public bool InsertComponentEvent(IComponent component, EventDescriptor edesc, string eventMethodName, string body, out string file, out int position) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -1,174 +0,0 @@
@@ -1,174 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel.Design.Serialization; |
||||
using System.IO; |
||||
using System.Xml; |
||||
|
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
|
||||
public class ReportDesignerLoader: BasicDesignerLoader |
||||
{ |
||||
private IDesignerLoaderHost host; |
||||
private IDesignerGenerator generator; |
||||
private ReportModel reportModel; |
||||
private Stream stream; |
||||
|
||||
#region Constructors
|
||||
|
||||
public ReportDesignerLoader(IDesignerGenerator generator, Stream stream) |
||||
{ |
||||
Console.WriteLine("ReportDesignerLoader:Ctor"); |
||||
if (stream == null) |
||||
throw new ArgumentNullException("stream"); |
||||
if (generator == null) { |
||||
throw new ArgumentNullException("generator"); |
||||
} |
||||
this.generator = generator; |
||||
this.stream = stream; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Overriden methods of BasicDesignerLoader
|
||||
|
||||
public override void BeginLoad(IDesignerLoaderHost host) |
||||
{ |
||||
if (host == null) { |
||||
throw new ArgumentNullException("host"); |
||||
} |
||||
this.host = host; |
||||
host.AddService(typeof(ComponentSerializationService), new CodeDomComponentSerializationService((IServiceProvider)host)); |
||||
host.AddService(typeof(IDesignerSerializationService), new DesignerSerializationService((IServiceProvider)host)); |
||||
base.BeginLoad(host); |
||||
} |
||||
|
||||
|
||||
protected override void PerformLoad(IDesignerSerializationManager serializationManager) |
||||
{ |
||||
InternalReportLoader internalLoader = new InternalReportLoader(this.host,generator, stream); |
||||
internalLoader.LoadOrCreateReport(); |
||||
this.reportModel = internalLoader.ReportModel; |
||||
} |
||||
|
||||
|
||||
protected override void OnEndLoad(bool successful, ICollection errors) |
||||
{ |
||||
base.OnEndLoad(successful, errors); |
||||
} |
||||
|
||||
|
||||
protected override void PerformFlush(IDesignerSerializationManager designerSerializationManager) |
||||
{ |
||||
System.Diagnostics.Trace.WriteLine("ReportDesignerLoader:PerformFlush"); |
||||
generator.MergeFormChanges((System.CodeDom.CodeCompileUnit)null); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Reportmodel
|
||||
|
||||
public ReportModel ReportModel { |
||||
get { return reportModel; } |
||||
} |
||||
|
||||
public ReportModel CreateRenderableModel() |
||||
{ |
||||
Console.WriteLine("ReportDesignerLoader:CreateRenderableModel"); |
||||
ReportModel m = new ReportModel(); |
||||
generator.MergeFormChanges((System.CodeDom.CodeCompileUnit)null); |
||||
XmlDocument doc = new XmlDocument(); |
||||
doc.LoadXml(generator.ViewContent.ReportFileContent); |
||||
ReportLoader rl = new ReportLoader(); |
||||
object root = rl.Load(doc.DocumentElement); |
||||
m = root as ReportModel; |
||||
|
||||
m.ReportSettings.FileName = generator.ViewContent.PrimaryFileName; |
||||
FilePathConverter.AdjustReportName(m); |
||||
return m; |
||||
} |
||||
|
||||
public XmlDocument CreateXmlModel() |
||||
{ |
||||
Console.WriteLine("ReportDesignerLoader:CreateXmlModel"); |
||||
ReportModel m = new ReportModel(); |
||||
generator.MergeFormChanges((System.CodeDom.CodeCompileUnit)null); |
||||
XmlDocument xmlDocument = new XmlDocument(); |
||||
xmlDocument.LoadXml(generator.ViewContent.ReportFileContent); |
||||
return xmlDocument; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Dispose
|
||||
|
||||
public override void Dispose() |
||||
{ |
||||
// Always remove attached event handlers in Dispose.
|
||||
base.Dispose(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Load Report from File
|
||||
/// </summary>
|
||||
/// <param name="baseType"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public class ReportLoader : BaseItemLoader |
||||
{ |
||||
static Dictionary<Type, Type> baseToReport; |
||||
|
||||
public static Type GetReportType(Type baseType) |
||||
{ |
||||
Console.WriteLine("ReportLoader:GetReportType"); |
||||
if (baseType == null) return null; |
||||
|
||||
baseToReport = new Dictionary<Type, Type>(); |
||||
foreach (Type t in typeof(BaseSection).Assembly.GetTypes()) { |
||||
|
||||
if (t.BaseType != null && t.BaseType.Name.StartsWith("Base", |
||||
StringComparison.InvariantCulture)) { |
||||
baseToReport[t.BaseType] = t; |
||||
} |
||||
} |
||||
|
||||
Type r; |
||||
baseToReport.TryGetValue(baseType, out r); |
||||
return r ?? baseType; |
||||
} |
||||
|
||||
|
||||
protected override Type GetTypeByName(string ns, string name) |
||||
{ |
||||
return GetReportType(base.GetTypeByName(ns, name)); |
||||
} |
||||
} |
||||
} |
@ -1,53 +0,0 @@
@@ -1,53 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Dialogs |
||||
{ |
||||
/// <summary>
|
||||
/// Description of DataTypeStringConverter.
|
||||
/// </summary>
|
||||
public class DataTypeStringConverter:StringConverter |
||||
{ |
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext |
||||
context) |
||||
{ |
||||
//true means show a combobox
|
||||
return true; |
||||
} |
||||
|
||||
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext |
||||
context) |
||||
{ |
||||
//true will limit to list. false will show the list, but allow free-form entry
|
||||
return true; |
||||
} |
||||
|
||||
|
||||
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) |
||||
{ |
||||
return new StandardValuesCollection(GlobalLists.DataTypeList()); |
||||
|
||||
} |
||||
} |
||||
} |
@ -1,97 +0,0 @@
@@ -1,97 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
partial class ExpressionEditor |
||||
{ |
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); |
||||
this.label1 = new System.Windows.Forms.Label(); |
||||
this.splitContainer1.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Location = new System.Drawing.Point(12, 39); |
||||
this.splitContainer1.Name = "splitContainer1"; |
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Desktop; |
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.AppWorkspace; |
||||
this.splitContainer1.Panel2.Margin = new System.Windows.Forms.Padding(3); |
||||
this.splitContainer1.Size = new System.Drawing.Size(424, 181); |
||||
this.splitContainer1.SplitterDistance = 138; |
||||
this.splitContainer1.TabIndex = 0; |
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.label1.Location = new System.Drawing.Point(12, 7); |
||||
this.label1.Margin = new System.Windows.Forms.Padding(3); |
||||
this.label1.Name = "label1"; |
||||
this.label1.Size = new System.Drawing.Size(424, 26); |
||||
this.label1.TabIndex = 1; |
||||
this.label1.Text = "label1"; |
||||
//
|
||||
// ExpressionEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.ClientSize = new System.Drawing.Size(451, 279); |
||||
this.Controls.Add(this.label1); |
||||
this.Controls.Add(this.splitContainer1); |
||||
this.Name = "ExpressionEditor"; |
||||
this.Text = "ExpressionEditor"; |
||||
this.splitContainer1.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
private System.Windows.Forms.Label label1; |
||||
private System.Windows.Forms.SplitContainer splitContainer1; |
||||
} |
||||
} |
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ExpressionEditor.
|
||||
/// </summary>
|
||||
public partial class ExpressionEditor : Form |
||||
{ |
||||
public ExpressionEditor() |
||||
{ |
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
|
||||
//
|
||||
// TODO: Add constructor code after the InitializeComponent() call.
|
||||
//
|
||||
} |
||||
} |
||||
} |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
</root> |
@ -1,55 +0,0 @@
@@ -1,55 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Dialogs |
||||
{ |
||||
/// <summary>
|
||||
/// Description of StringConverter.
|
||||
/// </summary>
|
||||
public class FormatStringConverter:StringConverter |
||||
{ |
||||
|
||||
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext |
||||
context) |
||||
{ |
||||
//true means show a combobox
|
||||
return true; |
||||
} |
||||
|
||||
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext |
||||
context) |
||||
{ |
||||
//true will limit to list. false will show the list, but allow free-form entry
|
||||
return true; |
||||
} |
||||
|
||||
|
||||
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) |
||||
{ |
||||
return new StandardValuesCollection(GlobalLists.Formats()); |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,43 +0,0 @@
@@ -1,43 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Runtime.Serialization; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
[Serializable()] |
||||
public class FormsDesignerLoadException : Exception |
||||
{ |
||||
public FormsDesignerLoadException() : base() |
||||
{ |
||||
} |
||||
|
||||
public FormsDesignerLoadException(string message) : base(message) |
||||
{ |
||||
} |
||||
|
||||
public FormsDesignerLoadException(string message, Exception innerException) : base(message, innerException) |
||||
{ |
||||
} |
||||
|
||||
protected FormsDesignerLoadException(SerializationInfo info, StreamingContext context) : base(info, context) |
||||
{ |
||||
} |
||||
} |
||||
} |
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reports.Core; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GlobalsDesigner.
|
||||
/// </summary>
|
||||
public sealed class GlobalsDesigner |
||||
{ |
||||
private GlobalsDesigner() |
||||
{ |
||||
} |
||||
|
||||
public static Font DesignerFont |
||||
{ |
||||
get { |
||||
return new Font("Microsoft Sans Serif", |
||||
8, |
||||
FontStyle.Regular, |
||||
GraphicsUnit.Point); |
||||
} |
||||
} |
||||
|
||||
public static int GabBetweenSection{ |
||||
get {return 15;} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,43 +0,0 @@
@@ -1,43 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Text; |
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of StringWriterWithEncoding.
|
||||
/// </summary>
|
||||
internal class StringWriterWithEncoding:System.IO.StringWriter |
||||
{ |
||||
private Encoding encoding; |
||||
|
||||
public StringWriterWithEncoding(Encoding encoding) |
||||
{ |
||||
if (encoding == null) { |
||||
throw new ArgumentNullException("encoding"); |
||||
} |
||||
this.encoding = encoding; |
||||
} |
||||
|
||||
public override Encoding Encoding { |
||||
get { return encoding; } |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,769 +0,0 @@
@@ -1,769 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.ComponentModel.Design; |
||||
using System.ComponentModel.Design.Serialization; |
||||
using System.Data; |
||||
using System.Drawing.Design; |
||||
using System.Drawing.Printing; |
||||
using System.IO; |
||||
using System.Text; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Exporter; |
||||
using ICSharpCode.Reports.Core.Exporter.ExportRenderer; |
||||
|
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.WinForms; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
using ICSharpCode.Reports.Addin.Commands; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
using ICSharpCode.Reports.Addin.SecondaryViews; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of the view content
|
||||
/// </summary>
|
||||
public class ReportDesignerView : AbstractViewContent, IHasPropertyContainer, |
||||
IClipboardHandler,IUndoHandler, IToolsHost,IPrintable |
||||
{ |
||||
readonly IDesignerGenerator generator; |
||||
bool IsFormsDesignerVisible; |
||||
bool tabOrderMode; |
||||
bool hasUnmergedChanges; |
||||
bool unloading; |
||||
string reportFileContent; |
||||
Panel panel; |
||||
ReportDesignerLoader loader; |
||||
DesignSurface designSurface; |
||||
DefaultServiceContainer defaultServiceContainer; |
||||
ReportDesignerUndoEngine undoEngine; |
||||
|
||||
XmlView xmlView; |
||||
ReportPreview reportPreview; |
||||
ReportViewerSecondaryView reportViewer; |
||||
// TestWPFReportPreview testView;
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new ReportDesignerView object
|
||||
/// </summary>
|
||||
|
||||
public ReportDesignerView(OpenedFile openedFile, IDesignerGenerator generator):base (openedFile) |
||||
{ |
||||
if (openedFile == null) { |
||||
throw new ArgumentNullException("openedFile"); |
||||
} |
||||
if (generator == null) { |
||||
throw new ArgumentNullException("generator"); |
||||
} |
||||
Console.WriteLine("ReportDesignerView"); |
||||
|
||||
this.generator = generator; |
||||
this.generator.Attach(this); |
||||
|
||||
base.TabPageText = ResourceService.GetString("SharpReport.Design"); |
||||
ReportingSideTabProvider.AddViewContent(this); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This constructor allows running in unit test mode with a mock file. Get it from Matt Ward
|
||||
/// </summary>
|
||||
public ReportDesignerView(IViewContent primaryViewContent, OpenedFile mockFile) |
||||
// : this(primaryViewContent)
|
||||
{ |
||||
// this.sourceCodeStorage.AddFile(mockFile, Encoding.UTF8);
|
||||
// this.sourceCodeStorage.DesignerCodeFile = mockFile;
|
||||
} |
||||
|
||||
|
||||
private void SetupSecondaryView () |
||||
{ |
||||
LoggingService.Info("Form Designer: SetupSecondaryView "); |
||||
xmlView = new XmlView(generator,this); |
||||
SecondaryViewContents.Add(xmlView); |
||||
|
||||
reportPreview = new ReportPreview(loader,this); |
||||
SecondaryViewContents.Add(reportPreview); |
||||
|
||||
reportViewer = new ReportViewerSecondaryView(loader,this); |
||||
SecondaryViewContents.Add(reportViewer); |
||||
|
||||
var wpfViewer = new WPFReportPreview(loader,this); |
||||
SecondaryViewContents.Add(wpfViewer); |
||||
|
||||
// testView = new TestWPFReportPreview(loader,this);
|
||||
// SecondaryViewContents.Add(testView);
|
||||
|
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region setup designer
|
||||
|
||||
private void LoadDesigner(Stream stream) |
||||
{ |
||||
LoggingService.Info("Form Designer: LoadDesigner"); |
||||
CreatePanel(); |
||||
defaultServiceContainer = new DefaultServiceContainer(); |
||||
|
||||
defaultServiceContainer.AddService(typeof(System.Windows.Forms.Design.IUIService), |
||||
new UIService()); |
||||
|
||||
defaultServiceContainer.AddService(typeof(IToolboxService),new ToolboxService()); |
||||
defaultServiceContainer.AddService(typeof(IHelpService), new HelpService()); |
||||
|
||||
this.designSurface = CreateDesignSurface(defaultServiceContainer); |
||||
designSurface.Loading += this.DesignerLoading; |
||||
designSurface.Loaded += this.DesignerLoaded; |
||||
designSurface.Flushed += this.DesignerFlushed; |
||||
designSurface.Unloading += this.DesingerUnloading; |
||||
|
||||
AmbientProperties ambientProperties = new AmbientProperties(); |
||||
defaultServiceContainer.AddService(typeof(AmbientProperties), ambientProperties); |
||||
|
||||
defaultServiceContainer.AddService(typeof(ITypeResolutionService), new TypeResolutionService()); |
||||
|
||||
defaultServiceContainer.AddService(typeof(ITypeDiscoveryService), |
||||
new TypeDiscoveryService()); |
||||
|
||||
defaultServiceContainer.AddService(typeof(System.ComponentModel.Design.IMenuCommandService), |
||||
new MenuCommandService(panel,this.designSurface )); |
||||
|
||||
defaultServiceContainer.AddService(typeof(MemberRelationshipService), |
||||
new DefaultMemberRelationshipService()); |
||||
|
||||
//need this to resolve the filename and manipulate
|
||||
//ReportSettings in ReportDefinitionDeserializer.LoadObjectFromXmlDocument
|
||||
//if the filename in ReportSettings is different from load location
|
||||
|
||||
defaultServiceContainer.AddService(typeof(OpenedFile),base.PrimaryFile); |
||||
|
||||
DesignerOptionService dos = new System.Windows.Forms.Design.WindowsFormsDesignerOptionService(); |
||||
dos.Options.Properties.Find( "UseSmartTags", true ).SetValue( dos, true ); |
||||
dos.Options.Properties.Find( "ShowGrid", true ).SetValue( dos, false ); |
||||
dos.Options.Properties.Find( "UseSnapLines", true ).SetValue( dos, true ); |
||||
defaultServiceContainer.AddService( typeof( DesignerOptionService ), dos ); |
||||
this.loader = new ReportDesignerLoader(generator,stream); |
||||
this.designSurface.BeginLoad(this.loader); |
||||
if (!designSurface.IsLoaded) { |
||||
throw new FormsDesignerLoadException(FormatLoadErrors(designSurface)); |
||||
} |
||||
defaultServiceContainer.AddService(typeof(System.ComponentModel.Design.Serialization.INameCreationService), |
||||
new NameCreationService()); |
||||
|
||||
ISelectionService selectionService = (ISelectionService)this.designSurface.GetService(typeof(ISelectionService)); |
||||
selectionService.SelectionChanged += SelectionChangedHandler; |
||||
|
||||
undoEngine = new ReportDesignerUndoEngine(Host); |
||||
|
||||
IComponentChangeService componentChangeService = (IComponentChangeService)this.designSurface.GetService(typeof(IComponentChangeService)); |
||||
|
||||
componentChangeService.ComponentChanged += OnComponentChanged; |
||||
componentChangeService.ComponentAdded += OnComponentListChanged; |
||||
componentChangeService.ComponentRemoved += OnComponentListChanged; |
||||
componentChangeService.ComponentRename += OnComponentListChanged; |
||||
|
||||
this.Host.TransactionClosed += TransactionClose; |
||||
|
||||
UpdatePropertyPad(); |
||||
hasUnmergedChanges = false; |
||||
|
||||
LoggingService.Info("Form Designer: END INITIALIZE"); |
||||
} |
||||
|
||||
|
||||
void DesignerLoading(object sender, EventArgs e) |
||||
{ |
||||
LoggingService.Debug("Forms designer: DesignerLoader loading..."); |
||||
this.unloading = false; |
||||
} |
||||
|
||||
|
||||
void DesignerLoaded(object sender, LoadedEventArgs e) |
||||
{ |
||||
// This method is called when the designer has loaded.
|
||||
LoggingService.Debug("Report designer: DesignerLoader loaded, HasSucceeded=" + e.HasSucceeded.ToString()); |
||||
this.unloading = false; |
||||
|
||||
if (e.HasSucceeded) { |
||||
|
||||
SetupDesignSurface(); |
||||
this.IsFormsDesignerVisible = true; |
||||
generator.MergeFormChanges(null); |
||||
StartReportExplorer (); |
||||
|
||||
LoggingService.Debug("FormsDesigner loaded, setting ActiveDesignSurface to " + this.designSurface.ToString()); |
||||
designSurfaceManager.ActiveDesignSurface = this.designSurface; |
||||
this.UpdatePropertyPad(); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
private void CreatePanel () |
||||
{ |
||||
this.panel = new Panel(); |
||||
this.panel.Dock = DockStyle.Fill; |
||||
this.panel.BackColor = System.Drawing.Color.LightBlue; |
||||
} |
||||
|
||||
|
||||
private void SetupDesignSurface() |
||||
{ |
||||
Control c = null; |
||||
c = this.designSurface.View as Control; |
||||
c.Parent = this.panel; |
||||
c.Dock = DockStyle.Fill; |
||||
} |
||||
|
||||
private void DesingerUnloading(object sender, EventArgs e) |
||||
{ |
||||
LoggingService.Debug("Forms designer: DesignerLoader unloading..."); |
||||
this.unloading = true; |
||||
} |
||||
|
||||
|
||||
private void DesignerFlushed(object sender, EventArgs e) |
||||
{ |
||||
System.Diagnostics.Trace.WriteLine("View:DesignerFlushed"); |
||||
this.hasUnmergedChanges = false; |
||||
} |
||||
|
||||
|
||||
private static string FormatLoadErrors(DesignSurface designSurface) |
||||
{ |
||||
var sb = new StringBuilder(); |
||||
foreach(Exception le in designSurface.LoadErrors) { |
||||
sb.AppendLine(le.ToString()); |
||||
sb.AppendLine(); |
||||
} |
||||
return sb.ToString(); |
||||
} |
||||
#endregion
|
||||
|
||||
private void MergeFormChanges() |
||||
{ |
||||
LoggingService.Info("MergeFormChanges()"); |
||||
designSurface.Flush(); |
||||
generator.MergeFormChanges(null); |
||||
LoggingService.Info("Finished merging form changes"); |
||||
hasUnmergedChanges = false; |
||||
} |
||||
|
||||
|
||||
public string ReportFileContent { |
||||
get { |
||||
if (this.IsDirty) { |
||||
this.MergeFormChanges(); |
||||
} |
||||
return this.reportFileContent; } |
||||
set { this.reportFileContent = value; } |
||||
} |
||||
|
||||
#region ReportExplorer
|
||||
|
||||
private void StartReportExplorer () |
||||
{ |
||||
LoggingService.Info("StartReportExplorer ()"); |
||||
ReportExplorerPad explorerPad = CheckReportExplorer(); |
||||
SD.Workbench.GetPad(typeof(ReportExplorerPad)).BringPadToFront(); |
||||
explorerPad.AddContent(this.loader.ReportModel); |
||||
explorerPad.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ReportExplorer_PropertyChanged); |
||||
} |
||||
|
||||
|
||||
private void ReportExplorer_PropertyChanged (object sender,System.ComponentModel.PropertyChangedEventArgs e) |
||||
{ |
||||
LoggingService.Info("ReportExplorer_PropertyChanged"); |
||||
this.MakeDirty(); |
||||
ReportExplorerPad explorerPad = CheckReportExplorer(); |
||||
IComponentChangeService change = Host.GetService(typeof(IComponentChangeService)) as IComponentChangeService; |
||||
change.OnComponentChanged(explorerPad, null, null, null); |
||||
} |
||||
|
||||
|
||||
private static ReportExplorerPad CheckReportExplorer () |
||||
{ |
||||
ReportExplorerPad p = ReportExplorerPad.Instance; |
||||
if (p == null) { |
||||
SD.Workbench.GetPad(typeof(ReportExplorerPad)).CreatePad(); |
||||
} |
||||
return ReportExplorerPad.Instance; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region SelectionService
|
||||
|
||||
private void SelectionChangedHandler(object sender, EventArgs args) |
||||
{ |
||||
var selectionService = (ISelectionService)sender; |
||||
var item = selectionService.PrimarySelection as AbstractItem; |
||||
if (item != null) { |
||||
if (String.IsNullOrEmpty(item.Site.Name)) { |
||||
item.Site.Name = item.Name; |
||||
} |
||||
} |
||||
UpdatePropertyPadSelection((ISelectionService)sender); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Transaction
|
||||
|
||||
bool shouldUpdateSelectableObjects; |
||||
|
||||
void TransactionClose(object sender, DesignerTransactionCloseEventArgs e) |
||||
{ |
||||
if (shouldUpdateSelectableObjects) { |
||||
SD.MainThread.InvokeAsync(UpdatePropertyPad).FireAndForget(); |
||||
shouldUpdateSelectableObjects = false; |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region ComponentChangeService
|
||||
|
||||
private void OnComponentChanged (object sender, ComponentChangedEventArgs e) |
||||
{ |
||||
var item = e.Component as BaseImageItem; |
||||
|
||||
if (item != null) { |
||||
item.ReportFileName = this.loader.ReportModel.ReportSettings.FileName; |
||||
} |
||||
|
||||
bool loading = this.loader != null && this.loader.Loading; |
||||
LoggingService.Debug("ReportDesignerView: ComponentChanged: " + (e.Component == null ? "<null>" : e.Component.ToString()) + ", Member=" + (e.Member == null ? "<null>" : e.Member.Name) + ", OldValue=" + (e.OldValue == null ? "<null>" : e.OldValue.ToString()) + ", NewValue=" + (e.NewValue == null ? "<null>" : e.NewValue.ToString()) + "; Loading=" + loading + "; Unloading=" + this.unloading); |
||||
if (!loading && !unloading) { |
||||
this.MakeDirty(); |
||||
} |
||||
MergeFormChanges(); |
||||
} |
||||
|
||||
|
||||
void OnComponentListChanged(object sender, EventArgs e) |
||||
{ |
||||
bool loading = this.loader != null && this.loader.Loading; |
||||
LoggingService.Debug("ReportDesigner: Component added/removed/renamed, Loading=" + loading + ", Unloading=" + this.unloading); |
||||
if (!loading && !unloading) { |
||||
shouldUpdateSelectableObjects = true; |
||||
this.MakeDirty(); |
||||
} |
||||
} |
||||
|
||||
private void MakeDirty() |
||||
{ |
||||
hasUnmergedChanges = true; |
||||
this.PrimaryFile.MakeDirty(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region HasPropertyContainer implementation
|
||||
|
||||
private void UpdatePropertyPad() |
||||
{ |
||||
Console.WriteLine("UpdatePropertyPad()"); |
||||
if (IsFormsDesignerVisible && Host != null) { |
||||
PropertyContainer.Host = Host; |
||||
PropertyContainer.SelectableObjects = Host.Container.Components; |
||||
ISelectionService selectionService = (ISelectionService)this.designSurface.GetService(typeof(ISelectionService)); |
||||
if (selectionService != null) { |
||||
UpdatePropertyPadSelection(selectionService); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
private void UpdatePropertyPadSelection(ISelectionService selectionService) |
||||
{ |
||||
ICollection selection = selectionService.GetSelectedComponents(); |
||||
object[] selArray = new object[selection.Count]; |
||||
selection.CopyTo(selArray, 0); |
||||
PropertyContainer.SelectedObjects = selArray; |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IHasPropertyContainer impementation
|
||||
|
||||
PropertyContainer propertyContainer; |
||||
|
||||
public PropertyContainer PropertyContainer { |
||||
get { |
||||
if (propertyContainer == null) { |
||||
propertyContainer = new PropertyContainer(); |
||||
} |
||||
return propertyContainer; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IUnDohandler
|
||||
|
||||
public bool EnableUndo { |
||||
get { |
||||
if (undoEngine != null) { |
||||
return undoEngine.EnableUndo; |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
public bool EnableRedo { |
||||
get { |
||||
if (undoEngine != null) { |
||||
return undoEngine.EnableRedo; |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
|
||||
public virtual void Undo() |
||||
{ |
||||
if (undoEngine != null) { |
||||
undoEngine.Undo(); |
||||
} |
||||
} |
||||
|
||||
|
||||
public virtual void Redo() |
||||
{ |
||||
if (undoEngine != null) { |
||||
undoEngine.Redo(); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IClipboardHandler implementation
|
||||
|
||||
private bool IsMenuCommandEnabled(CommandID commandID) |
||||
{ |
||||
if (designSurface == null) { |
||||
return false; |
||||
} |
||||
|
||||
IMenuCommandService menuCommandService = (IMenuCommandService)designSurface.GetService(typeof(IMenuCommandService)); |
||||
if (menuCommandService == null) { |
||||
return false; |
||||
} |
||||
|
||||
System.ComponentModel.Design.MenuCommand menuCommand = menuCommandService.FindCommand(commandID); |
||||
if (menuCommand == null) { |
||||
return false; |
||||
} |
||||
return menuCommand.Enabled; |
||||
} |
||||
|
||||
|
||||
public bool EnableCut { |
||||
get { |
||||
return IsMenuCommandEnabled(StandardCommands.Cut); |
||||
} |
||||
} |
||||
|
||||
|
||||
public bool EnableCopy { |
||||
get { |
||||
return IsMenuCommandEnabled(StandardCommands.Copy); |
||||
} |
||||
} |
||||
|
||||
|
||||
const string ComponentClipboardFormat = "CF_DESIGNERCOMPONENTS"; |
||||
public bool EnablePaste { |
||||
get { |
||||
return IsMenuCommandEnabled(StandardCommands.Paste); |
||||
} |
||||
} |
||||
|
||||
|
||||
public bool EnableDelete { |
||||
get { |
||||
return IsMenuCommandEnabled(StandardCommands.Delete); |
||||
} |
||||
} |
||||
|
||||
public bool EnableSelectAll { |
||||
get { |
||||
return designSurface != null; |
||||
} |
||||
} |
||||
|
||||
|
||||
public void Cut() |
||||
{ |
||||
IMenuCommandService menuCommandService = (IMenuCommandService)designSurface.GetService(typeof(IMenuCommandService)); |
||||
menuCommandService.GlobalInvoke(StandardCommands.Cut); |
||||
} |
||||
|
||||
|
||||
public void Copy() |
||||
{ |
||||
IMenuCommandService menuCommandService = (IMenuCommandService)designSurface.GetService(typeof(IMenuCommandService)); |
||||
menuCommandService.GlobalInvoke(StandardCommands.Copy); |
||||
} |
||||
|
||||
public void Paste() |
||||
{ |
||||
IMenuCommandService menuCommandService = (IMenuCommandService)designSurface.GetService(typeof(IMenuCommandService)); |
||||
menuCommandService.GlobalInvoke(StandardCommands.Paste); |
||||
} |
||||
|
||||
public void Delete() |
||||
{ |
||||
IMenuCommandService menuCommandService = (IMenuCommandService)designSurface.GetService(typeof(IMenuCommandService)); |
||||
menuCommandService.GlobalInvoke(StandardCommands.Delete); |
||||
} |
||||
|
||||
public void SelectAll() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IToolsHost
|
||||
|
||||
object IToolsHost.ToolsContent { |
||||
get { |
||||
return ReportingSideTabProvider.ReportingSideBar; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IPrintable
|
||||
|
||||
|
||||
public PrintDocument PrintDocument |
||||
{ |
||||
get { |
||||
Console.WriteLine(""); |
||||
Console.WriteLine("----ReportdesignerView:PrintDocument------"); |
||||
Console.WriteLine(""); |
||||
ReportModel model = loader.CreateRenderableModel(); |
||||
IReportCreator reportCreator = null; |
||||
var paramCmd = new CollectParametersCommand(model.ReportSettings); |
||||
paramCmd.Run(); |
||||
switch (model.DataModel) { |
||||
case GlobalEnums.PushPullModel.FormSheet : |
||||
{ |
||||
reportCreator = FormPageBuilder.CreateInstance(model); |
||||
break; |
||||
} |
||||
case GlobalEnums.PushPullModel.PullData: |
||||
{ |
||||
IDataManager dataManager = DataManagerFactory.CreateDataManager(model,(ReportParameters)null); |
||||
reportCreator = DataPageBuilder.CreateInstance(model,dataManager); |
||||
break; |
||||
} |
||||
case GlobalEnums.PushPullModel.PushData:{ |
||||
var cmd = new ICSharpCode.Reports.Addin.Commands.DataSetFromXsdCommand(); |
||||
cmd.Run(); |
||||
DataSet ds = cmd.DataSet; |
||||
IDataManager dataManager = DataManagerFactory.CreateDataManager(model,ds.Tables[0]); |
||||
reportCreator = DataPageBuilder.CreateInstance(model,dataManager); |
||||
break; |
||||
} |
||||
default: |
||||
throw new InvalidReportModelException(); |
||||
} |
||||
|
||||
reportCreator.BuildExportList(); |
||||
PrintRenderer printer = PrintRenderer.CreateInstance(reportCreator.Pages); |
||||
printer.Start(); |
||||
printer.RenderOutput(); |
||||
printer.End(); |
||||
return printer.PrintDocument; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IDesignerHost implementation
|
||||
|
||||
public IDesignerHost Host { |
||||
get { |
||||
return this.designSurface.GetService(typeof(IDesignerHost)) as IDesignerHost; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Commands
|
||||
|
||||
public void ShowSourceCode() |
||||
{ |
||||
WorkbenchWindow.SwitchView(1); |
||||
} |
||||
|
||||
public void TogglePageMargin () |
||||
{ |
||||
IDesignerHost designerHost = (IDesignerHost)this.designSurface.GetService(typeof(IDesignerHost)); |
||||
RootReportModel rootReportModel = (RootReportModel)designerHost.RootComponent; |
||||
rootReportModel.Toggle(); |
||||
|
||||
} |
||||
#endregion
|
||||
|
||||
#region Tab Order Handling
|
||||
|
||||
public virtual bool IsTabOrderMode { |
||||
get { |
||||
return tabOrderMode; |
||||
} |
||||
} |
||||
|
||||
public virtual void ShowTabOrder() |
||||
{ |
||||
if (!IsTabOrderMode) { |
||||
var menuCommandService = (IMenuCommandService)designSurface.GetService(typeof(IMenuCommandService)); |
||||
menuCommandService.GlobalInvoke(StandardCommands.TabOrder); |
||||
tabOrderMode = true; |
||||
} |
||||
} |
||||
|
||||
public virtual void HideTabOrder() |
||||
{ |
||||
if (IsTabOrderMode) { |
||||
var menuCommandService = (IMenuCommandService)designSurface.GetService(typeof(IMenuCommandService)); |
||||
menuCommandService.GlobalInvoke(StandardCommands.TabOrder); |
||||
tabOrderMode = false; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region Design surface manager (static)
|
||||
|
||||
static readonly DesignSurfaceManager designSurfaceManager = new DesignSurfaceManager(); |
||||
|
||||
public static DesignSurface CreateDesignSurface(IServiceProvider serviceProvider) |
||||
{ |
||||
return designSurfaceManager.CreateDesignSurface(serviceProvider); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
|
||||
public override object Control { |
||||
get { |
||||
return panel; |
||||
} |
||||
} |
||||
|
||||
|
||||
public override void Load(OpenedFile file, Stream stream) |
||||
{ |
||||
LoggingService.Debug("ReportDesigner: Load from: " + file.FileName); |
||||
base.Load(file, stream); |
||||
this.LoadDesigner(stream); |
||||
this.SetupSecondaryView(); |
||||
} |
||||
|
||||
|
||||
public override void Save(OpenedFile file,Stream stream) |
||||
{ |
||||
LoggingService.Debug("ReportDesigner: Save to: " + file.FileName); |
||||
|
||||
if (hasUnmergedChanges) { |
||||
this.MergeFormChanges(); |
||||
} |
||||
using(StreamWriter writer = new StreamWriter(stream)) { |
||||
writer.Write(this.ReportFileContent); |
||||
} |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Cleans up all used resources
|
||||
/// </summary>
|
||||
public sealed override void Dispose() |
||||
{ |
||||
try { |
||||
|
||||
IComponentChangeService componentChangeService = (IComponentChangeService)this.designSurface.GetService(typeof(IComponentChangeService)); |
||||
if (componentChangeService != null) { |
||||
componentChangeService.ComponentChanged -= OnComponentChanged; |
||||
componentChangeService.ComponentAdded -= OnComponentListChanged; |
||||
componentChangeService.ComponentRemoved -= OnComponentListChanged; |
||||
componentChangeService.ComponentRename -= OnComponentListChanged; |
||||
} |
||||
|
||||
ISelectionService selectionService = (ISelectionService)this.designSurface.GetService(typeof(ISelectionService)); |
||||
if (selectionService != null) { |
||||
selectionService.SelectionChanged -= SelectionChangedHandler; |
||||
} |
||||
|
||||
|
||||
if (this.loader != null) { |
||||
this.loader.Dispose(); |
||||
} |
||||
|
||||
|
||||
if (this.defaultServiceContainer != null) { |
||||
this.defaultServiceContainer.Dispose(); |
||||
} |
||||
|
||||
if (this.undoEngine != null) { |
||||
this.undoEngine.Dispose(); |
||||
} |
||||
if (this.xmlView != null) { |
||||
this.xmlView.Dispose(); |
||||
} |
||||
if (this.reportPreview != null) { |
||||
this.reportPreview.Dispose(); |
||||
} |
||||
if (this.reportViewer != null) { |
||||
this.reportViewer.Dispose(); |
||||
} |
||||
if (this.panel != null) { |
||||
this.panel.Dispose(); |
||||
} |
||||
|
||||
if (this.Host != null) { |
||||
this.Host.TransactionClosed -= TransactionClose; |
||||
} |
||||
|
||||
} finally { |
||||
base.Dispose(); |
||||
|
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
} |
@ -1,139 +0,0 @@
@@ -1,139 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ColumnNode.
|
||||
/// </summary>
|
||||
|
||||
internal class AbstractFieldsNode : TreeNode { |
||||
|
||||
private string contextMenuAddinTreePath = String.Empty; |
||||
|
||||
protected AbstractFieldsNode(string nodeName):base() |
||||
{ |
||||
this.Text = nodeName; |
||||
} |
||||
|
||||
public AbstractFieldsNode(string nodeName,string contextMenuAddinTreePath):base(nodeName) |
||||
{ |
||||
this.contextMenuAddinTreePath = contextMenuAddinTreePath; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Generates a Drag & Drop data object. If this property returns null
|
||||
/// the node indicates that it can't be dragged.
|
||||
/// </summary>
|
||||
public virtual DataObject DragDropDataObject { |
||||
get { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the add-in tree path for the context menu.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// I choosed to give back the add-in tree path instead of a popup menu
|
||||
/// or a menuitem collection, because I don't want to add a magic library
|
||||
/// or Windows.Forms dependency.
|
||||
/// </remarks>
|
||||
|
||||
public virtual string ContextMenuAddinTreePath { |
||||
get { |
||||
return contextMenuAddinTreePath; |
||||
} |
||||
set { |
||||
contextMenuAddinTreePath = value; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
internal class SectionNode:AbstractFieldsNode |
||||
{ |
||||
public SectionNode (string nodeName):base(nodeName) |
||||
{ |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
internal class ColumnNode:AbstractFieldsNode |
||||
{ |
||||
public ColumnNode(string nodeName,int imageIndex):base(nodeName) |
||||
{ |
||||
this.ImageIndex = imageIndex; |
||||
this.SelectedImageIndex = imageIndex; |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class ParameterNode:AbstractFieldsNode |
||||
{ |
||||
public ParameterNode(string nodeName,int imageIndex):base(nodeName) |
||||
{ |
||||
this.ImageIndex = imageIndex; |
||||
this.SelectedImageIndex = imageIndex; |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class SortColumnNode:AbstractFieldsNode |
||||
{ |
||||
ListSortDirection listSortDirection; |
||||
|
||||
public SortColumnNode(string nodeName,string contextMenuPath):this(nodeName,0,contextMenuPath) |
||||
{ |
||||
|
||||
} |
||||
|
||||
public SortColumnNode(string nodeName,int imageIndex,string contextMenuPath):base(nodeName,contextMenuPath) |
||||
{ |
||||
this.ImageIndex = imageIndex; |
||||
this.SelectedImageIndex = imageIndex; |
||||
this.ContextMenuAddinTreePath = contextMenuPath; |
||||
} |
||||
|
||||
public ListSortDirection SortDirection { |
||||
get { return listSortDirection; } |
||||
set { listSortDirection = value; } |
||||
} |
||||
|
||||
public string FieldName {get;set;} |
||||
} |
||||
|
||||
internal class GroupColumnNode:SortColumnNode |
||||
{ |
||||
public GroupColumnNode (string nodeName,string contextMenuPath):this(nodeName,0,contextMenuPath) |
||||
{ |
||||
|
||||
} |
||||
public GroupColumnNode (string nodeName,int imageIndex,string contextMenuPath):base(nodeName,imageIndex,contextMenuPath) |
||||
{ |
||||
|
||||
} |
||||
} |
||||
} |
@ -1,472 +0,0 @@
@@ -1,472 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using System.Linq; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Core.WinForms; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.Reports.Core.BaseClasses; |
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
|
||||
/// <summary>
|
||||
/// Description of ExplorerTree.
|
||||
/// </summary>
|
||||
internal class ExplorerTree:TreeView,INotifyPropertyChanged |
||||
{ |
||||
private const string sortColumnMenuPath = "/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnSortTreeNode"; |
||||
private const string sectionContextMenu = "/SharpDevelopReports/ContextMenu/FieldsExplorer/SectionTreeNode"; |
||||
private const string parameterEditorMenu = "/SharpDevelopReports/ContextMenu/FieldsExplorer/ParameterNode"; |
||||
private const string groupContextMenuPath ="/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnGroupTreeNode"; |
||||
|
||||
private SectionNode nodeRoot; |
||||
private SectionNode nodeModel; |
||||
|
||||
private SectionNode nodeAvailableFields; |
||||
private SectionNode nodeSorting; |
||||
private SectionNode nodeGrouping; |
||||
private TreeNode nodeFunction; |
||||
private SectionNode nodeParams; |
||||
|
||||
private static int folderClosed = 0; |
||||
private static int folderOpen = 1; |
||||
// private static int clearIcon = 2;
|
||||
|
||||
private static int ascendingIcon = 4; |
||||
private static int descendingIcon = 5; |
||||
// private static int storedprocIcon = 7;
|
||||
|
||||
private static int columnIcon = 8; |
||||
|
||||
private ReportModel reportModel; |
||||
|
||||
public ExplorerTree():base() |
||||
{ |
||||
LabelEdit = true; |
||||
AllowDrop = true; |
||||
HideSelection = false; |
||||
Dock = DockStyle.Fill; |
||||
Scrollable = true; |
||||
this.InitImageList(); |
||||
this.AllowDrop = true; |
||||
} |
||||
|
||||
|
||||
#region DragDrop
|
||||
|
||||
[EditorBrowsableAttribute()] |
||||
protected override void OnMouseDown(MouseEventArgs e) |
||||
{ |
||||
base.OnMouseDown(e); |
||||
TreeNode node = GetNodeAt(e.X, e.Y); |
||||
if (node != null) { |
||||
if (SelectedNode != node) { |
||||
SelectedNode = node; |
||||
this.DoDragDrop(SelectedNode, DragDropEffects.Copy); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
[EditorBrowsableAttribute()] |
||||
protected override void OnDragOver(DragEventArgs drgevent) |
||||
{ |
||||
base.OnDragOver(drgevent); |
||||
TreeNode node = this.GetNodeAt(this.PointToClient(new Point (drgevent.X,drgevent.Y))); |
||||
|
||||
node.EnsureVisible(); |
||||
if (node.Nodes.Count > 0) { |
||||
node.Expand(); |
||||
} |
||||
|
||||
if (drgevent.Data.GetData(typeof(ColumnNode)) != null) |
||||
{ |
||||
if (node is SectionNode){ |
||||
drgevent.Effect = DragDropEffects.Copy | DragDropEffects.Scroll; |
||||
} else { |
||||
drgevent.Effect = DragDropEffects.None; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void OnItemDrag(ItemDragEventArgs e) |
||||
{ |
||||
base.OnItemDrag(e); |
||||
ColumnNode node = e.Item as ColumnNode; |
||||
if (node != null) { |
||||
if (node.ImageIndex == ExplorerTree.columnIcon) { |
||||
this.SelectedNode = node; |
||||
if (node != null) { |
||||
this.DoDragDrop(node,DragDropEffects.Copy | DragDropEffects.Scroll); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
[EditorBrowsableAttribute()] |
||||
protected override void OnDragDrop(DragEventArgs drgevent) |
||||
{ |
||||
base.OnDragDrop(drgevent); |
||||
ColumnNode node = (ColumnNode)drgevent.Data.GetData(typeof(ColumnNode)); |
||||
Point pt = this.PointToClient (new Point( drgevent.X,drgevent.Y)); |
||||
SectionNode sectionNode = this.GetNodeAt (pt) as SectionNode; |
||||
if ((sectionNode != null) && (!ExplorerTree.NodeExist (sectionNode,node.Text))) { |
||||
if (sectionNode == this.nodeGrouping) { |
||||
this.nodeSorting.Nodes.Clear(); |
||||
AddGrouping(sectionNode,node); |
||||
} else { |
||||
AddSorting (sectionNode,node); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
private void AddSorting(SectionNode sectionNode, ColumnNode node) |
||||
{ |
||||
SortColumnNode sortNode = new SortColumnNode (node.Text, |
||||
ExplorerTree.ascendingIcon, |
||||
ExplorerTree.sortColumnMenuPath); |
||||
|
||||
sortNode.SortDirection = ListSortDirection.Ascending; |
||||
this.SelectedNode = sortNode; |
||||
sectionNode.Nodes.Add(sortNode); |
||||
this.reportModel.ReportSettings.SortColumnsCollection.Add(new SortColumn(sortNode.Text, |
||||
ListSortDirection.Ascending, |
||||
typeof(System.String),false)); |
||||
this.OnPropertyChanged ("Sorting"); |
||||
|
||||
} |
||||
|
||||
|
||||
private void AddGrouping(SectionNode sectionNode,ColumnNode node) |
||||
{ |
||||
this.nodeSorting.Nodes.Clear(); |
||||
GroupColumnNode groupNode = new GroupColumnNode(node.Text,ExplorerTree.ascendingIcon, |
||||
ExplorerTree.sortColumnMenuPath); |
||||
groupNode.SortDirection = ListSortDirection.Ascending; |
||||
this.SelectedNode = groupNode; |
||||
sectionNode.Nodes.Add(groupNode); |
||||
this.reportModel.ReportSettings.GroupColumnsCollection.Add(new GroupColumn(groupNode.Text, 1,ListSortDirection.Ascending)); |
||||
this.OnPropertyChanged ("Grouping"); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
private static bool NodeExist (SectionNode sec,string nodeName) |
||||
{ |
||||
if (sec.Nodes.Count > 0) { |
||||
for (int i = 0;i < sec.Nodes.Count ;i++ ) { |
||||
if (sec.Nodes[i].Text == nodeName) { |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
|
||||
#region Update Sorting - Grouping
|
||||
|
||||
private ColumnCollection CollectSortColumns() |
||||
{ |
||||
ColumnCollection cl = new ColumnCollection(); |
||||
if (this.nodeSorting.Nodes.Count > 0) { |
||||
SortColumn sortColumn; |
||||
AbstractColumn abstrCol; |
||||
|
||||
foreach (SortColumnNode sortNode in this.nodeSorting.Nodes) { |
||||
abstrCol = this.reportModel.ReportSettings.AvailableFieldsCollection.Find(sortNode.Text); |
||||
|
||||
if (abstrCol != null) { |
||||
sortColumn = new SortColumn (sortNode.FieldName, |
||||
sortNode.SortDirection, |
||||
abstrCol.DataType,true); |
||||
} else { |
||||
sortColumn = new SortColumn (sortNode.Text, |
||||
sortNode.SortDirection, |
||||
typeof(System.String),true); |
||||
} |
||||
cl.Add(sortColumn); |
||||
} |
||||
} |
||||
return cl; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Treehandling
|
||||
|
||||
public void RemoveSortNode() |
||||
{ |
||||
if (this.SelectedNode != null) { |
||||
AbstractColumn abstr = this.reportModel.ReportSettings.SortColumnsCollection.Find(this.SelectedNode.Text); |
||||
if (abstr != null) { |
||||
this.reportModel.ReportSettings.SortColumnsCollection.Remove(abstr as SortColumn); |
||||
} |
||||
TreeNode parent = this.SelectedNode.Parent; |
||||
this.SelectedNode.Remove(); |
||||
this.SelectedNode = parent; |
||||
this.OnPropertyChanged ("RemoveSortNode"); |
||||
} |
||||
} |
||||
|
||||
public void RemoveGroupNode () |
||||
{ |
||||
if (this.SelectedNode != null) { |
||||
AbstractColumn abstr = this.reportModel.ReportSettings.GroupColumnsCollection.Find(this.SelectedNode.Text); |
||||
if (abstr != null) { |
||||
this.reportModel.ReportSettings.GroupColumnsCollection.Remove(abstr as GroupColumn); |
||||
TreeNode parent = this.SelectedNode.Parent; |
||||
this.SelectedNode.Remove(); |
||||
this.SelectedNode = parent; |
||||
this.OnPropertyChanged ("RemoveGroupNode"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public void ClearSection () |
||||
{ |
||||
this.nodeSorting.Nodes.Clear(); |
||||
this.reportModel.ReportSettings.SortColumnsCollection.Clear(); |
||||
this.OnPropertyChanged ("ClearSection"); |
||||
} |
||||
|
||||
|
||||
public void ToggleSortOrder() |
||||
{ |
||||
SortColumnNode sortColumnNode = this.SelectedNode as SortColumnNode; |
||||
|
||||
if (sortColumnNode != null) { |
||||
if (sortColumnNode.SortDirection == ListSortDirection.Ascending) { |
||||
sortColumnNode.SortDirection = ListSortDirection.Descending; |
||||
sortColumnNode.ImageIndex = descendingIcon; |
||||
sortColumnNode.SelectedImageIndex = descendingIcon; |
||||
} else { |
||||
sortColumnNode.SortDirection = ListSortDirection.Ascending; |
||||
sortColumnNode.ImageIndex = ascendingIcon; |
||||
sortColumnNode.SelectedImageIndex = ascendingIcon; |
||||
} |
||||
SortColumn abstractColumn = null; |
||||
if (this.SelectedNode is GroupColumnNode) { |
||||
|
||||
abstractColumn = (SortColumn)this.reportModel.ReportSettings.GroupColumnsCollection.Find(this.SelectedNode.Text); |
||||
} else { |
||||
abstractColumn = (SortColumn)this.reportModel.ReportSettings.SortColumnsCollection.Find(this.SelectedNode.Text); |
||||
} |
||||
abstractColumn.SortDirection = sortColumnNode.SortDirection; |
||||
this.OnPropertyChanged ("ToggleSortOrder"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region INotifyPropertyChanged
|
||||
|
||||
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
private void OnPropertyChanged (string property) |
||||
{ |
||||
if (this.PropertyChanged != null) { |
||||
this.PropertyChanged(this,new System.ComponentModel.PropertyChangedEventArgs(property)); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region FillTree
|
||||
|
||||
private void SetGroupColumns() |
||||
{ |
||||
foreach (GroupColumn groupColumn in this.reportModel.ReportSettings.GroupColumnsCollection) |
||||
{ |
||||
var groupNode = new GroupColumnNode(groupColumn.ColumnName,groupContextMenuPath); |
||||
if (groupColumn.SortDirection == ListSortDirection.Ascending) { |
||||
groupNode.ImageIndex = ascendingIcon; |
||||
} else { |
||||
groupNode.ImageIndex = descendingIcon; |
||||
} |
||||
this.nodeGrouping.Nodes.Add(groupNode); |
||||
foreach (var p in this.reportModel.ReportSettings.AvailableFieldsCollection.Where(p => (p.ColumnName != groupColumn.ColumnName))) |
||||
{ |
||||
var cn = new ColumnNode(p.ColumnName,columnIcon); |
||||
groupNode.Nodes.Add(cn); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public void BuildTree () |
||||
{ |
||||
this.BeginUpdate(); |
||||
this.nodeAvailableFields.Nodes.Clear(); |
||||
this.nodeSorting.Nodes.Clear(); |
||||
this.nodeGrouping.Nodes.Clear(); |
||||
this.nodeParams.Nodes.Clear(); |
||||
this.reportModel.ReportSettings.AvailableFieldsCollection.ForEach(SetAvailableFields); |
||||
this.reportModel.ReportSettings.SortColumnsCollection.ForEach(SetSortColumns); |
||||
SetGroupColumns(); |
||||
this.reportModel.ReportSettings.ParameterCollection.ForEach(SetParams); |
||||
// SetFunctions();
|
||||
this.ExpandAll(); |
||||
this.EndUpdate(); |
||||
} |
||||
|
||||
|
||||
private void SetAvailableFields (AbstractColumn af) |
||||
{ |
||||
ColumnNode node = new ColumnNode(af.ColumnName,columnIcon); |
||||
node.Tag = this.nodeAvailableFields; |
||||
node.SelectedImageIndex = columnIcon; |
||||
this.nodeAvailableFields.Nodes.Add(node); |
||||
} |
||||
|
||||
|
||||
private void SetSortColumns (AbstractColumn column) |
||||
{ |
||||
SortColumn sortColumn = column as SortColumn; |
||||
|
||||
if (sortColumn != null) { |
||||
var sortColumnNode = new SortColumnNode (sortColumn.ColumnName,sortColumnMenuPath); |
||||
|
||||
if (sortColumn.SortDirection == ListSortDirection.Ascending) { |
||||
sortColumnNode.ImageIndex = ascendingIcon; |
||||
} else { |
||||
sortColumnNode.ImageIndex = descendingIcon; |
||||
} |
||||
this.nodeSorting.Nodes.Add(sortColumnNode); |
||||
} |
||||
|
||||
} |
||||
|
||||
private void SetParams (BasicParameter p) |
||||
{ |
||||
string s = String.Format(System.Globalization.CultureInfo.CurrentCulture, |
||||
"{0}[{1}]",p.ParameterName,p.ParameterValue); |
||||
ParameterNode node = new ParameterNode(s,columnIcon); |
||||
this.nodeParams.Nodes.Add(node); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Build Basic Tree
|
||||
|
||||
private void BuildNodes() |
||||
{ |
||||
BeginUpdate(); |
||||
this.Nodes.Clear(); |
||||
string s = String.Format(System.Globalization.CultureInfo.CurrentCulture, |
||||
"[{0}]",this.reportModel.ReportSettings.ReportName); |
||||
this.nodeRoot = new SectionNode(s); |
||||
|
||||
this.nodeModel = new SectionNode("Model"); |
||||
|
||||
nodeAvailableFields = new SectionNode(ResourceService.GetString("SharpReport.FieldsExplorer.AvailableFields")); |
||||
nodeAvailableFields.ImageIndex = folderClosed; |
||||
nodeAvailableFields.SelectedImageIndex = folderOpen; |
||||
// we don't like a ContextMenu here
|
||||
nodeAvailableFields.ContextMenuAddinTreePath = String.Empty; |
||||
this.nodeModel.Nodes.Add(this.nodeAvailableFields); |
||||
|
||||
nodeGrouping = new SectionNode (ResourceService.GetString("SharpReport.FieldsExplorer.Grouping")); |
||||
nodeGrouping.ImageIndex = folderClosed; |
||||
nodeGrouping.SelectedImageIndex = folderOpen; |
||||
nodeGrouping.ContextMenuAddinTreePath = ExplorerTree.sectionContextMenu; |
||||
this.nodeModel.Nodes.Add(this.nodeGrouping); |
||||
|
||||
nodeSorting = new SectionNode (ResourceService.GetString("SharpReport.FieldsExplorer.Sorting")); |
||||
nodeSorting.ImageIndex = folderClosed; |
||||
nodeSorting.SelectedImageIndex = folderOpen; |
||||
nodeSorting.ContextMenuAddinTreePath = ExplorerTree.sectionContextMenu; |
||||
this.nodeModel.Nodes.Add(this.nodeSorting); |
||||
|
||||
|
||||
|
||||
nodeFunction = new TreeNode(ResourceService.GetString("SharpReport.FieldsExplorer.Functions")); |
||||
nodeFunction.ImageIndex = folderClosed; |
||||
nodeFunction.SelectedImageIndex = folderOpen; |
||||
this.nodeModel.Nodes.Add(this.nodeFunction); |
||||
|
||||
nodeParams = new SectionNode(ResourceService.GetString("SharpReport.FieldsExplorer.Parameters")); |
||||
nodeParams.ImageIndex = folderClosed; |
||||
nodeParams.SelectedImageIndex = folderOpen; |
||||
nodeParams.ContextMenuAddinTreePath = ExplorerTree.parameterEditorMenu; |
||||
|
||||
this.nodeModel.Nodes.Add(this.nodeParams); |
||||
this.nodeRoot.Nodes.Add(nodeModel); |
||||
|
||||
this.Nodes.Add (this.nodeRoot); |
||||
this.EndUpdate(); |
||||
} |
||||
|
||||
|
||||
private void InitImageList() |
||||
{ |
||||
ImageList imageList = new ImageList(); |
||||
imageList.ColorDepth = ColorDepth.Depth32Bit; |
||||
imageList.ImageSize = new System.Drawing.Size(16, 16); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap")); |
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap")); |
||||
imageList.Images.Add(new Bitmap(1, 1)); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SelectionArrow")); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpReport.Ascending")); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpReport.Descending")); |
||||
//Table's or procedure
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Table")); |
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Procedure")); |
||||
|
||||
//Parameters
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Column")); |
||||
|
||||
//Function
|
||||
imageList.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.SharpReport.Function")); |
||||
this.ImageList = imageList; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Property's
|
||||
|
||||
public ReportModel ReportModel { |
||||
set { this.reportModel = value; |
||||
this.BuildNodes(); |
||||
this.BuildTree(); |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,209 +0,0 @@
@@ -1,209 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core.WinForms; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of the pad content
|
||||
/// </summary>
|
||||
internal sealed class ReportExplorerPad : AbstractPadContent,INotifyPropertyChanged |
||||
{ |
||||
private static int viewCount; |
||||
private ExplorerTree explorerTree; |
||||
private static ReportExplorerPad instance; |
||||
private ReportModel reportModel; |
||||
/// <summary>
|
||||
/// Creates a new ReportExplorer object
|
||||
/// </summary>
|
||||
|
||||
|
||||
public ReportExplorerPad():base() |
||||
{ |
||||
SD.Workbench.ActiveViewContentChanged += ActiveViewContentChanged; |
||||
SD.Workbench.ViewClosed += ActiveViewClosed; |
||||
this.explorerTree = new ExplorerTree(); |
||||
this.explorerTree.MouseDown += new MouseEventHandler(ReportExplorer_MouseDown); |
||||
this.explorerTree.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ReportExplorerPad_PropertyChanged); |
||||
instance = this; |
||||
} |
||||
|
||||
|
||||
void ReportExplorerPad_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) |
||||
{ |
||||
this.NotifyReportView(e.PropertyName); |
||||
} |
||||
|
||||
#region Setup
|
||||
|
||||
|
||||
|
||||
public void AddContent (ReportModel reportModel) |
||||
{ |
||||
|
||||
if (reportModel == null) { |
||||
throw new ArgumentNullException("reportModel"); |
||||
} |
||||
this.reportModel = reportModel; |
||||
this.explorerTree.ReportModel = this.reportModel; |
||||
ViewCount++; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
void ActiveViewContentChanged(object source, EventArgs e) |
||||
{ |
||||
ReportDesignerView vv = SD.Workbench.ActiveViewContent as ReportDesignerView; |
||||
if (vv != null) { |
||||
Console.WriteLine("Explorerpad:ActiveViewContentChanged {0}",vv.TitleName); |
||||
} |
||||
} |
||||
|
||||
private void ActiveViewClosed (object source, ViewContentEventArgs e) |
||||
{ |
||||
if (e.Content is ReportDesignerView) { |
||||
Console.WriteLine ("Designer closed"); |
||||
ViewCount --; |
||||
} |
||||
} |
||||
|
||||
|
||||
#region Mouse
|
||||
|
||||
private void ReportExplorer_MouseDown (object sender, MouseEventArgs e) |
||||
{ |
||||
AbstractFieldsNode abstrNode = this.explorerTree.GetNodeAt(e.X, e.Y) as AbstractFieldsNode; |
||||
if (e.Button == MouseButtons.Right) { |
||||
this.explorerTree.SelectedNode = abstrNode; |
||||
if (abstrNode != null) { |
||||
if (abstrNode.ContextMenuAddinTreePath.Length > 0) { |
||||
ContextMenuStrip ctMen = MenuService.CreateContextMenu (this,abstrNode.ContextMenuAddinTreePath); |
||||
ctMen.Show (this.explorerTree, new Point (e.X,e.Y)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region publics for Commands
|
||||
|
||||
// These public methods are all called from ExplorerCommands
|
||||
|
||||
public void ClearNodes () |
||||
{ |
||||
this.explorerTree.ClearSection(); |
||||
} |
||||
|
||||
|
||||
public void ToggleOrder () |
||||
{ |
||||
this.explorerTree.ToggleSortOrder(); |
||||
} |
||||
|
||||
|
||||
public void RemoveSortNode() |
||||
{ |
||||
this.explorerTree.RemoveSortNode(); |
||||
} |
||||
|
||||
|
||||
public void RemoveGroupNode() |
||||
{ |
||||
this.explorerTree.RemoveGroupNode(); |
||||
} |
||||
|
||||
public void RefreshParameters() |
||||
{ |
||||
this.explorerTree.BuildTree(); |
||||
this.NotifyReportView("Parameters"); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
public static ReportExplorerPad Instance { |
||||
get { return instance; } |
||||
} |
||||
|
||||
|
||||
public static int ViewCount { |
||||
get { return viewCount; } |
||||
set { |
||||
viewCount = value; |
||||
if (viewCount == 0) { |
||||
Console.WriteLine("Should find a way to close/hide a pad"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public ReportModel ReportModel |
||||
{get {return this.reportModel;}} |
||||
|
||||
|
||||
#region IPropertyChanged
|
||||
|
||||
|
||||
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
private void NotifyReportView(string property) |
||||
{ |
||||
if (this.PropertyChanged != null) { |
||||
this.PropertyChanged(this,new System.ComponentModel.PropertyChangedEventArgs(property)); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region AbstractPadContent
|
||||
/// <summary>
|
||||
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
|
||||
/// </summary>
|
||||
public override object Control |
||||
{ |
||||
get { |
||||
return this.explorerTree; |
||||
} |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Cleans up all used resources
|
||||
/// </summary>
|
||||
public override void Dispose() |
||||
{ |
||||
SD.Workbench.ActiveViewContentChanged -= ActiveViewContentChanged; |
||||
this.explorerTree.Dispose(); |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,105 +0,0 @@
@@ -1,105 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportItem.
|
||||
/// </summary>
|
||||
///
|
||||
[TypeDescriptionProvider(typeof(AbstractItemTypeProvider))] |
||||
public abstract class AbstractItem:System.Windows.Forms.Control |
||||
{ |
||||
private Color frameColor = Color.Black; |
||||
|
||||
|
||||
protected AbstractItem() |
||||
{ |
||||
InitializeComponent(); |
||||
TypeDescriptor.AddProvider(new AbstractItemTypeProvider(), typeof(AbstractItem)); |
||||
// VisibleInReport = true;
|
||||
} |
||||
|
||||
|
||||
protected void DrawControl (Graphics graphics,Rectangle borderRectangle) |
||||
{ |
||||
if (this.DrawBorder == true) { |
||||
graphics.DrawRectangle(new Pen(this.frameColor),borderRectangle); |
||||
} |
||||
System.Windows.Forms.ControlPaint.DrawBorder3D(graphics, this.ClientRectangle, |
||||
System.Windows.Forms.Border3DStyle.Etched); |
||||
} |
||||
|
||||
|
||||
#region Property's
|
||||
|
||||
protected Rectangle DrawingRectangle { |
||||
get { |
||||
|
||||
return new Rectangle(this.ClientRectangle.Left , |
||||
this.ClientRectangle.Top , |
||||
this.ClientRectangle.Width -1, |
||||
this.ClientRectangle.Height -1); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Border")] |
||||
public Color FrameColor { |
||||
get { return frameColor; } |
||||
set { |
||||
frameColor = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Border"), |
||||
Description("Draw a Border around the Item")] |
||||
public bool DrawBorder {get;set;} |
||||
|
||||
protected new Size DefaultSize {get;set;} |
||||
|
||||
// public bool VisibleInReport {get;set;}
|
||||
|
||||
#endregion
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint(e); |
||||
} |
||||
|
||||
public abstract void Draw(Graphics graphics); |
||||
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.SuspendLayout(); |
||||
this.ResumeLayout(false); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
</root> |
@ -1,105 +0,0 @@
@@ -1,105 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Drawing.Drawing2D; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseCircleItem.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.ContainerItemDesigner))] |
||||
//[Designer(typeof(ICSharpCode.Reports.Addin.Designer.ShapeDesigner))]
|
||||
public class BaseCircleItem:AbstractItem |
||||
{ |
||||
|
||||
private DashStyle dashStyle; |
||||
private float thickness; |
||||
|
||||
|
||||
public BaseCircleItem() |
||||
{ |
||||
this.thickness = 1; |
||||
this.dashStyle = DashStyle.Solid; |
||||
this.Size = new Size(GlobalValues.PreferedSize.Width,2* GlobalValues.PreferedSize.Height); |
||||
TypeDescriptor.AddProvider(new CircleItemTypeProvider(), typeof(BaseCircleItem)); |
||||
} |
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
e.Graphics.SmoothingMode = SmoothingMode.HighQuality; |
||||
base.OnPaint(e); |
||||
Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
|
||||
Rectangle rect = new Rectangle(this.ClientRectangle.Left,this.ClientRectangle.Top, |
||||
this.ClientRectangle.Right -2, |
||||
this.ClientRectangle.Bottom -2); |
||||
|
||||
|
||||
using (Brush b = new SolidBrush(this.BackColor)) { |
||||
graphics.FillEllipse(b,rect); |
||||
} |
||||
|
||||
using (Pen p = new Pen(this.ForeColor,this.thickness)) { |
||||
graphics.DrawEllipse(p,rect); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Linestyle")] |
||||
public DashStyle DashStyle { |
||||
get { return dashStyle; } |
||||
set { |
||||
dashStyle = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Thickness of Line")] |
||||
|
||||
public float Thickness { |
||||
get { return thickness; } |
||||
set { |
||||
thickness = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,88 +0,0 @@
@@ -1,88 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
|
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseDataItem.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.DataItemDesigner))] |
||||
public class BaseDataItem:BaseTextItem |
||||
{ |
||||
private string columnName; |
||||
private string baseTableName; |
||||
private string dbValue; |
||||
private string nullValue; |
||||
|
||||
public BaseDataItem():base() |
||||
{ |
||||
TypeDescriptor.AddProvider(new DataItemTypeProvider(), typeof(BaseDataItem)); |
||||
} |
||||
|
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint(e); |
||||
this.Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
base.Draw(graphics); |
||||
} |
||||
|
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("Datatype of the underlying Column")] |
||||
public string ColumnName { |
||||
get { return columnName; } |
||||
set { columnName = value; } |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("TableName")] |
||||
public string BaseTableName { |
||||
get { return baseTableName; } |
||||
set { baseTableName = value; } |
||||
} |
||||
|
||||
public string DbValue { |
||||
get { return dbValue; } |
||||
set { dbValue = value; } |
||||
} |
||||
|
||||
|
||||
public string NullValue { |
||||
get { return nullValue; } |
||||
set { nullValue = value; } |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,244 +0,0 @@
@@ -1,244 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Drawing.Design; |
||||
using System.IO; |
||||
using System.Windows.Forms.Design; |
||||
using System.Xml.Serialization; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseImageItem.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.ImageDesigner))] |
||||
public class BaseImageItem:AbstractItem |
||||
{ |
||||
private string imageFileName; |
||||
private Image image; |
||||
private GlobalEnums.ImageSource imageSource; |
||||
private string reportFileName; |
||||
|
||||
public BaseImageItem() |
||||
{ |
||||
TypeDescriptor.AddProvider(new ImageItemTypeProvider(), typeof(BaseImageItem)); |
||||
} |
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
|
||||
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; |
||||
base.OnPaint(e); |
||||
Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
Rectangle rect = new Rectangle(this.ClientRectangle.Left,this.ClientRectangle.Top, |
||||
this.ClientRectangle.Right -1, |
||||
this.ClientRectangle.Bottom -1); |
||||
|
||||
base.DrawControl(graphics,rect); |
||||
if (this.ScaleImageToSize) { |
||||
graphics.DrawImageUnscaled(this.Image,this.Location.X,this.Location.Y); |
||||
} else { |
||||
graphics.DrawImage(this.Image,this.ClientRectangle); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
#region Property's
|
||||
[Category("Image")] |
||||
[EditorAttribute ( typeof(FileNameEditor), typeof(UITypeEditor) ) ] |
||||
public string ImageFileName { |
||||
get { return imageFileName; } |
||||
set { imageFileName = value; |
||||
if (!String.IsNullOrEmpty(reportFileName)) { |
||||
this.RelativeFileName = FileUtility.GetRelativePath(Path.GetFullPath(this.reportFileName),Path.GetFullPath(this.ImageFileName)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
private static Bitmap ErrorBitmap(Size size) |
||||
{ |
||||
Bitmap b = new Bitmap (size.Width,size.Height); |
||||
using (Graphics g = Graphics.FromImage (b)){ |
||||
g.DrawRectangle (new Pen(Color.Black, 1), |
||||
1,1,size.Width -2,size.Height -2); |
||||
g.DrawString("Image",new Font("Microsoft Sans Serif", 8), |
||||
new SolidBrush(Color.Gray), |
||||
new RectangleF(1,1,size.Width,size.Height) ); |
||||
} |
||||
return b; |
||||
} |
||||
|
||||
|
||||
private static Bitmap FakeImage(Size size, string text) |
||||
{ |
||||
Bitmap b = new Bitmap (size.Width,size.Height); |
||||
using (Graphics g = Graphics.FromImage (b)){ |
||||
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; |
||||
g.DrawRectangle (new Pen(Color.Black, 1), |
||||
1,1,size.Width -2,size.Height -2); |
||||
|
||||
g.DrawString(text,GlobalValues.DefaultFont, |
||||
new SolidBrush(Color.Gray), |
||||
new RectangleF(2,2,size.Width,size.Height) ); |
||||
} |
||||
return b; |
||||
} |
||||
|
||||
|
||||
private Image LoadImage () |
||||
{ |
||||
try { |
||||
Image im = null; |
||||
|
||||
string absFileName = this.AbsoluteFileName; |
||||
if (!String.IsNullOrEmpty(absFileName) && File.Exists(absFileName)){ |
||||
im = Image.FromFile (absFileName); |
||||
} else { |
||||
im = BaseImageItem.ErrorBitmap(base.Size); |
||||
} |
||||
return im; |
||||
|
||||
} catch (System.OutOfMemoryException) { |
||||
throw; |
||||
} catch (System.IO.FileNotFoundException) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
[XmlIgnoreAttribute] |
||||
public Image Image { |
||||
get { |
||||
string text = "<Image>"; |
||||
if (this.imageSource == GlobalEnums.ImageSource.Database ) { |
||||
text = "<Database>"; |
||||
} |
||||
|
||||
if (!String.IsNullOrEmpty(imageFileName)) { |
||||
this.image = this.LoadImage(); |
||||
return this.image; |
||||
} else |
||||
{ |
||||
this.image = FakeImage(base.Size,text); |
||||
} |
||||
return this.image; |
||||
} |
||||
|
||||
set { |
||||
this.image = value; |
||||
this.imageSource = GlobalEnums.ImageSource.External; |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Layout")] |
||||
public bool ScaleImageToSize {get;set;} |
||||
|
||||
|
||||
|
||||
[Category("Image")] |
||||
public GlobalEnums.ImageSource ImageSource { |
||||
get { return imageSource; } |
||||
set { imageSource = value; } |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
[Category("DataBinding")] |
||||
public string ColumnName {get;set;} |
||||
|
||||
|
||||
[Category("DataBinding")] |
||||
public string BaseTableName {get;set;} |
||||
|
||||
|
||||
[Category("DataBinding")] |
||||
public string DataType {get;set;} |
||||
|
||||
|
||||
[XmlIgnoreAttribute] |
||||
[Category("Image")] |
||||
public string ReportFileName { |
||||
get { return Path.GetFullPath(reportFileName); } |
||||
set { reportFileName = value;} |
||||
} |
||||
|
||||
|
||||
[Category("Image")] |
||||
[Browsable(false)] |
||||
public string RelativeFileName {get;set;} |
||||
|
||||
|
||||
|
||||
[XmlIgnoreAttribute] |
||||
[Category("Image")] |
||||
[Browsable(false)] |
||||
public string AbsoluteFileName |
||||
{ |
||||
get { |
||||
if (!string.IsNullOrEmpty(RelativeFileName)) { |
||||
Console.WriteLine(""); |
||||
|
||||
string testFileName = String.Empty; |
||||
if (! String.IsNullOrEmpty(reportFileName)) { |
||||
testFileName = FileUtility.NormalizePath(Path.Combine(Path.GetDirectoryName(this.reportFileName),this.RelativeFileName)); |
||||
} |
||||
|
||||
if (File.Exists(testFileName)){ |
||||
Console.WriteLine("Image found with Relative Filename"); |
||||
return testFileName; |
||||
} else { |
||||
Console.WriteLine("AbsoluteFileName can't load image"); |
||||
Console.WriteLine("Report Filename {0}",this.reportFileName); |
||||
Console.WriteLine("Relative Filename {0}",this.RelativeFileName); |
||||
Console.WriteLine("Image Filename {0}",this.ImageFileName); |
||||
} |
||||
} |
||||
return this.ImageFileName; |
||||
} |
||||
} |
||||
|
||||
public new string Name {get;set;} |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -1,176 +0,0 @@
@@ -1,176 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Drawing.Drawing2D; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseLine.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.LineDesigner))] |
||||
public class BaseLineItem:AbstractItem |
||||
{ |
||||
private Point fromPoint; |
||||
private Point toPoint; |
||||
private LineCap startLineCap; |
||||
private LineCap endLineCap; |
||||
private DashCap dashLineCap; |
||||
private DashStyle dashStyle; |
||||
private float thickness; |
||||
|
||||
public BaseLineItem() |
||||
{ |
||||
this.thickness = 1; |
||||
this.dashStyle = DashStyle.Solid; |
||||
this.Size = new Size(50,10); |
||||
TypeDescriptor.AddProvider(new LineItemTypeProvider(), typeof(BaseLineItem)); |
||||
this.SetStartEndPoint(); |
||||
} |
||||
|
||||
private void SetStartEndPoint () |
||||
{ |
||||
this.fromPoint = new Point(ClientRectangle.Left + 10,ClientRectangle.Height / 2); |
||||
this.toPoint = new Point(ClientRectangle.Left + ClientRectangle.Width - 10, |
||||
ClientRectangle.Height/ 2); |
||||
this.Invalidate(); |
||||
} |
||||
|
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
e.Graphics.SmoothingMode = SmoothingMode.HighQuality; |
||||
base.OnPaint(e); |
||||
Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
using (Pen p = new Pen(this.ForeColor,this.Thickness)) { |
||||
p.SetLineCap(this.StartLineCap,this.EndLineCap,this.DashLineCap); |
||||
graphics.DrawLine(p,this.fromPoint,this.toPoint); |
||||
} |
||||
} |
||||
|
||||
|
||||
public Point FromPoint { |
||||
get { return fromPoint; } |
||||
set { |
||||
Point x = value; |
||||
if (!this.ClientRectangle.Contains(x)) { |
||||
this.fromPoint = new Point(x.X - this.Location.X, |
||||
x.Y - this.Location.Y); |
||||
} else { |
||||
this.fromPoint = x; |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
public Point ToPoint { |
||||
get { return toPoint; } |
||||
set { |
||||
Point x = value; |
||||
if (!this.ClientRectangle.Contains(x)) { |
||||
this.toPoint = new Point(x.X - this.Location.X, |
||||
x.Y - this.Location.Y); |
||||
} |
||||
else { |
||||
this.toPoint = x; |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("LineStyle")] |
||||
public DashStyle DashStyle { |
||||
get { return dashStyle; } |
||||
set { |
||||
dashStyle = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Thickness of Line")] |
||||
public float Thickness { |
||||
get { return thickness; } |
||||
set { |
||||
thickness = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("LineCap at Startposition")] |
||||
public LineCap StartLineCap { |
||||
get { return startLineCap; } |
||||
set { |
||||
startLineCap = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Linecap at Endposition")] |
||||
public LineCap EndLineCap { |
||||
get { return endLineCap; } |
||||
set { |
||||
endLineCap = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Dashlinecap")] |
||||
public DashCap DashLineCap { |
||||
get { return dashLineCap; } |
||||
set { |
||||
dashLineCap = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -1,127 +0,0 @@
@@ -1,127 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Drawing.Drawing2D; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseRectangleItem.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.ContainerItemDesigner))] |
||||
public class BaseRectangleItem:AbstractItem |
||||
{ |
||||
private RectangleShape shape = new RectangleShape(); |
||||
private RectangleShape backgroundShape = new RectangleShape(); |
||||
|
||||
private DashStyle dashStyle; |
||||
private float thickness; |
||||
private int cornerRadius; |
||||
|
||||
public BaseRectangleItem() |
||||
{ |
||||
this.thickness = 1; |
||||
this.dashStyle = DashStyle.Solid; |
||||
this.Size = new Size(GlobalValues.PreferedSize.Width,2* GlobalValues.PreferedSize.Height); |
||||
cornerRadius = 1; |
||||
TypeDescriptor.AddProvider(new RectangleItemTypeProvider(), typeof(BaseRectangleItem)); |
||||
} |
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
e.Graphics.SmoothingMode = SmoothingMode.HighQuality; |
||||
base.OnPaint(e); |
||||
Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
|
||||
Rectangle rect = new Rectangle(this.ClientRectangle.Left,this.ClientRectangle.Top, |
||||
this.ClientRectangle.Right -1, |
||||
this.ClientRectangle.Bottom -1); |
||||
// backgroundShape.FillShape(graphics,
|
||||
// new SolidFillPattern(this.BackColor),
|
||||
// rect);
|
||||
|
||||
Border b = new Border(new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1)); |
||||
// DrawFrame(graphics,b);
|
||||
BaseLine line = new BaseLine(base.ForeColor,DashStyle,Thickness,LineCap.Round,LineCap.Round,DashCap.Round); |
||||
using (Pen pen = line.CreatePen(line.Thickness)){ |
||||
shape.CornerRadius = this.CornerRadius; |
||||
GraphicsPath path1 = shape.CreatePath(rect); |
||||
graphics.DrawPath(pen, path1); |
||||
|
||||
} |
||||
|
||||
// shape.DrawShape (graphics,
|
||||
// this.Baseline(),
|
||||
// rect);
|
||||
|
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Linestyle")] |
||||
public DashStyle DashStyle { |
||||
get { return dashStyle; } |
||||
set { dashStyle = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Thickness of Line")] |
||||
public float Thickness { |
||||
get { return thickness; } |
||||
set { thickness = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Radius of Corners")] |
||||
public int CornerRadius |
||||
{ |
||||
get{return this.cornerRadius;} |
||||
set{this.cornerRadius = value; |
||||
this.Invalidate(); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
} |
@ -1,92 +0,0 @@
@@ -1,92 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseRowItem.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.ContainerItemDesigner))] |
||||
public class BaseRowItem:AbstractItem |
||||
{ |
||||
|
||||
private Color alternateBackColor; |
||||
private int changeBackColorEveryNRow; |
||||
private RectangleShape backgroundShape = new RectangleShape(); |
||||
|
||||
public BaseRowItem():base() |
||||
{ |
||||
Size s = new Size((GlobalValues.PreferedSize.Width * 3) + 10, |
||||
GlobalValues.PreferedSize.Height + 10); |
||||
base.DefaultSize = s; |
||||
base.Size = s; |
||||
base.BackColor = Color.White; |
||||
TypeDescriptor.AddProvider(new RowItemTypeProvider(), typeof(BaseRowItem)); |
||||
} |
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint(e); |
||||
this.Draw (e.Graphics); |
||||
} |
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
using (Brush b = new SolidBrush(this.BackColor)){ |
||||
graphics.FillRectangle(b, base.DrawingRectangle); |
||||
} |
||||
|
||||
base.DrawControl(graphics,base.DrawingRectangle); |
||||
|
||||
} |
||||
|
||||
#region Properties
|
||||
|
||||
public Color AlternateBackColor { |
||||
get { return alternateBackColor; } |
||||
set { alternateBackColor = value; } |
||||
} |
||||
|
||||
|
||||
public int ChangeBackColorEveryNRow { |
||||
get { return changeBackColorEveryNRow; } |
||||
set { changeBackColorEveryNRow = value; } |
||||
} |
||||
|
||||
public RectangleShape BackgroundShape { |
||||
get { return backgroundShape; } |
||||
set { backgroundShape = value; } |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,75 +0,0 @@
@@ -1,75 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of Section.
|
||||
/// </summary>
|
||||
///
|
||||
[TypeDescriptionProvider(typeof(SectionItemTypeProvider))] |
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.SectionDesigner))] |
||||
public class BaseSection:AbstractItem |
||||
{ |
||||
|
||||
public BaseSection():base() |
||||
{ |
||||
base.FrameColor = Color.Black; |
||||
TypeDescriptor.AddProvider(new SectionItemTypeProvider(), typeof(BaseSection)); |
||||
} |
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint(e); |
||||
Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
base.DrawControl(graphics,Rectangle.Inflate(this.ClientRectangle,-2,-2)); |
||||
} |
||||
|
||||
|
||||
#region Propertys
|
||||
|
||||
[Browsable(false)] |
||||
public int SectionOffset {get;set;} |
||||
|
||||
[Browsable(false)] |
||||
public int SectionMargin {get;set;} |
||||
|
||||
public bool PageBreakAfter {get;set;} |
||||
|
||||
public bool CanGrow {get;set;} |
||||
|
||||
public bool CanShrink {get;set;} |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
|
||||
} |
@ -1,71 +0,0 @@
@@ -1,71 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseTableItem.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.TableDesigner))] |
||||
public class BaseTableItem:AbstractItem |
||||
{ |
||||
|
||||
|
||||
public BaseTableItem():base() |
||||
{ |
||||
Size s = new Size((GlobalValues.PreferedSize.Width * 3) + 10, |
||||
GlobalValues.PreferedSize.Height * 2 + 10); |
||||
base.DefaultSize = s; |
||||
base.Size = s; |
||||
base.BackColor = Color.White; |
||||
TypeDescriptor.AddProvider(new TableItemTypeProvider(), typeof(BaseTableItem)); |
||||
} |
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint(e); |
||||
this.Draw (e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
using (Brush b = new SolidBrush(this.BackColor)){ |
||||
graphics.FillRectangle(b, base.DrawingRectangle); |
||||
} |
||||
base.DrawControl(graphics,base.DrawingRectangle); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -1,203 +0,0 @@
@@ -1,203 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Reports.Addin.Dialogs; |
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.BaseClasses.Printing; |
||||
using ICSharpCode.Reports.Core.Dialogs; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportTextItem.
|
||||
/// </summary>
|
||||
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.TextItemDesigner))] |
||||
public class BaseTextItem:AbstractItem |
||||
{ |
||||
|
||||
private string formatString; |
||||
private StringFormat stringFormat; |
||||
private StringTrimming stringTrimming; |
||||
private ContentAlignment contentAlignment; |
||||
|
||||
|
||||
public BaseTextItem():base() |
||||
{ |
||||
base.DefaultSize = GlobalValues.PreferedSize; |
||||
base.Size = GlobalValues.PreferedSize; |
||||
base.BackColor = Color.White; |
||||
this.contentAlignment = ContentAlignment.TopLeft; |
||||
TypeDescriptor.AddProvider(new TextItemTypeProvider(), typeof(BaseTextItem)); |
||||
} |
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint(e); |
||||
this.Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
|
||||
|
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
using (Brush b = new SolidBrush(this.BackColor)){ |
||||
graphics.FillRectangle(b, base.DrawingRectangle); |
||||
} |
||||
|
||||
StringTrimming designTrimmimg = StringTrimming.EllipsisCharacter; |
||||
|
||||
if (this.stringTrimming != StringTrimming.None) { |
||||
designTrimmimg = stringTrimming; |
||||
} |
||||
|
||||
StringFormat stringFormat = TextDrawer.BuildStringFormat(designTrimmimg,contentAlignment); |
||||
|
||||
if (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) { |
||||
stringFormat.FormatFlags = stringFormat.FormatFlags | StringFormatFlags.DirectionRightToLeft; |
||||
} |
||||
|
||||
|
||||
TextDrawer.DrawString(graphics,this.Text,this.Font, |
||||
new SolidBrush(this.ForeColor), |
||||
this.ClientRectangle, |
||||
stringFormat); |
||||
|
||||
base.DrawControl(graphics,base.DrawingRectangle); |
||||
} |
||||
|
||||
|
||||
|
||||
[EditorAttribute(typeof(DefaultTextEditor), |
||||
typeof(System.Drawing.Design.UITypeEditor) )] |
||||
public override string Text { |
||||
get { return base.Text; } |
||||
set { base.Text = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
#region Format and alignment
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("String to format Number's Date's etc")] |
||||
[DefaultValue("entry1")] |
||||
[TypeConverter(typeof(FormatStringConverter))] |
||||
|
||||
public string FormatString { |
||||
get { return formatString; } |
||||
set { |
||||
formatString = value; |
||||
Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(false)] |
||||
public StringFormat StringFormat { |
||||
get { return stringFormat; } |
||||
set { |
||||
stringFormat = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Appearance")] |
||||
public StringTrimming StringTrimming { |
||||
get { return stringTrimming; } |
||||
set { |
||||
stringTrimming = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
[Category("Appearance")] |
||||
[EditorAttribute(typeof(System.Drawing.Design.ContentAlignmentEditor), |
||||
typeof(System.Drawing.Design.UITypeEditor) )] |
||||
public ContentAlignment ContentAlignment { |
||||
get { return contentAlignment; } |
||||
set { |
||||
contentAlignment = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region RighToLeft
|
||||
|
||||
[Category("Appearance")] |
||||
public System.Windows.Forms.RightToLeft RTL |
||||
{ |
||||
get { return base.RightToLeft; } |
||||
set { base.RightToLeft = value; } |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region DataType
|
||||
|
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("Datatype of the underlying Column")] |
||||
[DefaultValue("System.String")] |
||||
[TypeConverter(typeof(DataTypeStringConverter))] |
||||
|
||||
public string DataType {get;set;} |
||||
|
||||
#endregion
|
||||
|
||||
#region Expression
|
||||
|
||||
[Browsable(true), |
||||
Category("Expression"), |
||||
Description("Enter a valid Expression")] |
||||
[EditorAttribute(typeof(DefaultTextEditor), |
||||
typeof(System.Drawing.Design.UITypeEditor) )] |
||||
public string Expression {get;set;} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region CanGrow/CanShrink
|
||||
|
||||
public bool CanGrow {get;set;} |
||||
|
||||
public bool CanShrink {get;set;} |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
} |
@ -1,64 +0,0 @@
@@ -1,64 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reports.Core.BaseClasses.Printing; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ErrorItem.
|
||||
/// </summary>
|
||||
public class ErrorItem:BaseTextItem |
||||
{ |
||||
public ErrorItem() |
||||
{ |
||||
} |
||||
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute()] |
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
base.OnPaint(e); |
||||
this.Draw(e.Graphics); |
||||
} |
||||
|
||||
|
||||
public override void Draw(Graphics graphics) |
||||
{ |
||||
if (graphics == null) { |
||||
throw new ArgumentNullException("graphics"); |
||||
} |
||||
|
||||
using (Brush b = new SolidBrush(this.BackColor)){ |
||||
graphics.FillRectangle(b, base.DrawingRectangle); |
||||
} |
||||
|
||||
string s = String.Format(System.Globalization.CultureInfo.CurrentCulture, |
||||
"Error : <{0}> is missing or obsolete",base.Text); |
||||
|
||||
StringFormat stringFormat = TextDrawer.BuildStringFormat(base.StringTrimming,base.ContentAlignment); |
||||
TextDrawer.DrawString(graphics,s,this.Font, |
||||
new SolidBrush(Color.Red), |
||||
this.ClientRectangle, |
||||
stringFormat); |
||||
base.DrawControl(graphics,base.DrawingRectangle); |
||||
} |
||||
} |
||||
} |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseGroupFooter.
|
||||
/// </summary>
|
||||
public class GroupFooter:GroupHeader |
||||
{ |
||||
public GroupFooter() |
||||
{ |
||||
} |
||||
} |
||||
} |
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.TypeProviders; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GroupedRow.
|
||||
/// </summary>
|
||||
[Designer(typeof(ICSharpCode.Reports.Addin.Designer.GroupedRowDesigner))] |
||||
public class GroupHeader:BaseRowItem |
||||
{ |
||||
public GroupHeader() |
||||
{ |
||||
TypeDescriptor.AddProvider(new GroupedRowTypeProvider(), typeof(GroupHeader)); |
||||
} |
||||
|
||||
|
||||
[Category("Behavior")] |
||||
public bool PageBreakOnGroupChange {get;set;} |
||||
} |
||||
|
||||
|
||||
} |
@ -1,74 +0,0 @@
@@ -1,74 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class AbstractItemTypeProvider : TypeDescriptionProvider { |
||||
public AbstractItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
public AbstractItemTypeProvider(TypeDescriptionProvider parent): base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType, instance); |
||||
return new AbstractItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
internal class AbstractItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
// private AbstractItem _instance;
|
||||
|
||||
public AbstractItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
// _instance = instance as AbstractItem;
|
||||
} |
||||
|
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
foreach (PropertyDescriptor p in props) |
||||
{ |
||||
allProperties.Add(p); |
||||
} |
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,73 +0,0 @@
@@ -1,73 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
|
||||
internal class CircleItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public CircleItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new CircleItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
internal class CircleItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
|
||||
public CircleItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
System.Collections.Generic.List<PropertyDescriptor> allProperties = new System.Collections.Generic.List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
DesignerHelper.AddGraphicProperties(allProperties,props); |
||||
PropertyDescriptor prop = null; |
||||
|
||||
prop = props.Find("Controls",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,100 +0,0 @@
@@ -1,100 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
|
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class DataItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
|
||||
public DataItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new DataItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
internal class DataItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
|
||||
public DataItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
DesignerHelper.AddTextBasedProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = props.Find("Text",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DrawBorder",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FrameColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ForeColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Visible",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ColumnName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("BaseTableName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DbValue",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("NullValue",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Expression",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,93 +0,0 @@
@@ -1,93 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class GroupedRowTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public GroupedRowTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new GroupedRowItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class GroupedRowItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
public GroupedRowItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = null; |
||||
|
||||
prop = props.Find("DrawBorder",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ForeColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Visible",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FrameColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Controls",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("AlternateBackColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ChangeBackColorEveryNRow",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("PageBreakOnGroupChange",true); |
||||
allProperties.Add(prop); |
||||
|
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,102 +0,0 @@
@@ -1,102 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
|
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class ImageItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public ImageItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new ImageItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class ImageItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
|
||||
public ImageItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
// instance = instance as BaseTextItem;
|
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = prop = props.Find("imageFileName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Image",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ScaleImageToSize",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ImageSource",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ReportFileName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("RelativeFileName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("AbsoluteFileName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ColumnName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("BaseTableName",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Name",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DataType",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,93 +0,0 @@
@@ -1,93 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class LineItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public LineItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new LineItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
internal class LineItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
|
||||
|
||||
public LineItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
|
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = null; |
||||
prop = props.Find("ForeColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FromPoint",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ToPoint",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("StartLineCap",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("EndLineCap",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("dashLineCap",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DashStyle",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Thickness",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,77 +0,0 @@
@@ -1,77 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
/// <summary>
|
||||
/// Description of RectangleItemTypeProvider.
|
||||
/// </summary>
|
||||
internal class RectangleItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public RectangleItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new RectangleItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
internal class RectangleItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
|
||||
public RectangleItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
System.Collections.Generic.List<PropertyDescriptor> allProperties = new System.Collections.Generic.List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
DesignerHelper.AddGraphicProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = null; |
||||
|
||||
prop = props.Find("CornerRadius",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Controls",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,90 +0,0 @@
@@ -1,90 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
|
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
|
||||
internal class RowItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public RowItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new RowItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class RowItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
public RowItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = null; |
||||
|
||||
prop = props.Find("DrawBorder",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ForeColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Visible",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FrameColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Controls",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("AlternateBackColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ChangeBackColorEveryNRow",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,86 +0,0 @@
@@ -1,86 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class SectionItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public SectionItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new SectionItemDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class SectionItemDescriptor : CustomTypeDescriptor |
||||
{ |
||||
|
||||
|
||||
public SectionItemDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
PropertyDescriptor prop = null; |
||||
|
||||
prop = props.Find("SectionOffset",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("SectionMargin",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DrawBorder",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("PageBreakAfter",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Controls",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FrameColor",true); |
||||
allProperties.Add(prop); |
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,88 +0,0 @@
@@ -1,88 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class TableItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public TableItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
// public TableItemTypeProvider(TypeDescriptionProvider parent): base(parent)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new TableItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class TableItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
public TableItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = null; |
||||
|
||||
prop = props.Find("DrawBorder",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ForeColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Visible",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FrameColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Controls",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,89 +0,0 @@
@@ -1,89 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel; |
||||
using ICSharpCode.Reports.Addin.Designer; |
||||
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.TypeProviders |
||||
{ |
||||
internal class TextItemTypeProvider : TypeDescriptionProvider |
||||
{ |
||||
public TextItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractItem))) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) |
||||
{ |
||||
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance); |
||||
return new TextItemTypeDescriptor(td, instance); |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class TextItemTypeDescriptor : CustomTypeDescriptor |
||||
{ |
||||
// private BaseTextItem instance;
|
||||
|
||||
public TextItemTypeDescriptor(ICustomTypeDescriptor parent, object instance) |
||||
: base(parent) |
||||
{ |
||||
// instance = instance as BaseTextItem;
|
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties() |
||||
{ |
||||
return GetProperties(null); |
||||
} |
||||
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes) |
||||
{ |
||||
PropertyDescriptorCollection props = base.GetProperties(attributes); |
||||
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>(); |
||||
|
||||
DesignerHelper.AddDefaultProperties(allProperties,props); |
||||
|
||||
DesignerHelper.AddTextBasedProperties(allProperties,props); |
||||
|
||||
PropertyDescriptor prop = prop = props.Find("Text",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("DrawBorder",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("FrameColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("ForeColor",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Visible",true); |
||||
allProperties.Add(prop); |
||||
|
||||
prop = props.Find("Expression",true); |
||||
allProperties.Add(prop); |
||||
|
||||
return new PropertyDescriptorCollection(allProperties.ToArray()); |
||||
} |
||||
} |
||||
} |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Reports.Core; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseManager.
|
||||
/// </summary>
|
||||
public class BaseManager:ReportEngine |
||||
{ |
||||
|
||||
public BaseManager():base() |
||||
{ |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,89 +0,0 @@
@@ -1,89 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin |
||||
{ |
||||
internal class StandartPreviewManager:BaseManager |
||||
{ |
||||
|
||||
#region Constructor
|
||||
|
||||
public StandartPreviewManager () :base() |
||||
{ |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public AbstractRenderer CreateRenderer (ReportModel model) |
||||
{ |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
AbstractRenderer abstractRenderer = null; |
||||
switch (model.DataModel) { |
||||
case GlobalEnums.PushPullModel.FormSheet : { |
||||
abstractRenderer = StandartReportRenderer(model); |
||||
break; |
||||
} |
||||
case GlobalEnums.PushPullModel.PullData:{ |
||||
abstractRenderer = StandartReportRenderer(model); |
||||
break; |
||||
} |
||||
case GlobalEnums.PushPullModel.PushData:{ |
||||
abstractRenderer = PushDataRenderer(model); |
||||
break; |
||||
} |
||||
} |
||||
return abstractRenderer; |
||||
} |
||||
|
||||
|
||||
#region PushDataModel
|
||||
|
||||
private AbstractRenderer PushDataRenderer(ReportModel model) |
||||
{ |
||||
ICSharpCode.Reports.Addin.Commands.DataSetFromXsdCommand cmd = |
||||
new ICSharpCode.Reports.Addin.Commands.DataSetFromXsdCommand(); |
||||
cmd.Run(); |
||||
DataSet ds = cmd.DataSet; |
||||
if ( ds != null) { |
||||
return base.SetupPushDataRenderer(model,ds.Tables[0]); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region PullDataModel
|
||||
|
||||
private AbstractRenderer StandartReportRenderer(ReportModel model) |
||||
{ |
||||
ICSharpCode.Reports.Addin.Commands.CollectParametersCommand cmd = new ICSharpCode.Reports.Addin.Commands.CollectParametersCommand(model.ReportSettings); |
||||
cmd.Run(); |
||||
return base.SetupStandardRenderer (model,null); |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,219 +0,0 @@
@@ -1,219 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.IO; |
||||
using System.Xml; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
/// <summary>
|
||||
/// Abstract Class for all ReportGenerators
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.09.2005 14:21:07
|
||||
/// </remarks>
|
||||
///
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
public interface IReportGenerator{ |
||||
void GenerateReport (); |
||||
XmlDocument XmlReport {get;} |
||||
MemoryStream Generated {get;} |
||||
ReportStructure ReportStructure {get;} |
||||
} |
||||
|
||||
|
||||
public abstract class AbstractReportGenerator : IReportGenerator |
||||
{ |
||||
private StringWriter stringWriter; |
||||
private ReportItemCollection reportItemCollection; |
||||
private AvailableFieldsCollection availableFieldsCollection; |
||||
private ParameterCollection parameterCollection; |
||||
private ColumnCollection groupColumnCollection; |
||||
|
||||
protected AbstractReportGenerator(ReportModel reportModel,ReportStructure reportStructure) |
||||
{ |
||||
if (reportModel == null) { |
||||
throw new ArgumentNullException("reportModel"); |
||||
} |
||||
if (reportStructure == null) { |
||||
throw new ArgumentNullException("reportStructure"); |
||||
} |
||||
this.ReportModel = reportModel; |
||||
ReportStructure = reportStructure; |
||||
this.AvailableFieldsCollection.Clear(); |
||||
this.ReportItemCollection.Clear(); |
||||
this.GroupColumnCollection.Clear(); |
||||
this.ParameterCollection.Clear(); |
||||
} |
||||
|
||||
|
||||
protected void UpdateGenerator () |
||||
{ |
||||
this.AvailableFieldsCollection.AddRange(ReportStructure.AvailableFieldsCollection); |
||||
this.ReportItemCollection.AddRange(ReportStructure.ReportItemCollection); |
||||
|
||||
if (ReportModel.ReportSettings.GroupColumnsCollection.Count > 0) { |
||||
this.GroupColumnCollection.AddRange(ReportModel.ReportSettings.GroupColumnsCollection); |
||||
} |
||||
if (ReportStructure.SqlQueryParameters.Count > 0) { |
||||
ReportModel.ReportSettings.SqlParameters.AddRange(ReportStructure.SqlQueryParameters); |
||||
} |
||||
} |
||||
|
||||
protected void UpdateModel () |
||||
{ |
||||
var settings = this.ReportModel.ReportSettings; |
||||
settings.AvailableFieldsCollection.Clear(); |
||||
settings.AvailableFieldsCollection.AddRange(this.availableFieldsCollection); |
||||
|
||||
settings.GroupColumnsCollection.Clear(); |
||||
settings.GroupColumnsCollection.AddRange(this.groupColumnCollection); |
||||
} |
||||
|
||||
|
||||
private void AdjustSectionToDefault () { |
||||
|
||||
ReportSettings settings = ReportModel.ReportSettings; |
||||
foreach (ICSharpCode.Reports.Core.BaseSection s in ReportModel.SectionCollection) { |
||||
s.Size = new Size(settings.PageSize.Width - settings.LeftMargin - settings.RightMargin, |
||||
GlobalValues.DefaultSectionHeight); |
||||
Console.WriteLine("Adjust Section To DefaultSize : {0}",s.Size); |
||||
} |
||||
} |
||||
|
||||
|
||||
protected void WriteToXml () |
||||
{ |
||||
|
||||
LoggingService.Debug("AbstractReportGenerator - Generate Xml from RepotModel"); |
||||
|
||||
ReportDesignerWriter rpd = new ReportDesignerWriter(); |
||||
StringWriterWithEncoding writer = new StringWriterWithEncoding(System.Text.Encoding.UTF8); |
||||
XmlTextWriter xml =XmlHelper.CreatePropperWriter(writer); |
||||
XmlHelper.CreatePropperDocument(xml); |
||||
|
||||
rpd.Save(this.ReportModel.ReportSettings,xml); |
||||
xml.WriteEndElement(); |
||||
xml.WriteStartElement("SectionCollection"); |
||||
|
||||
foreach (ICSharpCode.Reports.Core.BaseSection s in this.ReportModel.SectionCollection) { |
||||
rpd.Save(s,xml); |
||||
} |
||||
|
||||
xml.WriteEndElement(); |
||||
xml.WriteEndElement(); |
||||
xml.WriteEndDocument(); |
||||
stringWriter = writer; |
||||
xml.Flush(); |
||||
stringWriter = writer; |
||||
} |
||||
|
||||
#region ReportGenerator.IReportGenerator interface implementation
|
||||
|
||||
public virtual void GenerateReport() |
||||
{ |
||||
this.AdjustSectionToDefault(); |
||||
} |
||||
|
||||
|
||||
public XmlDocument XmlReport |
||||
{ |
||||
get { |
||||
System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); |
||||
doc.LoadXml(this.stringWriter.ToString()); |
||||
return doc; |
||||
} |
||||
} |
||||
|
||||
|
||||
public MemoryStream Generated |
||||
{ |
||||
get { |
||||
System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); |
||||
doc.LoadXml(this.stringWriter.ToString()); |
||||
using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) { |
||||
doc.Save(stream); |
||||
return stream; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public ReportStructure ReportStructure {get;private set;} |
||||
|
||||
public ReportModel ReportModel {get;private set;} |
||||
|
||||
|
||||
protected ReportItemCollection ReportItemCollection { |
||||
get { if (this.reportItemCollection == null) { |
||||
this.reportItemCollection = new ReportItemCollection(); |
||||
} |
||||
return this.reportItemCollection; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public AvailableFieldsCollection AvailableFieldsCollection { |
||||
get { |
||||
if (this.availableFieldsCollection == null) { |
||||
this.availableFieldsCollection = new AvailableFieldsCollection(); |
||||
} |
||||
return this.availableFieldsCollection; |
||||
} |
||||
} |
||||
|
||||
|
||||
public ParameterCollection SqlQueryParameters { |
||||
get { |
||||
if (this.parameterCollection == null) { |
||||
this.parameterCollection = new ParameterCollection(); |
||||
} |
||||
return this.parameterCollection; |
||||
} |
||||
} |
||||
|
||||
public ColumnCollection GroupColumnCollection { |
||||
get{ |
||||
if (this.groupColumnCollection == null) { |
||||
this.groupColumnCollection = new ColumnCollection(); |
||||
} |
||||
return this.groupColumnCollection; |
||||
} |
||||
set { this.groupColumnCollection = value;} |
||||
} |
||||
|
||||
public ParameterCollection ParameterCollection { |
||||
get { |
||||
if (this.parameterCollection == null) { |
||||
this.parameterCollection = new ParameterCollection(); |
||||
} |
||||
return this.parameterCollection; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,54 +0,0 @@
@@ -1,54 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// This class generates a plain Formsheet
|
||||
/// </summary>
|
||||
public class GenerateFormSheetReport:GeneratePlainReport |
||||
{ |
||||
public GenerateFormSheetReport(ReportModel reportModel,ReportStructure reportStructure ):base(reportModel,reportStructure) |
||||
{ |
||||
|
||||
if (reportModel == null) { |
||||
throw new ArgumentNullException("reportModel"); |
||||
} |
||||
|
||||
if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModel.FormSheet) { |
||||
throw new InvalidReportModelException(); |
||||
} |
||||
} |
||||
|
||||
|
||||
public override void GenerateReport() { |
||||
base.GenerateReport(); |
||||
ListLayout layout = new ListLayout(base.ReportModel,null); |
||||
layout.CreateReportHeader(); |
||||
layout.CreatePageFooter(); |
||||
base.WriteToXml(); |
||||
} |
||||
} |
||||
} |
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GeneratePlainReport.
|
||||
/// </summary>
|
||||
public class GeneratePlainReport:AbstractReportGenerator |
||||
{ |
||||
|
||||
public GeneratePlainReport(ReportModel reportModel,ReportStructure reportStructure):base(reportModel,reportStructure) |
||||
{} |
||||
|
||||
|
||||
public override void GenerateReport() |
||||
{ |
||||
base.GenerateReport(); |
||||
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.FormSheet; |
||||
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModel.FormSheet; |
||||
base.ReportModel.ReportSettings.CommandType = System.Data.CommandType.Text; |
||||
base.WriteToXml(); |
||||
} |
||||
} |
||||
} |
@ -1,59 +0,0 @@
@@ -1,59 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GeneratePullDataReport.
|
||||
/// </summary>
|
||||
internal class GeneratePullDataReport: AbstractReportGenerator |
||||
{ |
||||
|
||||
public GeneratePullDataReport(ReportModel reportModel,ReportStructure reportStructure):base(reportModel,reportStructure) |
||||
{ |
||||
if (reportModel == null) { |
||||
throw new ArgumentNullException("reportModel"); |
||||
} |
||||
base.UpdateGenerator(); |
||||
base.UpdateModel(); |
||||
base.SqlQueryParameters.AddRange(base.ReportStructure.SqlQueryParameters); |
||||
} |
||||
|
||||
|
||||
|
||||
public override void GenerateReport() |
||||
{ |
||||
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.DataReport; |
||||
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModel.PullData; |
||||
base.GenerateReport(); |
||||
GlobalEnums.ReportLayout reportLayout = ReportStructure.ReportLayout; |
||||
AbstractLayout layout = LayoutFactory.CreateGenerator(reportLayout,base.ReportModel,base.ReportItemCollection); |
||||
layout.CreateReportHeader(); |
||||
layout.CreatePageHeader(); |
||||
layout.CreateDataSection(base.ReportModel.DetailSection); |
||||
layout.CreatePageFooter(); |
||||
base.WriteToXml(); |
||||
} |
||||
} |
||||
} |
@ -1,64 +0,0 @@
@@ -1,64 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
/// <summary>
|
||||
/// This class is used to generate PushDataReports
|
||||
/// (Reports, that are feed with an DataSet etc)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 08.09.2005 10:10:19
|
||||
/// </remarks>
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
public class GeneratePushDataReport : AbstractReportGenerator |
||||
{ |
||||
|
||||
/// <summary>
|
||||
/// Default constructor - initializes all fields to default values
|
||||
/// </summary>
|
||||
public GeneratePushDataReport(ReportModel reportModel,ReportStructure reportStructure):base(reportModel,reportStructure){ |
||||
base.UpdateGenerator(); |
||||
base.UpdateModel(); |
||||
} |
||||
|
||||
|
||||
public override void GenerateReport() |
||||
{ |
||||
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.DataReport; |
||||
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModel.PushData; |
||||
base.GenerateReport(); |
||||
|
||||
GlobalEnums.ReportLayout reportLayout = ReportStructure.ReportLayout; |
||||
var layout = LayoutFactory.CreateGenerator(reportLayout,base.ReportModel,base.ReportItemCollection); |
||||
|
||||
layout.CreateReportHeader(); |
||||
layout.CreatePageHeader(); |
||||
layout.CreateDataSection(base.ReportModel.DetailSection); |
||||
layout.CreatePageFooter(); |
||||
base.WriteToXml(); |
||||
} |
||||
} |
||||
} |
@ -1,71 +0,0 @@
@@ -1,71 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GeneratorFactory.
|
||||
/// </summary>
|
||||
public static class LayoutFactory |
||||
{ |
||||
|
||||
public static AbstractLayout CreateGenerator (GlobalEnums.ReportLayout reportLayout, |
||||
ReportModel model, |
||||
ReportItemCollection items) |
||||
{ |
||||
AbstractLayout layout = null; |
||||
switch (reportLayout) { |
||||
case GlobalEnums.ReportLayout.ListLayout: |
||||
layout = new ListLayout(model,items); |
||||
break; |
||||
case GlobalEnums.ReportLayout.TableLayout: |
||||
layout = new TableLayout(model,items); |
||||
break; |
||||
} |
||||
return layout; |
||||
} |
||||
} |
||||
|
||||
public static class GeneratorFactory |
||||
{ |
||||
|
||||
public static IReportGenerator Create (ReportModel model,ReportStructure reportStructure) |
||||
|
||||
{ |
||||
IReportGenerator reportGenerator = null; |
||||
switch (model.DataModel) { |
||||
case GlobalEnums.PushPullModel.PullData: |
||||
reportGenerator = new GeneratePullDataReport(model,reportStructure); |
||||
break; |
||||
case GlobalEnums.PushPullModel.PushData: |
||||
reportGenerator = new GeneratePushDataReport(model,reportStructure); |
||||
break; |
||||
case GlobalEnums.PushPullModel.FormSheet: |
||||
reportGenerator = new GenerateFormSheetReport (model,reportStructure); |
||||
break; |
||||
} |
||||
return reportGenerator; |
||||
} |
||||
} |
||||
} |
@ -1,147 +0,0 @@
@@ -1,147 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Reports.Core; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of WizardHelper.
|
||||
/// </summary>
|
||||
internal sealed class WizardHelper |
||||
{ |
||||
private WizardHelper() |
||||
{ |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Build a <see cref="ColumnCollection"></see> this collection holds all the fields
|
||||
/// comming from the DataSource
|
||||
///</summary>
|
||||
|
||||
internal static AvailableFieldsCollection AvailableFieldsCollection(DataSet dataSet) |
||||
{ |
||||
if (dataSet == null) { |
||||
throw new ArgumentNullException("dataSet"); |
||||
} |
||||
|
||||
AvailableFieldsCollection collection = new AvailableFieldsCollection(); |
||||
foreach (DataTable dataTable in dataSet.Tables) { |
||||
foreach (DataColumn col in dataTable.Columns) { |
||||
collection.Add (new AbstractColumn(col.ColumnName,col.DataType)); |
||||
} |
||||
} |
||||
return collection; |
||||
} |
||||
|
||||
|
||||
internal static ReportItemCollection CreateItemsCollection (DataSet resultDataSet,DataGridViewColumn[] displayCols) |
||||
{ |
||||
ReportItemCollection sourceItems = WizardHelper.ReportItemCollection(resultDataSet); |
||||
ReportItemCollection destItems = WizardHelper.ExtractSelectedItems(sourceItems, displayCols); |
||||
return destItems; |
||||
} |
||||
|
||||
|
||||
internal static void SetupGridView(DataGridView grdQuery) |
||||
{ |
||||
foreach (DataGridViewColumn dd in grdQuery.Columns) |
||||
{ |
||||
DataGridViewColumnHeaderCheckBoxCell cb = new DataGridViewColumnHeaderCheckBoxCell(); |
||||
cb.CheckBoxAlignment = HorizontalAlignment.Left; |
||||
cb.Checked = true; |
||||
dd.HeaderCell = cb; |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
internal static ReportItemCollection ExtractSelectedItems(ReportItemCollection sourceItems,DataGridViewColumn[] displayCols) |
||||
{ |
||||
var destItems = new ReportItemCollection(); |
||||
foreach (DataGridViewColumn cc in displayCols) { |
||||
DataGridViewColumnHeaderCheckBoxCell hc = (DataGridViewColumnHeaderCheckBoxCell)cc.HeaderCell; |
||||
if (hc.Checked) { |
||||
BaseReportItem br = (BaseReportItem)sourceItems.Find(cc.HeaderText); |
||||
destItems.Add(br); |
||||
} |
||||
} |
||||
return destItems; |
||||
} |
||||
|
||||
|
||||
internal static ReportItemCollection ReportItemCollection (DataSet dataSet) |
||||
{ |
||||
if (dataSet == null) { |
||||
throw new ArgumentNullException("dataSet"); |
||||
} |
||||
|
||||
if (dataSet.Tables.Count > 1) { |
||||
string s = String.Format(System.Globalization.CultureInfo.InvariantCulture, |
||||
"AutoBuildFromDataSet : at this time no more than one table is allowed <{0}>",dataSet.Tables.Count); |
||||
ICSharpCode.Core.MessageService.ShowError(s); |
||||
} |
||||
|
||||
ReportItemCollection destItems = new ReportItemCollection(); |
||||
|
||||
foreach (DataTable tbl in dataSet.Tables) { |
||||
foreach (DataColumn col in tbl.Columns) |
||||
{ |
||||
if (col.DataType == typeof(System.Byte[])) |
||||
{ |
||||
ICSharpCode.Reports.Core.BaseImageItem rItem = new ICSharpCode.Reports.Core.BaseImageItem(); |
||||
InitializeItem(rItem,col); |
||||
rItem.ColumnName = col.ColumnName; |
||||
rItem.ScaleImageToSize = false; |
||||
destItems.Add (rItem); |
||||
} else |
||||
{ |
||||
ICSharpCode.Reports.Core.BaseDataItem rItem = new ICSharpCode.Reports.Core.BaseDataItem(); |
||||
InitializeItem(rItem,col); |
||||
rItem.DBValue = col.ColumnName; |
||||
rItem.Text = "=[" + col.ColumnName + "]"; |
||||
destItems.Add (rItem); |
||||
} |
||||
} |
||||
} |
||||
return destItems; |
||||
} |
||||
|
||||
|
||||
static void InitializeItem (IDataItem rItem, DataColumn col) |
||||
{ |
||||
rItem.ColumnName = col.ColumnName; |
||||
rItem.Name = col.ColumnName; |
||||
rItem.BaseTableName = col.Table.TableName; |
||||
rItem.DataType = col.DataType.ToString(); |
||||
} |
||||
|
||||
|
||||
|
||||
internal static ICSharpCode.Reports.Core.BaseTextItem CreateTextItem (string text) |
||||
{ |
||||
ICSharpCode.Reports.Core.BaseTextItem textItem = new ICSharpCode.Reports.Core.BaseTextItem(); |
||||
textItem.Text = text; |
||||
return textItem; |
||||
} |
||||
} |
||||
} |
@ -1,225 +0,0 @@
@@ -1,225 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.Reports.Core.Interfaces; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
|
||||
/// <summary>
|
||||
/// Description of AbstractLayout.
|
||||
/// </summary>
|
||||
public class AbstractLayout |
||||
{ |
||||
|
||||
public AbstractLayout(ReportModel reportModel) |
||||
{ |
||||
if (reportModel == null) { |
||||
throw new ArgumentNullException("reportModel"); |
||||
} |
||||
this.ReportModel = reportModel; |
||||
} |
||||
|
||||
|
||||
public virtual void CreateReportHeader () |
||||
{ |
||||
string header = this.ReportModel.ReportSettings.ReportName; |
||||
var textItem = WizardHelper.CreateTextItem(header); |
||||
textItem.Name = header; |
||||
this.FixLayout(this.ReportModel.ReportHeader,textItem,GlobalEnums.ItemsLayout.Center); |
||||
this.ReportModel.ReportHeader.Items.Add(textItem); |
||||
} |
||||
|
||||
|
||||
public virtual void CreatePageHeader () |
||||
{ |
||||
} |
||||
|
||||
public virtual void CreateDataSection (ICSharpCode.Reports.Core.BaseSection section) |
||||
{ |
||||
} |
||||
|
||||
|
||||
public virtual void CreatePageFooter () |
||||
{ |
||||
var textItem = WizardHelper.CreateTextItem("=Globals!PageNumber"); |
||||
textItem.Name = "PageNumber1"; |
||||
this.FixLayout(this.ReportModel.PageFooter,textItem,GlobalEnums.ItemsLayout.Right); |
||||
this.ReportModel.PageFooter.Items.Add(textItem); |
||||
} |
||||
|
||||
|
||||
private void FixLayout (ICSharpCode.Reports.Core.BaseSection section, |
||||
BaseReportItem item,GlobalEnums.ItemsLayout layout) |
||||
{ |
||||
item.Size = new Size (GlobalValues.PreferedSize.Width,GlobalValues.PreferedSize.Height); |
||||
Point p =Point.Empty; |
||||
|
||||
switch (layout) { |
||||
case GlobalEnums.ItemsLayout.Left: |
||||
p = new Point (this.ReportModel.ReportSettings.LeftMargin, |
||||
GlobalValues.ControlMargins.Top); |
||||
break; |
||||
case GlobalEnums.ItemsLayout.Center: |
||||
p = new Point((section.Size.Width / 2) - (item.Size.Width /2), |
||||
GlobalValues.ControlMargins.Top); |
||||
break; |
||||
case GlobalEnums.ItemsLayout.Right: |
||||
p = new Point(section.Size.Width - item.Size.Width - GlobalValues.ControlMargins.Right, |
||||
GlobalValues.ControlMargins.Top); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
item.Location = p; |
||||
} |
||||
|
||||
|
||||
protected static void AdjustContainer (ISimpleContainer parent, |
||||
ICSharpCode.Reports.Core.BaseReportItem item) |
||||
{ |
||||
item.Size = new Size (parent.Size.Width - GlobalValues.ControlMargins.Left - GlobalValues.ControlMargins.Right, |
||||
parent.Size.Height - GlobalValues.ControlMargins.Top - GlobalValues.ControlMargins.Bottom); |
||||
|
||||
item.Location = new Point(GlobalValues.ControlMargins.Left, |
||||
GlobalValues.ControlMargins.Top); |
||||
item.Parent = parent as BaseReportItem; |
||||
} |
||||
|
||||
|
||||
#region HeaderColumns
|
||||
|
||||
protected ICSharpCode.Reports.Core.BaseRowItem CreateRowWithTextColumns(ISimpleContainer parent) |
||||
{ |
||||
ReportItemCollection colDetail = AbstractLayout.HeaderColumnsFromReportItems(ReportItems); |
||||
|
||||
ICSharpCode.Reports.Core.BaseRowItem row = new ICSharpCode.Reports.Core.BaseRowItem(); |
||||
AdjustContainer(parent,row); |
||||
|
||||
int defY = GlobalValues.ControlMargins.Top; |
||||
int ctrlWidth = CalculateControlWidth(row,colDetail); |
||||
int startX = parent.Location.X + GlobalValues.ControlMargins.Left; |
||||
|
||||
foreach (ICSharpCode.Reports.Core.BaseTextItem ir in colDetail) { |
||||
Point np = new Point(startX,defY); |
||||
startX += ctrlWidth; |
||||
ir.Location = np; |
||||
ir.Parent = row; |
||||
row.Items.Add(ir); |
||||
} |
||||
return row; |
||||
} |
||||
|
||||
|
||||
|
||||
private static ReportItemCollection HeaderColumnsFromReportItems(ReportItemCollection reportItemCollection) |
||||
{ |
||||
if (reportItemCollection == null) { |
||||
throw new ArgumentNullException ("reportItemCollection"); |
||||
} |
||||
|
||||
ReportItemCollection itemCol = new ReportItemCollection(); |
||||
ICSharpCode.Reports.Core.BaseTextItem rItem; |
||||
int i = 1; |
||||
foreach (IDataItem dataRenderer in reportItemCollection) { |
||||
// foreach (IDataRenderer dataRenderer in reportItemCollection) {
|
||||
rItem = WizardHelper.CreateTextItem(dataRenderer.ColumnName); |
||||
rItem.Name = rItem.Text + i.ToString(System.Globalization.CultureInfo.InvariantCulture); |
||||
itemCol.Add(rItem); |
||||
i ++; |
||||
} |
||||
return itemCol; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
protected ReportItemCollection CreateItemsCollection () |
||||
{ |
||||
int locationX = GlobalValues.ControlMargins.Left; |
||||
|
||||
var minCtrlWidth = CalculateControlWidth(Container,ReportItems); |
||||
|
||||
var col = new ReportItemCollection(); |
||||
|
||||
foreach (var ir in ReportItems) { |
||||
ir.Location = new Point(locationX,GlobalValues.ControlMargins.Top); |
||||
col.Add(ir); |
||||
locationX += minCtrlWidth; |
||||
} |
||||
return col; |
||||
} |
||||
|
||||
|
||||
protected static int CalculateControlWidth(ISimpleContainer row, ReportItemCollection colDetail) |
||||
{ |
||||
return row.Size.Width / colDetail.Count; |
||||
} |
||||
|
||||
|
||||
#region Grouping
|
||||
|
||||
protected ICSharpCode.Reports.Core.GroupHeader CreateGroupHeader(Point headerLocation) |
||||
{ |
||||
ICSharpCode.Reports.Core.BaseDataItem dataItem = new ICSharpCode.Reports.Core.BaseDataItem(); |
||||
|
||||
dataItem.ColumnName = ReportModel.ReportSettings.GroupColumnsCollection[0].ColumnName; |
||||
|
||||
dataItem.DataType = ReportModel.ReportSettings.GroupColumnsCollection[0].DataTypeName; |
||||
dataItem.Location = new Point (GlobalValues.ControlMargins.Left,GlobalValues.ControlMargins.Top); |
||||
dataItem.Size = new Size (150,20); |
||||
dataItem.Text = ReportModel.ReportSettings.GroupColumnsCollection[0].ColumnName; |
||||
|
||||
ICSharpCode.Reports.Core.GroupHeader groupHeader = new ICSharpCode.Reports.Core.GroupHeader(); |
||||
groupHeader.Location = headerLocation; |
||||
groupHeader.Size = new Size (300,dataItem.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom); |
||||
groupHeader.Items.Add(dataItem); |
||||
return groupHeader; |
||||
} |
||||
|
||||
|
||||
protected ICSharpCode.Reports.Core.GroupFooter CreateFooter (Point footerLocation) |
||||
{ |
||||
ICSharpCode.Reports.Core.GroupFooter groupFooter = new ICSharpCode.Reports.Core.GroupFooter(); |
||||
groupFooter.Location = footerLocation; |
||||
groupFooter.Size = new Size (300,30); |
||||
return groupFooter; |
||||
} |
||||
|
||||
|
||||
protected void ConfigureDetails (Point detailLocation,Size detailSize) |
||||
{ |
||||
Container.Location = detailLocation; |
||||
Container.Size = detailSize; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
protected ReportModel ReportModel {get; private set;} |
||||
|
||||
|
||||
protected ISimpleContainer Container {get;set;} |
||||
|
||||
protected ReportItemCollection ReportItems {get;set;} |
||||
|
||||
} |
||||
} |
@ -1,102 +0,0 @@
@@ -1,102 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
/// <summary>
|
||||
/// This class build a TableLayout
|
||||
/// </summary>
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
|
||||
public class ListLayout : AbstractLayout |
||||
{ |
||||
|
||||
public ListLayout(ReportModel reportModel,ReportItemCollection reportItemCollection):base(reportModel) |
||||
{ |
||||
base.ReportItems = reportItemCollection; |
||||
ICSharpCode.Reports.Core.BaseRowItem row = new ICSharpCode.Reports.Core.BaseRowItem(); |
||||
AdjustContainer(base.ReportModel.DetailSection,row); |
||||
base.Container = row; |
||||
} |
||||
|
||||
|
||||
#region overrides
|
||||
|
||||
|
||||
public override void CreatePageHeader() |
||||
{ |
||||
base.CreatePageHeader(); |
||||
ICSharpCode.Reports.Core.BaseRowItem row = CreateRowWithTextColumns(base.ReportModel.PageHeader); |
||||
|
||||
AdjustContainer(Container,row); |
||||
base.ReportModel.PageHeader.Items.Add(row); |
||||
} |
||||
|
||||
|
||||
public override void CreateDataSection (ICSharpCode.Reports.Core.BaseSection section) |
||||
{ |
||||
if (section == null) { |
||||
throw new ArgumentNullException("section"); |
||||
} |
||||
Size detailSize = Size.Empty; |
||||
Size itemSize = Size.Empty; |
||||
Point rowLoction = Point.Empty; |
||||
if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0) |
||||
{ |
||||
|
||||
var groupheader = base.CreateGroupHeader(new Point (GlobalValues.ControlMargins.Left,GlobalValues.ControlMargins.Top)); |
||||
base.ReportModel.DetailSection.Items.Add(groupheader); |
||||
|
||||
// Detail
|
||||
itemSize = CreateDetail(); |
||||
detailSize = new Size(Container.Size.Width,itemSize.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom); |
||||
|
||||
|
||||
// GroupFooter
|
||||
var groupFooter = base.CreateFooter(new Point(GlobalValues.ControlMargins.Left,80)); |
||||
base.ReportModel.DetailSection.Items.Add(groupFooter); |
||||
section.Size = new Size(section.Size.Width,125); |
||||
rowLoction = new Point (Container.Location.X,45); |
||||
} |
||||
else |
||||
{ |
||||
itemSize = CreateDetail(); |
||||
detailSize = new Size(Container.Size.Width,itemSize.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom); |
||||
section.Size = new Size(section.Size.Width,Container.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom); |
||||
rowLoction = new Point(Container.Location.X,GlobalValues.ControlMargins.Top); |
||||
} |
||||
base.ConfigureDetails (rowLoction,detailSize); |
||||
section.Items.Add(Container as BaseReportItem); |
||||
} |
||||
|
||||
|
||||
Size CreateDetail() |
||||
{ |
||||
var items = base.CreateItemsCollection(); |
||||
Container.Items.AddRange(items); |
||||
return items[0].Size; |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,128 +0,0 @@
@@ -1,128 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.Reports.Core.Interfaces; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of TableLayout.
|
||||
/// </summary>
|
||||
|
||||
public class TableLayout: AbstractLayout |
||||
{ |
||||
|
||||
public TableLayout(ReportModel reportModel,ReportItemCollection reportItemCollection):base(reportModel) |
||||
{ |
||||
ReportItems = reportItemCollection; |
||||
} |
||||
|
||||
|
||||
public override void CreatePageHeader() |
||||
{ |
||||
base.CreatePageHeader(); |
||||
base.ReportModel.PageHeader.Size = new Size(base.ReportModel.PageHeader.Size.Width,10); |
||||
base.ReportModel.PageHeader.BackColor = Color.LightGray; |
||||
} |
||||
|
||||
|
||||
public override void CreateDataSection(ICSharpCode.Reports.Core.BaseSection section) |
||||
{ |
||||
if (section == null) { |
||||
throw new ArgumentNullException("section"); |
||||
} |
||||
System.Drawing.Printing.Margins margin = GlobalValues.ControlMargins; |
||||
|
||||
ICSharpCode.Reports.Core.BaseTableItem table = new ICSharpCode.Reports.Core.BaseTableItem(); |
||||
ICSharpCode.Reports.Core.BaseRowItem detailRow = new ICSharpCode.Reports.Core.BaseRowItem(); |
||||
|
||||
table.Name = "Table1"; |
||||
base.Container = table; |
||||
AdjustContainer(base.ReportModel.DetailSection,table); |
||||
base.ReportModel.DetailSection.Items.Add(table); |
||||
|
||||
ICSharpCode.Reports.Core.BaseRowItem headerRow = CreateRowWithTextColumns(Container); |
||||
Container.Items.Add (headerRow); |
||||
|
||||
Point insertLocation = new Point (margin.Left,headerRow.Location.Y + headerRow.Size.Height + margin.Bottom + margin.Top); |
||||
|
||||
|
||||
if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0) { |
||||
|
||||
//Groupheader
|
||||
var groupHeader = base.CreateGroupHeader(insertLocation); |
||||
Container.Items.Add(groupHeader); |
||||
insertLocation = new Point(margin.Left,insertLocation.Y + groupHeader.Size.Height + margin.Bottom + margin.Top); |
||||
|
||||
//Detail
|
||||
CreateDetail(detailRow,insertLocation); |
||||
Container.Items.Add (detailRow); |
||||
|
||||
// GroupFooter
|
||||
var groupFooter = base.CreateFooter(new Point(margin.Left,130)); |
||||
Container.Items.Add(groupFooter); |
||||
|
||||
} |
||||
else |
||||
{ |
||||
CreateDetail(detailRow,insertLocation); |
||||
Container.Items.Add (detailRow); |
||||
} |
||||
|
||||
CalculateContainerSize(); |
||||
section.Size = new Size (section.Size.Width,Container.Size.Height + margin.Top + margin.Bottom); |
||||
} |
||||
|
||||
|
||||
void CreateDetail (ICSharpCode.Reports.Core.BaseRowItem detailRow,Point insertLocation) |
||||
{ |
||||
AdjustContainer (Container,detailRow); |
||||
detailRow.Location = insertLocation; |
||||
detailRow.Size = new Size(detailRow.Size.Width,30); |
||||
int defX = AbstractLayout.CalculateControlWidth(detailRow,ReportItems); |
||||
|
||||
int startX = GlobalValues.ControlMargins.Left; |
||||
|
||||
foreach (ICSharpCode.Reports.Core.BaseReportItem ir in ReportItems) |
||||
{ |
||||
Point np = new Point(startX,GlobalValues.ControlMargins.Top); |
||||
startX += defX; |
||||
ir.Location = np; |
||||
ir.Parent = detailRow; |
||||
detailRow.Items.Add(ir); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void CalculateContainerSize() |
||||
{ |
||||
int h = GlobalValues.ControlMargins.Top; |
||||
|
||||
foreach (ICSharpCode.Reports.Core.BaseReportItem item in Container.Items) |
||||
{ |
||||
h = h + item.Size.Height + GlobalValues.ControlMargins.Bottom; |
||||
} |
||||
h = h + 3*GlobalValues.ControlMargins.Bottom; |
||||
Container.Size = new Size (Container.Size.Width,h); |
||||
} |
||||
} |
||||
} |
@ -1,189 +0,0 @@
@@ -1,189 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Data.Core.Interfaces; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
/// <summary>
|
||||
/// This class creates settings for a report
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 28.01.2005 10:31:01
|
||||
/// </remarks>
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
public class ReportStructure : IDisposable |
||||
{ |
||||
|
||||
private ReportItemCollection reportItemCollection; |
||||
private AvailableFieldsCollection availableFieldsCollection; |
||||
|
||||
|
||||
public ReportStructure() |
||||
{ |
||||
SqlQueryParameters = new SqlParameterCollection(); |
||||
} |
||||
|
||||
public ReportModel CreateAndFillReportModel () |
||||
{ |
||||
ReportModel model = ReportModel.Create(); |
||||
|
||||
model.ReportSettings.ReportName = this.ReportName; |
||||
model.ReportSettings.FileName = this.Path + this.FileName; |
||||
|
||||
model.ReportSettings.GraphicsUnit = this.GraphicsUnit; |
||||
model.ReportSettings.ReportType = this.ReportType; |
||||
|
||||
model.ReportSettings.ConnectionString = this.ConnectionString; |
||||
model.ReportSettings.CommandText = this.SqlString; |
||||
model.ReportSettings.CommandType = this.CommandType; |
||||
model.ReportSettings.DataModel = this.DataModel; |
||||
|
||||
model.ReportSettings.Landscape = this.Landscape; |
||||
|
||||
if (Landscape) { |
||||
model.ReportSettings.PageSize = new Size(GlobalValues.DefaultPageSize.Height,GlobalValues.DefaultPageSize.Width); |
||||
} else { |
||||
model.ReportSettings.PageSize = GlobalValues.DefaultPageSize; |
||||
} |
||||
|
||||
CreateGrouping(model.ReportSettings); |
||||
|
||||
return model; |
||||
} |
||||
|
||||
|
||||
private void CreateGrouping(ReportSettings settings) |
||||
{ |
||||
if (!String.IsNullOrEmpty(this.Grouping)) |
||||
{ |
||||
string s = "=[" + this.Grouping + "]"; |
||||
GroupColumn g = new GroupColumn(s,1,System.ComponentModel.ListSortDirection.Ascending); |
||||
settings.GroupColumnsCollection.Add(g); |
||||
} |
||||
} |
||||
|
||||
|
||||
#region BaseSettingsPanel property's
|
||||
|
||||
public GraphicsUnit GraphicsUnit {get;set;} |
||||
|
||||
public string ReportName {get;set;} |
||||
|
||||
|
||||
public ICSharpCode.Reports.Core.Globals.GlobalEnums.ReportType ReportType {get;set;} |
||||
|
||||
public string FileName {get;set;} |
||||
|
||||
|
||||
public string Path {get;set;} |
||||
|
||||
public bool Landscape {get;set;} |
||||
|
||||
#endregion
|
||||
|
||||
#region DatabasePanel
|
||||
|
||||
public string ConnectionString {get;set;} |
||||
|
||||
public string SqlString {get;set;} |
||||
|
||||
public CommandType CommandType {get;set;} |
||||
|
||||
public ICSharpCode.Reports.Core.Globals.GlobalEnums.PushPullModel DataModel {get;set;} |
||||
|
||||
public IDatabaseObjectBase IDatabaseObjectBase {get;set;} |
||||
|
||||
|
||||
public SqlParameterCollection SqlQueryParameters {get;set;} |
||||
|
||||
#endregion
|
||||
|
||||
#region PushModelPanel
|
||||
|
||||
public AvailableFieldsCollection AvailableFieldsCollection { |
||||
get { |
||||
if (this.availableFieldsCollection == null) { |
||||
this.availableFieldsCollection = new AvailableFieldsCollection(); |
||||
} |
||||
return availableFieldsCollection; |
||||
} |
||||
} |
||||
|
||||
|
||||
public ReportItemCollection ReportItemCollection { |
||||
get { |
||||
if (this.reportItemCollection== null) { |
||||
this.reportItemCollection = new ReportItemCollection(); |
||||
} |
||||
return reportItemCollection; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
public GlobalEnums.ReportLayout ReportLayout {get;set;} |
||||
|
||||
#region Grouping
|
||||
|
||||
public string Grouping {get;set;} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IDisposable
|
||||
public void Dispose(){ |
||||
this.Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~ReportStructure(){ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected virtual void Dispose(bool disposing){ |
||||
if (disposing) { |
||||
if (this.reportItemCollection != null) { |
||||
this.reportItemCollection.Clear(); |
||||
this.reportItemCollection = null; |
||||
} |
||||
if (this.availableFieldsCollection != null) { |
||||
this.availableFieldsCollection.Clear(); |
||||
this.availableFieldsCollection = null; |
||||
} |
||||
if (this.SqlQueryParameters != null) { |
||||
this.SqlQueryParameters.Clear(); |
||||
this.SqlQueryParameters = null; |
||||
|
||||
} |
||||
} |
||||
|
||||
// Release unmanaged resources.
|
||||
// Set large fields to null.
|
||||
// Call Dispose on your base class.
|
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,89 +0,0 @@
@@ -1,89 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GeneratorCommand
|
||||
/// </summary>
|
||||
public class ReportWizardCommand : AbstractMenuCommand |
||||
{ |
||||
private const string WizardPath = "/ReportGenerator/ReportGeneratorWizard"; |
||||
private readonly OpenedFile file; |
||||
private ReportModel reportModel; |
||||
private IReportGenerator reportGenerator; |
||||
// private Properties customizer = new Properties();
|
||||
private ReportStructure reportStructure; |
||||
private bool canceled; |
||||
|
||||
|
||||
public ReportWizardCommand(OpenedFile file) |
||||
{ |
||||
this.file = file; |
||||
} |
||||
|
||||
|
||||
public override void Run() |
||||
{ |
||||
reportStructure = new ReportStructure(); |
||||
if (GlobalValues.IsValidPrinter() == true) { |
||||
|
||||
using (WizardDialog wizard = new WizardDialog("Report Wizard", reportStructure, WizardPath)) { |
||||
if (wizard.ShowDialog() == DialogResult.OK) { |
||||
reportModel = reportStructure.CreateAndFillReportModel (); |
||||
CreateReportFromModel(reportModel,reportStructure); |
||||
} |
||||
else{ |
||||
this.canceled = true; |
||||
} |
||||
} |
||||
} else { |
||||
MessageService.ShowError(ResourceService.GetString("Sharpreport.Error.NoPrinter")); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void CreateReportFromModel (ReportModel model,ReportStructure reportStructure) |
||||
{ |
||||
reportGenerator = GeneratorFactory.Create (model,reportStructure); |
||||
file.MakeDirty(); |
||||
reportGenerator.GenerateReport(); |
||||
} |
||||
|
||||
|
||||
public bool Canceled |
||||
{ |
||||
get { return canceled; } |
||||
} |
||||
|
||||
|
||||
public MemoryStream GeneratedReport |
||||
{ |
||||
get { return reportGenerator.Generated; } |
||||
} |
||||
} |
||||
} |
@ -1,59 +0,0 @@
@@ -1,59 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of WizardCommands.
|
||||
/// </summary>
|
||||
public class XsdSchemaAndDataCommand:AbstractMenuCommand |
||||
{ |
||||
|
||||
|
||||
public override void Run() |
||||
{ |
||||
ResultPanel panel = (ResultPanel)base.Owner; |
||||
if (panel != null) { |
||||
panel.SaveXsdFile(false); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
public class XsdSchemaOnlyCommand:AbstractMenuCommand |
||||
{ |
||||
public XsdSchemaOnlyCommand () |
||||
{ |
||||
|
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
ResultPanel panel = (ResultPanel)base.Owner; |
||||
if (panel != null) { |
||||
panel.SaveXsdFile(true); |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,430 +0,0 @@
@@ -1,430 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel.Design; |
||||
using System.Drawing; |
||||
using System.Runtime.InteropServices; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using Org.BouncyCastle.Crypto.Engines; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard{ |
||||
/// <summary>
|
||||
/// Description of ReportGenerator.
|
||||
/// </summary>
|
||||
public class BaseSettingsPanel : AbstractWizardPanel |
||||
{ |
||||
private System.Windows.Forms.RadioButton radioPushModell; |
||||
private System.Windows.Forms.RadioButton radioPullModell; |
||||
private System.Windows.Forms.Button button1; |
||||
private System.Windows.Forms.GroupBox groupBox2; |
||||
private System.Windows.Forms.GroupBox groupBox1; |
||||
private System.Windows.Forms.TextBox txtReportName; |
||||
private System.Windows.Forms.ComboBox cboGraphicsUnit; |
||||
private System.Windows.Forms.TextBox txtFileName; |
||||
private System.Windows.Forms.TextBox txtPath; |
||||
private System.Windows.Forms.Label label3; |
||||
private System.Windows.Forms.Label label2; |
||||
private System.Windows.Forms.Label label1; |
||||
private System.Windows.Forms.Label label5; |
||||
private System.Windows.Forms.Label label4; |
||||
private System.Windows.Forms.RadioButton radioFormSheet; |
||||
|
||||
private System.Windows.Forms.ErrorProvider errorProvider; |
||||
|
||||
private GroupBox groupPageLayout; |
||||
private RadioButton radioStandardLayout; |
||||
private RadioButton radioLandscape; |
||||
|
||||
ReportStructure reportStructure; |
||||
bool initDone; |
||||
|
||||
public BaseSettingsPanel(){ |
||||
InitializeComponent(); |
||||
AddPageLayout(); |
||||
errorProvider = new ErrorProvider(); |
||||
errorProvider.ContainerControl = this; |
||||
this.txtFileName.KeyUp += new KeyEventHandler(OnKeyUp); |
||||
Localize(); |
||||
Init(); |
||||
base.VisibleChanged += new EventHandler (ChangedEvent ); |
||||
} |
||||
|
||||
|
||||
private void AddPageLayout () |
||||
{ |
||||
|
||||
groupPageLayout = new GroupBox(); |
||||
groupPageLayout.Location = new Point (16,110); |
||||
groupPageLayout.Size = new System.Drawing.Size(360, 48); |
||||
groupPageLayout.Text = "Page Layout"; |
||||
|
||||
radioStandardLayout = new RadioButton(); |
||||
radioStandardLayout.Text = "Standard"; |
||||
radioStandardLayout.Location = new Point(24,15); |
||||
radioStandardLayout.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; |
||||
radioStandardLayout.CheckedChanged += SetSuccessor; |
||||
|
||||
groupPageLayout.Controls.Add(radioStandardLayout); |
||||
|
||||
radioLandscape = new RadioButton(); |
||||
radioLandscape.Text = "Landscape"; |
||||
radioLandscape.Location = new Point (150,15); |
||||
radioLandscape.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; |
||||
radioLandscape.CheckedChanged += SetSuccessor; |
||||
|
||||
groupPageLayout.Controls.Add(radioLandscape); |
||||
|
||||
this.groupBox1.Controls.Add(groupPageLayout); |
||||
} |
||||
|
||||
|
||||
private void OnKeyUp (object sender,KeyEventArgs e) { |
||||
if (this.txtFileName.Text.Length == 0) { |
||||
this.errorProvider.SetError(this.txtFileName,"aaaaa"); |
||||
this.EnableNext = false; |
||||
}else { |
||||
this.errorProvider.SetError(this.txtFileName,""); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void Localize() { |
||||
this.radioFormSheet.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.ReportModel.FormSheet"); |
||||
this.label1.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.ReportName"); |
||||
this.label2.Text = ResourceService.GetString("Global.Path"); |
||||
this.label3.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.ReportType"); |
||||
this.label4.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.GraphicsUnit"); |
||||
this.label5.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.FileName"); |
||||
|
||||
this.groupBox1.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.Group"); |
||||
this.groupBox2.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.ReportModel"); |
||||
|
||||
this.radioPullModell.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.ReportModel.Pull"); |
||||
|
||||
this.radioPushModell.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.ReportModel.Push"); |
||||
this.radioFormSheet.Text = ResourceService.GetString("SharpReport.Wizard.BaseSettings.ReportModel.FormSheet"); |
||||
|
||||
this.button1.Text = "..."; |
||||
} |
||||
|
||||
|
||||
#region overrides
|
||||
|
||||
public override bool ReceiveDialogMessage(DialogMessage message){ |
||||
|
||||
if (message == DialogMessage.Finish) { |
||||
|
||||
} else if ( message == DialogMessage.Next) { |
||||
|
||||
base.EnableFinish = true; |
||||
} |
||||
this.UpdateGenerator(); |
||||
return true; |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
private void Init() |
||||
{ |
||||
txtFileName.Text = GlobalValues.PlainFileName; |
||||
txtReportName.Text = GlobalValues.DefaultReportName; |
||||
this.cboGraphicsUnit.Items.AddRange(Enum.GetNames(typeof (GraphicsUnit))); |
||||
|
||||
cboGraphicsUnit.SelectedIndex = cboGraphicsUnit.FindString(GraphicsUnit.Millimeter.ToString()); |
||||
|
||||
this.radioPullModell.Checked = true; |
||||
this.radioStandardLayout.Checked = true; |
||||
|
||||
initDone = true; |
||||
} |
||||
|
||||
|
||||
private void ChangedEvent(object sender, EventArgs e){ |
||||
if (initDone) { |
||||
this.UpdateGenerator(); |
||||
SetSuccessor (this,new EventArgs()); |
||||
} |
||||
} |
||||
|
||||
private void UpdateGenerator () |
||||
{ |
||||
|
||||
reportStructure = (ReportStructure)base.CustomizationObject; |
||||
|
||||
|
||||
reportStructure.ReportName = txtReportName.Text; |
||||
if (!this.txtFileName.Text.EndsWith(GlobalValues.ReportExtension,StringComparison.OrdinalIgnoreCase)){ |
||||
reportStructure.FileName = txtFileName.Text + GlobalValues.ReportExtension; |
||||
} else { |
||||
reportStructure.FileName = txtFileName.Text; |
||||
} |
||||
reportStructure.Path = this.txtPath.Text; |
||||
reportStructure.GraphicsUnit = (GraphicsUnit)Enum.Parse(typeof(GraphicsUnit), |
||||
this.cboGraphicsUnit.Text); |
||||
|
||||
if (this.radioPullModell.Checked == true) { |
||||
base.NextWizardPanelID = "PullModel"; |
||||
reportStructure.DataModel = GlobalEnums.PushPullModel.PullData; |
||||
GoOn(); |
||||
} else if (this.radioPushModell.Checked == true){ |
||||
base.NextWizardPanelID = "PushModel"; |
||||
reportStructure.DataModel = GlobalEnums.PushPullModel.PushData; |
||||
GoOn(); |
||||
} else if (this.radioFormSheet.Checked == true){ |
||||
reportStructure.DataModel = GlobalEnums.PushPullModel.FormSheet; |
||||
base.EnableNext = false; |
||||
base.IsLastPanel = true; |
||||
} |
||||
|
||||
reportStructure.Landscape = this.radioLandscape.Checked; |
||||
} |
||||
|
||||
|
||||
private void SetSuccessor(object sender, System.EventArgs e) |
||||
{ |
||||
if (initDone) { |
||||
|
||||
if (this.radioPullModell.Checked == true) { |
||||
base.NextWizardPanelID = "PullModel"; |
||||
reportStructure.DataModel = GlobalEnums.PushPullModel.PullData; |
||||
GoOn(); |
||||
} else if (this.radioPushModell.Checked == true){ |
||||
base.NextWizardPanelID = "PushModel"; |
||||
reportStructure.DataModel = GlobalEnums.PushPullModel.PushData; |
||||
GoOn(); |
||||
} else if (this.radioFormSheet.Checked == true){ |
||||
// generator.DataModel = GlobalEnums.PushPullModel.FormSheet;
|
||||
base.EnableNext = false; |
||||
base.IsLastPanel = true; |
||||
} else if(this.radioStandardLayout.Checked == true) { |
||||
|
||||
reportStructure.Landscape = false; |
||||
|
||||
} else if(this.radioLandscape.Checked == true) { |
||||
reportStructure.Landscape = true; |
||||
} |
||||
|
||||
base.EnableFinish = true; |
||||
} |
||||
} |
||||
|
||||
|
||||
private void GoOn (){ |
||||
base.EnableNext = true; |
||||
base.IsLastPanel = false; |
||||
} |
||||
|
||||
|
||||
private void OnSelectFolder(object sender, System.EventArgs e) |
||||
{ |
||||
string selectedPath = SD.FileService.BrowseForFolder(""); |
||||
if (!String.IsNullOrEmpty(selectedPath)) { |
||||
if (!selectedPath.EndsWith(@"\",StringComparison.OrdinalIgnoreCase)){ |
||||
this.txtPath.Text = selectedPath + @"\"; |
||||
} else { |
||||
this.txtPath.Text = selectedPath; |
||||
} |
||||
} |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
|
||||
private void InitializeComponent() { |
||||
this.radioFormSheet = new System.Windows.Forms.RadioButton(); |
||||
this.label4 = new System.Windows.Forms.Label(); |
||||
this.label5 = new System.Windows.Forms.Label(); |
||||
this.label1 = new System.Windows.Forms.Label(); |
||||
this.label2 = new System.Windows.Forms.Label(); |
||||
this.label3 = new System.Windows.Forms.Label(); |
||||
this.txtPath = new System.Windows.Forms.TextBox(); |
||||
this.txtFileName = new System.Windows.Forms.TextBox(); |
||||
this.cboGraphicsUnit = new System.Windows.Forms.ComboBox(); |
||||
this.txtReportName = new System.Windows.Forms.TextBox(); |
||||
this.groupBox1 = new System.Windows.Forms.GroupBox(); |
||||
this.groupBox2 = new System.Windows.Forms.GroupBox(); |
||||
this.button1 = new System.Windows.Forms.Button(); |
||||
this.radioPullModell = new System.Windows.Forms.RadioButton(); |
||||
this.radioPushModell = new System.Windows.Forms.RadioButton(); |
||||
this.groupBox1.SuspendLayout(); |
||||
this.groupBox2.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// radioFormSheet
|
||||
//
|
||||
this.radioFormSheet.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; |
||||
this.radioFormSheet.Location = new System.Drawing.Point(256, 16); |
||||
this.radioFormSheet.Name = "radioFormSheet"; |
||||
this.radioFormSheet.Size = new System.Drawing.Size(80, 24); |
||||
this.radioFormSheet.TabIndex = 22; |
||||
this.radioFormSheet.CheckedChanged += new System.EventHandler(this.SetSuccessor); |
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(16, 168); |
||||
this.label4.Name = "label4"; |
||||
this.label4.Size = new System.Drawing.Size(80, 24); |
||||
this.label4.TabIndex = 15; |
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Location = new System.Drawing.Point(8, 80); |
||||
this.label5.Name = "label5"; |
||||
this.label5.Size = new System.Drawing.Size(64, 24); |
||||
this.label5.TabIndex = 12; |
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(8, 40); |
||||
this.label1.Name = "label1"; |
||||
this.label1.Size = new System.Drawing.Size(96, 16); |
||||
this.label1.TabIndex = 4; |
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(8, 24); |
||||
this.label2.Name = "label2"; |
||||
this.label2.Size = new System.Drawing.Size(72, 24); |
||||
this.label2.TabIndex = 12; |
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(8, 120); |
||||
this.label3.Name = "label3"; |
||||
this.label3.Size = new System.Drawing.Size(80, 16); |
||||
this.label3.TabIndex = 14; |
||||
this.label3.Visible = false; |
||||
//
|
||||
// txtPath
|
||||
//
|
||||
this.txtPath.Location = new System.Drawing.Point(112, 24); |
||||
this.txtPath.Name = "txtPath"; |
||||
this.txtPath.Size = new System.Drawing.Size(224, 20); |
||||
this.txtPath.TabIndex = 13; |
||||
this.txtPath.Text = String.Empty; |
||||
this.txtPath.TextChanged += new System.EventHandler(this.ChangedEvent); |
||||
//
|
||||
// txtFileName
|
||||
//
|
||||
this.txtFileName.Location = new System.Drawing.Point(120, 80); |
||||
this.txtFileName.Name = "txtFileName"; |
||||
this.txtFileName.Size = new System.Drawing.Size(248, 20); |
||||
this.txtFileName.TabIndex = 11; |
||||
this.txtFileName.Text = String.Empty; |
||||
this.txtFileName.TextChanged += new System.EventHandler(this.ChangedEvent); |
||||
//
|
||||
// cboGraphicsUnit
|
||||
//
|
||||
this.cboGraphicsUnit.Location = new System.Drawing.Point(116, 168); |
||||
this.cboGraphicsUnit.Name = "cboGraphicsUnit"; |
||||
this.cboGraphicsUnit.Size = new System.Drawing.Size(248, 25); |
||||
this.cboGraphicsUnit.TabIndex = 17; |
||||
this.cboGraphicsUnit.TextChanged += new System.EventHandler(this.ChangedEvent); |
||||
this.cboGraphicsUnit.DropDownStyle = ComboBoxStyle.DropDownList; |
||||
|
||||
//
|
||||
// txtReportName
|
||||
//
|
||||
this.txtReportName.Location = new System.Drawing.Point(120, 40); |
||||
this.txtReportName.Name = "txtReportName"; |
||||
this.txtReportName.Size = new System.Drawing.Size(248, 20); |
||||
this.txtReportName.TabIndex = 0; |
||||
this.txtReportName.Text = String.Empty; |
||||
this.txtReportName.TextChanged += new System.EventHandler(this.ChangedEvent); |
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.groupBox2); |
||||
this.groupBox1.Controls.Add(this.button1); |
||||
this.groupBox1.Controls.Add(this.cboGraphicsUnit); |
||||
|
||||
this.groupBox1.Controls.Add(this.label4); |
||||
this.groupBox1.Controls.Add(this.label3); |
||||
this.groupBox1.Controls.Add(this.txtPath); |
||||
this.groupBox1.Controls.Add(this.label2); |
||||
this.groupBox1.Location = new System.Drawing.Point(8, 160); |
||||
this.groupBox1.Name = "groupBox1"; |
||||
this.groupBox1.Size = new System.Drawing.Size(392, 210); |
||||
this.groupBox1.TabIndex = 10; |
||||
this.groupBox1.TabStop = false; |
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.radioFormSheet); |
||||
this.groupBox2.Controls.Add(this.radioPullModell); |
||||
this.groupBox2.Controls.Add(this.radioPushModell); |
||||
this.groupBox2.Location = new System.Drawing.Point(16, 56); |
||||
this.groupBox2.Name = "groupBox2"; |
||||
this.groupBox2.Size = new System.Drawing.Size(360, 48); |
||||
this.groupBox2.TabIndex = 21; |
||||
this.groupBox2.TabStop = false; |
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; |
||||
this.button1.Location = new System.Drawing.Point(352, 24); |
||||
this.button1.Name = "button1"; |
||||
this.button1.Size = new System.Drawing.Size(24, 21); |
||||
this.button1.TabIndex = 18; |
||||
this.button1.Click += new System.EventHandler(this.OnSelectFolder); |
||||
//
|
||||
// radioPullModell
|
||||
//
|
||||
this.radioPullModell.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; |
||||
this.radioPullModell.Location = new System.Drawing.Point(24, 16); |
||||
this.radioPullModell.Name = "radioPullModell"; |
||||
this.radioPullModell.Size = new System.Drawing.Size(88, 24); |
||||
this.radioPullModell.TabIndex = 21; |
||||
this.radioPullModell.CheckedChanged += new System.EventHandler(this.SetSuccessor); |
||||
//
|
||||
// radioPushModell
|
||||
//
|
||||
this.radioPushModell.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; |
||||
this.radioPushModell.Location = new System.Drawing.Point(136, 16); |
||||
this.radioPushModell.Name = "radioPushModell"; |
||||
this.radioPushModell.Size = new System.Drawing.Size(96, 24); |
||||
this.radioPushModell.TabIndex = 20; |
||||
this.radioPushModell.CheckedChanged += new System.EventHandler(this.SetSuccessor); |
||||
//
|
||||
// BaseSettingsPanel
|
||||
//
|
||||
this.Controls.Add(this.label5); |
||||
this.Controls.Add(this.txtFileName); |
||||
this.Controls.Add(this.groupBox1); |
||||
this.Controls.Add(this.label1); |
||||
this.Controls.Add(this.txtReportName); |
||||
this.Name = "BaseSettingsPanel"; |
||||
this.Size = new System.Drawing.Size(424, 368); |
||||
this.groupBox1.ResumeLayout(false); |
||||
this.groupBox2.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,275 +0,0 @@
@@ -1,275 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Data.Common; |
||||
using System.Drawing; |
||||
using System.Globalization; |
||||
using System.Windows.Forms; |
||||
using System.Xml; |
||||
|
||||
using ICSharpCode.Core; |
||||
//using ICSharpCode.Reports.Addin.Designer;
|
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
//using SharpQuery.Collections;
|
||||
//using SharpQuery.SchemaClass;
|
||||
|
||||
using System.ComponentModel; |
||||
using System.Windows.Forms.VisualStyles; |
||||
|
||||
|
||||
/// <summary>
|
||||
/// //http://www.codeproject.com/useritems/CheckBoxHeaderCell.asp
|
||||
/// </summary>
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
public class DataGridViewColumnHeaderCheckBoxCell : DataGridViewColumnHeaderCell |
||||
{ |
||||
#region Fields
|
||||
|
||||
private bool _Checked; |
||||
private Size _CheckBoxSize; |
||||
private Point _CheckBoxLocation; |
||||
private Rectangle _CheckBoxBounds; |
||||
private Point _CellLocation = new Point(); |
||||
private HorizontalAlignment _CheckBoxAlignment = HorizontalAlignment.Center; |
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
public event DataGridViewCheckBoxHeaderCellEvenHandler CheckBoxClicked; |
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public DataGridViewColumnHeaderCheckBoxCell() |
||||
: base() |
||||
{ |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public HorizontalAlignment CheckBoxAlignment |
||||
{ |
||||
get { return _CheckBoxAlignment; } |
||||
set |
||||
{ |
||||
if (!Enum.IsDefined(typeof(HorizontalAlignment), value)) |
||||
{ |
||||
throw new InvalidEnumArgumentException("value", (int)value, typeof(HorizontalAlignment)); |
||||
|
||||
} |
||||
if (_CheckBoxAlignment != value) |
||||
{ |
||||
_CheckBoxAlignment = value; |
||||
if (this.DataGridView != null) |
||||
{ |
||||
this.DataGridView.InvalidateCell(this); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public bool Checked |
||||
{ |
||||
get { return _Checked; } |
||||
set |
||||
{ |
||||
if (_Checked != value) |
||||
{ |
||||
_Checked = value; |
||||
if (this.DataGridView != null) |
||||
{ |
||||
this.DataGridView.InvalidateCell(this); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected virtual void OnCheckBoxClicked(DataGridViewCheckBoxHeaderCellEventArgs e) |
||||
{ |
||||
if (this.CheckBoxClicked != null) |
||||
{ |
||||
this.CheckBoxClicked(this, e); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Override
|
||||
|
||||
protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, |
||||
int rowIndex, DataGridViewElementStates dataGridViewElementState, object value, |
||||
object formattedValue, string errorText, DataGridViewCellStyle cellStyle, |
||||
DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) |
||||
{ |
||||
//checkbox bounds
|
||||
CheckBoxState state = this.CheckBoxState; |
||||
_CellLocation = cellBounds.Location; |
||||
_CheckBoxSize = CheckBoxRenderer.GetGlyphSize(graphics, state); |
||||
Point p = new Point(); |
||||
p.Y = cellBounds.Location.Y + (cellBounds.Height / 2) - (_CheckBoxSize.Height / 2); |
||||
switch (_CheckBoxAlignment) |
||||
{ |
||||
case HorizontalAlignment.Center: |
||||
p.X = cellBounds.Location.X + (cellBounds.Width / 2) - (_CheckBoxSize.Width / 2) - 1; |
||||
break; |
||||
case HorizontalAlignment.Left: |
||||
p.X = cellBounds.Location.X + 2; |
||||
break; |
||||
case HorizontalAlignment.Right: |
||||
p.X = cellBounds.Right - _CheckBoxSize.Width - 4; |
||||
break; |
||||
} |
||||
_CheckBoxLocation = p; |
||||
_CheckBoxBounds = new Rectangle(_CheckBoxLocation, _CheckBoxSize); |
||||
|
||||
//paint background
|
||||
paintParts &= ~DataGridViewPaintParts.ContentForeground; |
||||
base.Paint(graphics, clipBounds, cellBounds, rowIndex, dataGridViewElementState, value, |
||||
formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); |
||||
|
||||
//paint foreground
|
||||
switch (_CheckBoxAlignment) |
||||
{ |
||||
case HorizontalAlignment.Center: |
||||
cellBounds.Width = _CheckBoxLocation.X - cellBounds.X - 2; |
||||
break; |
||||
case HorizontalAlignment.Left: |
||||
cellBounds.X += _CheckBoxSize.Width + 2; |
||||
cellBounds.Width -= _CheckBoxSize.Width + 2; |
||||
break; |
||||
case HorizontalAlignment.Right: |
||||
cellBounds.Width -= _CheckBoxSize.Width + 4; |
||||
break; |
||||
} |
||||
paintParts = DataGridViewPaintParts.ContentForeground; |
||||
base.Paint(graphics, clipBounds, cellBounds, rowIndex, dataGridViewElementState, value, |
||||
formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); |
||||
|
||||
//paint check box
|
||||
CheckBoxRenderer.DrawCheckBox(graphics, _CheckBoxLocation, state); |
||||
} |
||||
|
||||
protected override void OnMouseClick(DataGridViewCellMouseEventArgs e) |
||||
{ |
||||
if (e.Button == MouseButtons.Left) |
||||
{ |
||||
//click on check box ?
|
||||
Point p = new Point(_CellLocation.X + e.X, _CellLocation.Y + e.Y); |
||||
if (_CheckBoxBounds.Contains(p)) |
||||
{ |
||||
//raise event
|
||||
RaiseCheckBoxClicked(); |
||||
} |
||||
} |
||||
base.OnMouseClick(e); |
||||
} |
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e, int rowIndex) |
||||
{ |
||||
if (e.KeyCode == Keys.Space) |
||||
{ |
||||
//raise event
|
||||
RaiseCheckBoxClicked(); |
||||
} |
||||
base.OnKeyDown(e, rowIndex); |
||||
} |
||||
|
||||
public override object Clone() |
||||
{ |
||||
DataGridViewColumnHeaderCheckBoxCell cell = base.Clone() as DataGridViewColumnHeaderCheckBoxCell; |
||||
if (cell != null) |
||||
{ |
||||
cell.Checked = this.Checked; |
||||
} |
||||
return cell; |
||||
} |
||||
#endregion
|
||||
|
||||
#region Private
|
||||
|
||||
private void RaiseCheckBoxClicked() |
||||
{ |
||||
//raise event
|
||||
DataGridViewCheckBoxHeaderCellEventArgs e = new DataGridViewCheckBoxHeaderCellEventArgs(!_Checked); |
||||
this.OnCheckBoxClicked(e); |
||||
if (!e.Cancel) |
||||
{ |
||||
this.Checked = e.Checked; |
||||
this.DataGridView.InvalidateCell(this); |
||||
} |
||||
} |
||||
private CheckBoxState CheckBoxState |
||||
{ |
||||
get |
||||
{ |
||||
bool enabled = true; |
||||
if (base.DataGridView != null && !base.DataGridView.Enabled) |
||||
{ |
||||
enabled = false; |
||||
} |
||||
if (enabled) |
||||
{ |
||||
return (_Checked) ? CheckBoxState.CheckedNormal : CheckBoxState.UncheckedNormal; |
||||
} |
||||
return (_Checked) ? CheckBoxState.CheckedDisabled : CheckBoxState.UncheckedDisabled; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
#region Events and Delegates
|
||||
|
||||
public delegate void DataGridViewCheckBoxHeaderCellEvenHandler(object sender, DataGridViewCheckBoxHeaderCellEventArgs e); |
||||
|
||||
public class DataGridViewCheckBoxHeaderCellEventArgs : CancelEventArgs |
||||
{ |
||||
bool _Checked; |
||||
|
||||
public DataGridViewCheckBoxHeaderCellEventArgs(bool checkedValue) |
||||
: base() |
||||
{ |
||||
_Checked = checkedValue; |
||||
} |
||||
public DataGridViewCheckBoxHeaderCellEventArgs(bool checkedValue, bool cancel) |
||||
: base(cancel) |
||||
{ |
||||
_Checked = checkedValue; |
||||
} |
||||
|
||||
public bool Checked |
||||
{ |
||||
get { return _Checked; } |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
@ -1,63 +0,0 @@
@@ -1,63 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of LayoutPanel.
|
||||
/// </summary>
|
||||
public class LayoutPanel: AbstractWizardPanel |
||||
{ |
||||
private LayoutPanelControl layoutControl; |
||||
private ReportStructure reportStructure; |
||||
|
||||
public LayoutPanel() |
||||
{ |
||||
base.EnableFinish = true; |
||||
base.EnableCancel = true; |
||||
base.EnableNext = true; |
||||
base.Refresh(); |
||||
layoutControl = new LayoutPanelControl(); |
||||
layoutControl.Location = new Point (20,20); |
||||
this.Controls.Add(layoutControl); |
||||
|
||||
} |
||||
|
||||
|
||||
public override bool ReceiveDialogMessage(DialogMessage message) |
||||
{ |
||||
base.EnableFinish = true; |
||||
base.IsLastPanel = true; |
||||
base.EnablePrevious = true; |
||||
reportStructure = (ReportStructure)base.CustomizationObject; |
||||
if (message == DialogMessage.Activated) { |
||||
layoutControl.AvailableFieldsCollection = reportStructure.AvailableFieldsCollection; |
||||
} |
||||
|
||||
else if (message == DialogMessage.Finish) |
||||
{ |
||||
reportStructure.ReportLayout = layoutControl.ReportLayout; |
||||
reportStructure.Grouping = layoutControl.GroupName; |
||||
} |
||||
return true; |
||||
} |
||||
} |
||||
} |
@ -1,140 +0,0 @@
@@ -1,140 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
partial class LayoutPanelControl |
||||
{ |
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the control.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.groupBox1 = new System.Windows.Forms.GroupBox(); |
||||
this.groupBox2 = new System.Windows.Forms.GroupBox(); |
||||
this.comboBox1 = new System.Windows.Forms.ComboBox(); |
||||
this.checkBox1 = new System.Windows.Forms.CheckBox(); |
||||
this.radioTableLayout = new System.Windows.Forms.RadioButton(); |
||||
this.radioListLayout = new System.Windows.Forms.RadioButton(); |
||||
this.groupBox1.SuspendLayout(); |
||||
this.groupBox2.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.groupBox2); |
||||
this.groupBox1.Controls.Add(this.checkBox1); |
||||
this.groupBox1.Controls.Add(this.radioTableLayout); |
||||
this.groupBox1.Controls.Add(this.radioListLayout); |
||||
this.groupBox1.Location = new System.Drawing.Point(17, 18); |
||||
this.groupBox1.Name = "groupBox1"; |
||||
this.groupBox1.Size = new System.Drawing.Size(232, 242); |
||||
this.groupBox1.TabIndex = 2; |
||||
this.groupBox1.TabStop = false; |
||||
this.groupBox1.Text = "Report Layout"; |
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.comboBox1); |
||||
this.groupBox2.Location = new System.Drawing.Point(55, 146); |
||||
this.groupBox2.Name = "groupBox2"; |
||||
this.groupBox2.Size = new System.Drawing.Size(200, 64); |
||||
this.groupBox2.TabIndex = 6; |
||||
this.groupBox2.TabStop = false; |
||||
this.groupBox2.Text = "groupBox2"; |
||||
this.groupBox2.Visible = false; |
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true; |
||||
this.comboBox1.Location = new System.Drawing.Point(6, 28); |
||||
this.comboBox1.Name = "comboBox1"; |
||||
this.comboBox1.Size = new System.Drawing.Size(121, 21); |
||||
this.comboBox1.TabIndex = 6; |
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.Location = new System.Drawing.Point(64, 106); |
||||
this.checkBox1.Name = "checkBox1"; |
||||
this.checkBox1.Size = new System.Drawing.Size(104, 24); |
||||
this.checkBox1.TabIndex = 4; |
||||
this.checkBox1.Text = "Grouping"; |
||||
this.checkBox1.UseVisualStyleBackColor = true; |
||||
this.checkBox1.CheckedChanged += new System.EventHandler(this.CheckBox1CheckedChanged); |
||||
//
|
||||
// radioTableLayout
|
||||
//
|
||||
this.radioTableLayout.Location = new System.Drawing.Point(64, 65); |
||||
this.radioTableLayout.Name = "radioTableLayout"; |
||||
this.radioTableLayout.Size = new System.Drawing.Size(104, 24); |
||||
this.radioTableLayout.TabIndex = 3; |
||||
this.radioTableLayout.TabStop = true; |
||||
this.radioTableLayout.Text = "Table Layout"; |
||||
this.radioTableLayout.UseVisualStyleBackColor = true; |
||||
//
|
||||
// radioListLayout
|
||||
//
|
||||
this.radioListLayout.Location = new System.Drawing.Point(64, 19); |
||||
this.radioListLayout.Name = "radioListLayout"; |
||||
this.radioListLayout.Size = new System.Drawing.Size(104, 24); |
||||
this.radioListLayout.TabIndex = 2; |
||||
this.radioListLayout.TabStop = true; |
||||
this.radioListLayout.Text = "List Layout"; |
||||
this.radioListLayout.UseVisualStyleBackColor = true; |
||||
//
|
||||
// LayoutPanelControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.Controls.Add(this.groupBox1); |
||||
this.Name = "LayoutPanelControl"; |
||||
this.Size = new System.Drawing.Size(331, 284); |
||||
this.groupBox1.ResumeLayout(false); |
||||
this.groupBox2.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
private System.Windows.Forms.GroupBox groupBox2; |
||||
private System.Windows.Forms.CheckBox checkBox1; |
||||
private System.Windows.Forms.ComboBox comboBox1; |
||||
private System.Windows.Forms.RadioButton radioTableLayout; |
||||
private System.Windows.Forms.RadioButton radioListLayout; |
||||
private System.Windows.Forms.GroupBox groupBox1; |
||||
|
||||
} |
||||
} |
@ -1,122 +0,0 @@
@@ -1,122 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of UserControl1.
|
||||
/// </summary>
|
||||
public partial class LayoutPanelControl : UserControl |
||||
{ |
||||
GlobalEnums.ReportLayout reportLayout; |
||||
AvailableFieldsCollection availableFieldsCollection ; |
||||
|
||||
|
||||
|
||||
public LayoutPanelControl() |
||||
{ |
||||
InitializeComponent(); |
||||
groupBox1.Text = ResourceService.GetString("SharpReport.Wizard.Layout.ReportLayout"); |
||||
radioListLayout.Text = ResourceService.GetString("SharpReport.Wizard.Layout.ListLayout"); |
||||
radioTableLayout.Text = ResourceService.GetString("SharpReport.Wizard.Layout.TableLayout"); |
||||
groupBox2.Text = ResourceService.GetString("SharpReport.Wizard.Layout.Column"); |
||||
checkBox1.Text = ResourceService.GetString("SharpReport.Wizard.Layout.Grouping"); |
||||
} |
||||
|
||||
|
||||
|
||||
private void SetLayout () |
||||
{ |
||||
switch (reportLayout) { |
||||
case GlobalEnums.ReportLayout.ListLayout: |
||||
this.radioListLayout.Checked = true; |
||||
break; |
||||
case GlobalEnums.ReportLayout.TableLayout: |
||||
this.radioListLayout.Checked = true; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
|
||||
private void GetLayout() |
||||
{ |
||||
if (this.radioListLayout.Checked) { |
||||
this.reportLayout = GlobalEnums.ReportLayout.ListLayout; |
||||
} |
||||
else if (this.radioTableLayout.Checked) { |
||||
this.reportLayout = GlobalEnums.ReportLayout.TableLayout; |
||||
} |
||||
} |
||||
|
||||
|
||||
public GlobalEnums.ReportLayout ReportLayout { |
||||
get { |
||||
GetLayout(); |
||||
return reportLayout; |
||||
} |
||||
set { reportLayout = value; |
||||
SetLayout(); |
||||
} |
||||
} |
||||
|
||||
void CheckBox1CheckedChanged(object sender, System.EventArgs e) |
||||
{ |
||||
//comboBox1.Visible = checkBox1.Checked;
|
||||
this.groupBox2.Visible = checkBox1.Checked; |
||||
} |
||||
|
||||
|
||||
public AvailableFieldsCollection AvailableFieldsCollection { |
||||
get { return availableFieldsCollection; } |
||||
|
||||
set { |
||||
availableFieldsCollection = value; |
||||
comboBox1.Items.Clear(); |
||||
foreach (AbstractColumn ac in this.availableFieldsCollection) |
||||
{ |
||||
this.comboBox1.Items.Add(ac.ColumnName); |
||||
} |
||||
|
||||
if (comboBox1.Items.Count > 0) { |
||||
comboBox1.SelectedIndex = 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public string GroupName |
||||
{ |
||||
get { |
||||
string ret = String.Empty; |
||||
if (checkBox1.Checked) { |
||||
ret = comboBox1.SelectedItem.ToString(); |
||||
} |
||||
return ret; |
||||
} |
||||
|
||||
} |
||||
} |
||||
} |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
</root> |
@ -1,369 +0,0 @@
@@ -1,369 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Data.SqlClient; |
||||
using System.Globalization; |
||||
using System.Reflection; |
||||
using System.Windows.Forms; |
||||
using System.Windows.Forms.Integration; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Data.Core.Interfaces; |
||||
using ICSharpCode.Data.Core.UI.UserControls; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of PullModelPanel.
|
||||
/// </summary>
|
||||
public class PullModelPanel : AbstractWizardPanel |
||||
{ |
||||
private System.ComponentModel.IContainer components; |
||||
private System.Windows.Forms.ToolTip toolTip1; |
||||
private System.Windows.Forms.Label label1; |
||||
private System.Windows.Forms.TextBox txtSqlString; |
||||
private System.Windows.Forms.Label label3; |
||||
private bool firstDrag; |
||||
private string connectionString; |
||||
private ReportStructure reportStructure; |
||||
private IDatabaseObjectBase currentNode; |
||||
private ElementHost databasesTreeHost; |
||||
private DatabasesTreeView databasesTree; |
||||
|
||||
private enum NodeType |
||||
{ |
||||
TableImage, |
||||
ViewImage, |
||||
ProcedureImage, |
||||
ColumnImage, |
||||
NodeError |
||||
} |
||||
|
||||
|
||||
public PullModelPanel() |
||||
{ |
||||
InitializeComponent(); |
||||
|
||||
base.EnableFinish = false; |
||||
base.EnableNext = false; |
||||
base.EnableCancel = true; |
||||
this.firstDrag = true; |
||||
base.IsLastPanel = false; |
||||
this.txtSqlString.Enabled = false; |
||||
|
||||
this.databasesTreeHost = new ElementHost() { Dock = DockStyle.Fill }; |
||||
this.databasesTree = new DatabasesTreeView(); |
||||
this.databasesTree.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler<object>(databasesTree_SelectedItemChanged); |
||||
this.databasesTreeHost.Child = this.databasesTree; |
||||
this.label2.Controls.Add(databasesTreeHost); |
||||
|
||||
Localize(); |
||||
} |
||||
|
||||
private void Localize() { |
||||
this.label1.Text = ResourceService.GetString("SharpQuery.Label.SharpQuery"); |
||||
this.label3.Text = ResourceService.GetString("SharpReport.Wizard.PullModel.CommandText"); |
||||
this.toolTip1.SetToolTip(this.txtSqlString, |
||||
ResourceService.GetString("SharpReport.Wizard.PullModel.CommandText.ToolTip")); |
||||
} |
||||
|
||||
|
||||
#region overrides
|
||||
|
||||
public override bool ReceiveDialogMessage(DialogMessage message) |
||||
{ |
||||
|
||||
this.reportStructure = (ReportStructure)base.CustomizationObject; |
||||
|
||||
if (message == DialogMessage.Next) { |
||||
reportStructure.SqlString = this.txtSqlString.Text.Trim(); |
||||
reportStructure.ConnectionString = connectionString; |
||||
base.EnableFinish = true; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region events
|
||||
|
||||
private void TxtSqlStringChanged (object sender,EventArgs e) { |
||||
|
||||
if ((this.txtSqlString.Text.Length == 0) && (this.connectionString.Length > 0)) { |
||||
base.EnableNext = false; |
||||
} else { |
||||
base.EnableNext = true; |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
private void TxtSqlStringDragEnter(object sender, System.Windows.Forms.DragEventArgs e){ |
||||
// Handle the Drag effect when the listbox is entered
|
||||
if (e.Data.GetFormats().Length > 0) |
||||
{ |
||||
string draggedFormat = e.Data.GetFormats()[0]; |
||||
|
||||
String str = String.Format("drag {0}",draggedFormat); |
||||
System.Diagnostics.Trace.WriteLine(str); |
||||
|
||||
Type draggedType = null; |
||||
|
||||
// I'm doing this ugly thing because we are checking if the IDatabaseObjectBase is implemented,
|
||||
// obviously Microsoft hasn't really considered using interfaces or base classes for drag and drop
|
||||
AppDomain.CurrentDomain.GetAssemblies().ForEach(assembly => |
||||
{ |
||||
if (draggedType == null && assembly.GetName().Name == "ICSharpCode.Data.Core") |
||||
draggedType = assembly.GetType(draggedFormat); |
||||
}); |
||||
|
||||
if (draggedType != null && draggedType.GetInterface("IDatabaseObjectBase") != null) |
||||
{ |
||||
e.Effect = DragDropEffects.Copy; |
||||
return; |
||||
} |
||||
} |
||||
|
||||
e.Effect = DragDropEffects.None; |
||||
} |
||||
|
||||
|
||||
private void TxtSqlStringDragDrop(object sender, System.Windows.Forms.DragEventArgs e){ |
||||
if (firstDrag == true) { |
||||
this.txtSqlString.Clear(); |
||||
firstDrag = false; |
||||
} |
||||
|
||||
// Drag and drop isn't working via e.Data.GetData, so I'm using reflection here - took me a lot of time to figure out how this works...
|
||||
// Still don't know why they implemented dnd so buggy and uncomfortable...
|
||||
string draggedFormat = e.Data.GetFormats()[0]; |
||||
IDatabaseObjectBase draggedObject = null; |
||||
|
||||
if (e.Data.GetDataPresent(draggedFormat)) |
||||
{ |
||||
object tempDraggedObject = null; |
||||
FieldInfo info; |
||||
info = e.Data.GetType().GetField("innerData", BindingFlags.NonPublic | BindingFlags.Instance); |
||||
tempDraggedObject = info.GetValue(e.Data); |
||||
info = tempDraggedObject.GetType().GetField("innerData", BindingFlags.NonPublic | BindingFlags.Instance); |
||||
System.Windows.DataObject dataObject = info.GetValue(tempDraggedObject) as System.Windows.DataObject; |
||||
draggedObject = dataObject.GetData(draggedFormat) as IDatabaseObjectBase; |
||||
} |
||||
|
||||
switch (CheckCurrentNode(draggedObject)) |
||||
{ |
||||
case NodeType.TableImage: |
||||
// we insert Select * from.... otherwise we have to scan
|
||||
//the whole string for incorrect columnNames
|
||||
this.txtSqlString.Clear(); |
||||
ITable table = draggedObject as ITable; |
||||
this.txtSqlString.Text = "SELECT * FROM " + table.Name; |
||||
reportStructure.CommandType = CommandType.Text; |
||||
reportStructure.IDatabaseObjectBase = table; |
||||
break; |
||||
|
||||
case NodeType.ColumnImage: |
||||
IColumn column = draggedObject as IColumn; |
||||
string colName = column.Name; |
||||
|
||||
if (this.txtSqlString.Text.Length == 0) |
||||
{ |
||||
this.txtSqlString.AppendText("SELECT "); |
||||
this.txtSqlString.AppendText(colName); |
||||
} |
||||
|
||||
else if (this.txtSqlString.Text.ToUpper(CultureInfo.InvariantCulture).IndexOf("where", StringComparison.OrdinalIgnoreCase) > 0) |
||||
{ |
||||
this.txtSqlString.AppendText(colName + " = ?"); |
||||
} |
||||
else |
||||
{ |
||||
this.txtSqlString.AppendText(", "); |
||||
this.txtSqlString.AppendText(colName); |
||||
} |
||||
reportStructure.CommandType = CommandType.Text; |
||||
if (reportStructure.IDatabaseObjectBase == null) |
||||
{ |
||||
reportStructure.IDatabaseObjectBase = column; |
||||
} |
||||
break; |
||||
|
||||
case NodeType.ProcedureImage: |
||||
this.txtSqlString.Clear(); |
||||
|
||||
// we can't use the dragobject because it returns an string like 'EXECUTE ProcName'
|
||||
IProcedure procedure = draggedObject as IProcedure; |
||||
this.txtSqlString.Text = "[" + procedure.Name + "]"; |
||||
reportStructure.CommandType = CommandType.StoredProcedure; |
||||
reportStructure.IDatabaseObjectBase = procedure; |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
base.EnableNext = true; |
||||
} |
||||
|
||||
|
||||
private void databasesTree_SelectedItemChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e) |
||||
{ |
||||
if (e.NewValue is IDatabaseObjectBase) |
||||
{ |
||||
IDatabase parentDatabase = e.NewValue as IDatabase; |
||||
|
||||
if (parentDatabase == null) |
||||
{ |
||||
IDatabaseObjectBase currentDatabaseObject = e.NewValue as IDatabaseObjectBase; |
||||
|
||||
while (parentDatabase == null) |
||||
{ |
||||
if (currentDatabaseObject.Parent == null) |
||||
break; |
||||
else if (currentDatabaseObject.Parent is IDatabase) |
||||
{ |
||||
parentDatabase = currentDatabaseObject.Parent as IDatabase; |
||||
break; |
||||
} |
||||
else |
||||
currentDatabaseObject = currentDatabaseObject.Parent; |
||||
} |
||||
} |
||||
|
||||
if (parentDatabase != null) |
||||
this.currentNode = parentDatabase; |
||||
|
||||
if (this.currentNode is IDatabase) |
||||
{ |
||||
if (parentDatabase != null) |
||||
{ |
||||
this.connectionString = parentDatabase.ConnectionString; |
||||
this.txtSqlString.Enabled = true; |
||||
|
||||
if (this.firstDrag) |
||||
this.txtSqlString.Text = string.Empty; |
||||
|
||||
firstDrag = false; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
this.EnableNext = false; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// check witch type of node we dragg
|
||||
private static NodeType CheckCurrentNode (IDatabaseObjectBase node) { |
||||
NodeType enm; |
||||
if (node is IColumn) { |
||||
enm = NodeType.ColumnImage; |
||||
} else if (node is ITable) { |
||||
enm = NodeType.TableImage; |
||||
} else if (node is IProcedure) { |
||||
enm = NodeType.ProcedureImage; |
||||
} else if (node is IView) { |
||||
enm = NodeType.ViewImage; |
||||
} |
||||
else { |
||||
enm = NodeType.NodeError; |
||||
} |
||||
return enm; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method connectiontents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.components = new System.ComponentModel.Container(); |
||||
this.label3 = new System.Windows.Forms.Label(); |
||||
this.txtSqlString = new System.Windows.Forms.TextBox(); |
||||
this.label1 = new System.Windows.Forms.Label(); |
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); |
||||
this.textBox1 = new System.Windows.Forms.TextBox(); |
||||
this.label2 = new System.Windows.Forms.Label(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(8, 200); |
||||
this.label3.Name = "label3"; |
||||
this.label3.Size = new System.Drawing.Size(104, 24); |
||||
this.label3.TabIndex = 11; |
||||
//
|
||||
// txtSqlString
|
||||
//
|
||||
this.txtSqlString.AllowDrop = true; |
||||
this.txtSqlString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.txtSqlString.Location = new System.Drawing.Point(120, 192); |
||||
this.txtSqlString.Multiline = true; |
||||
this.txtSqlString.Name = "txtSqlString"; |
||||
this.txtSqlString.Size = new System.Drawing.Size(264, 144); |
||||
this.txtSqlString.TabIndex = 8; |
||||
this.txtSqlString.TextChanged += new System.EventHandler(this.TxtSqlStringChanged); |
||||
this.txtSqlString.DragDrop += new System.Windows.Forms.DragEventHandler(this.TxtSqlStringDragDrop); |
||||
this.txtSqlString.DragEnter += new System.Windows.Forms.DragEventHandler(this.TxtSqlStringDragEnter); |
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(8, 16); |
||||
this.label1.Name = "label1"; |
||||
this.label1.Size = new System.Drawing.Size(104, 16); |
||||
this.label1.TabIndex = 9; |
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(0, 0); |
||||
this.textBox1.Name = "textBox1"; |
||||
this.textBox1.Size = new System.Drawing.Size(100, 20); |
||||
this.textBox1.TabIndex = 0; |
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.label2.Location = new System.Drawing.Point(116, 16); |
||||
this.label2.Name = "label2"; |
||||
this.label2.Size = new System.Drawing.Size(267, 159); |
||||
this.label2.TabIndex = 12; |
||||
this.label2.Text = "label2"; |
||||
//
|
||||
// PullModelPanel
|
||||
//
|
||||
this.Controls.Add(this.label2); |
||||
this.Controls.Add(this.label3); |
||||
this.Controls.Add(this.label1); |
||||
this.Controls.Add(this.txtSqlString); |
||||
this.Name = "PullModelPanel"; |
||||
this.Size = new System.Drawing.Size(432, 344); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
} |
||||
private System.Windows.Forms.Label label2; |
||||
private System.Windows.Forms.TextBox textBox1; |
||||
#endregion
|
||||
} |
||||
} |
@ -1,124 +0,0 @@
@@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
||||
<data name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing"> |
||||
<value>17, 17</value> |
||||
</data> |
||||
</root> |
@ -1,250 +0,0 @@
@@ -1,250 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Globalization; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// Description of PushModelPanel.
|
||||
/// </summary>
|
||||
public class PushModelPanel : AbstractWizardPanel |
||||
{ |
||||
private System.Windows.Forms.Label label2; |
||||
private System.Windows.Forms.Label label1; |
||||
private System.Windows.Forms.Button btnPath; |
||||
private System.Windows.Forms.CheckedListBox checkedListBox; |
||||
private System.Windows.Forms.TextBox txtPath; |
||||
|
||||
private ReportStructure reportStructure; |
||||
// private Properties customizer;
|
||||
private DataSet resultDataSet; |
||||
|
||||
public PushModelPanel() |
||||
{ |
||||
InitializeComponent(); |
||||
base.EnableFinish = false; |
||||
base.EnableCancel = true; |
||||
base.EnableNext = false; |
||||
Localize (); |
||||
} |
||||
|
||||
|
||||
void Localize () |
||||
{ |
||||
this.label1.Text = ResourceService.GetString("SharpReport.Wizard.PushModel.Path"); |
||||
this.label2.Text = ResourceService.GetString("SharpReport.Wizard.PushModel.AvailableFields"); |
||||
} |
||||
|
||||
|
||||
void BtnPathClick(object sender, System.EventArgs e) |
||||
{ |
||||
using (OpenFileDialog fdiag = new OpenFileDialog()) { |
||||
fdiag.AddExtension = true; |
||||
fdiag.DefaultExt = GlobalValues.XsdExtension; |
||||
fdiag.Filter = GlobalValues.XsdFileFilter; |
||||
fdiag.Multiselect = false; |
||||
if (fdiag.ShowDialog() == DialogResult.OK) |
||||
{ |
||||
string fileName = fdiag.FileName; |
||||
this.txtPath.Text = fileName; |
||||
FillDataGrid(fileName); |
||||
base.EnableNext = true; |
||||
base.EnableFinish= true; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
#region DataGridView
|
||||
|
||||
void FillDataGrid(string fileName) |
||||
{ |
||||
this.resultDataSet = new DataSet(); |
||||
this.resultDataSet.Locale = CultureInfo.CurrentCulture; |
||||
resultDataSet.ReadXml (fileName); |
||||
this.grdQuery.DataSource = resultDataSet.Tables[0]; |
||||
WizardHelper.SetupGridView(this.grdQuery); |
||||
grdQuery.AllowUserToOrderColumns = true; |
||||
base.EnableFinish = true; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region overrides
|
||||
|
||||
public override bool ReceiveDialogMessage(DialogMessage message) |
||||
{ |
||||
|
||||
reportStructure = (ReportStructure)base.CustomizationObject; |
||||
base.NextWizardPanelID = "Layout"; |
||||
|
||||
|
||||
if (message == DialogMessage.Activated) { |
||||
WriteResult(); |
||||
base.EnableNext = true; |
||||
} |
||||
|
||||
else if (message == DialogMessage.Next) |
||||
{ |
||||
WriteResult(); |
||||
base.EnableNext = true; |
||||
} |
||||
else if (message == DialogMessage.Finish) { |
||||
WriteResult(); |
||||
base.EnableNext = true; |
||||
base.EnableFinish = true; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
|
||||
|
||||
private void WriteResult () |
||||
{ |
||||
if (this.resultDataSet != null) { |
||||
// check reordering of columns
|
||||
DataGridViewColumn[] displayCols; |
||||
DataGridViewColumnCollection dc = this.grdQuery.Columns; |
||||
|
||||
displayCols = new DataGridViewColumn[dc.Count]; |
||||
|
||||
for (int i = 0; i < dc.Count; i++){ |
||||
if (dc[i].Visible) { |
||||
displayCols[dc[i].DisplayIndex] = dc[i]; |
||||
} |
||||
} |
||||
|
||||
reportStructure.ReportItemCollection.Clear(); |
||||
var items = WizardHelper.CreateItemsCollection(this.resultDataSet,displayCols); |
||||
reportStructure.ReportItemCollection.AddRange(items); |
||||
|
||||
var abstractColumns = WizardHelper.AvailableFieldsCollection(this.resultDataSet); |
||||
if (abstractColumns != null) { |
||||
reportStructure.AvailableFieldsCollection.Clear(); |
||||
reportStructure.AvailableFieldsCollection.AddRange(abstractColumns); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.txtPath = new System.Windows.Forms.TextBox(); |
||||
this.checkedListBox = new System.Windows.Forms.CheckedListBox(); |
||||
this.btnPath = new System.Windows.Forms.Button(); |
||||
this.label1 = new System.Windows.Forms.Label(); |
||||
this.label2 = new System.Windows.Forms.Label(); |
||||
this.grdQuery = new System.Windows.Forms.DataGridView(); |
||||
((System.ComponentModel.ISupportInitialize)(this.grdQuery)).BeginInit(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// txtPath
|
||||
//
|
||||
this.txtPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.txtPath.Location = new System.Drawing.Point(16, 63); |
||||
this.txtPath.Name = "txtPath"; |
||||
this.txtPath.Size = new System.Drawing.Size(338, 20); |
||||
this.txtPath.TabIndex = 0; |
||||
//
|
||||
// checkedListBox
|
||||
//
|
||||
this.checkedListBox.Location = new System.Drawing.Point(64, 120); |
||||
this.checkedListBox.Name = "checkedListBox"; |
||||
this.checkedListBox.Size = new System.Drawing.Size(248, 109); |
||||
this.checkedListBox.TabIndex = 3; |
||||
this.checkedListBox.Visible = false; |
||||
//
|
||||
// btnPath
|
||||
//
|
||||
this.btnPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.btnPath.FlatStyle = System.Windows.Forms.FlatStyle.Flat; |
||||
this.btnPath.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); |
||||
this.btnPath.Location = new System.Drawing.Point(383, 58); |
||||
this.btnPath.Name = "btnPath"; |
||||
this.btnPath.Size = new System.Drawing.Size(41, 25); |
||||
this.btnPath.TabIndex = 1; |
||||
this.btnPath.Text = "..."; |
||||
this.btnPath.Click += new System.EventHandler(this.BtnPathClick); |
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(64, 32); |
||||
this.label1.Name = "label1"; |
||||
this.label1.Size = new System.Drawing.Size(160, 24); |
||||
this.label1.TabIndex = 2; |
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(0))); |
||||
this.label2.Location = new System.Drawing.Point(16, 95); |
||||
this.label2.Name = "label2"; |
||||
this.label2.Size = new System.Drawing.Size(112, 22); |
||||
this.label2.TabIndex = 4; |
||||
this.label2.Text = "aaaaaa"; |
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.grdQuery.AllowUserToOrderColumns = true; |
||||
this.grdQuery.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.grdQuery.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; |
||||
this.grdQuery.Location = new System.Drawing.Point(16, 120); |
||||
this.grdQuery.Name = "dataGridView1"; |
||||
this.grdQuery.Size = new System.Drawing.Size(408, 189); |
||||
this.grdQuery.TabIndex = 5; |
||||
//
|
||||
// PushModelPanel
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(449, 332); |
||||
this.Controls.Add(this.grdQuery); |
||||
this.Controls.Add(this.label2); |
||||
this.Controls.Add(this.checkedListBox); |
||||
this.Controls.Add(this.label1); |
||||
this.Controls.Add(this.btnPath); |
||||
this.Controls.Add(this.txtPath); |
||||
this.Name = "PushModelPanel"; |
||||
((System.ComponentModel.ISupportInitialize)(this.grdQuery)).EndInit(); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
} |
||||
private System.Windows.Forms.DataGridView grdQuery; |
||||
#endregion
|
||||
|
||||
|
||||
} |
||||
} |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
</root> |
@ -1,385 +0,0 @@
@@ -1,385 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Data; |
||||
using System.Data.Common; |
||||
using System.Drawing; |
||||
using System.Globalization; |
||||
using System.Windows.Forms; |
||||
using System.Xml; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Core.WinForms; |
||||
using ICSharpCode.Data.Core.Enums; |
||||
using ICSharpCode.Data.Core.Interfaces; |
||||
using ICSharpCode.Reports.Addin.Commands; |
||||
using ICSharpCode.Reports.Core; |
||||
using ICSharpCode.Reports.Core.DataAccess; |
||||
using ICSharpCode.Reports.Core.Globals; |
||||
using ICSharpCode.Reports.Core.Project.BaseClasses; |
||||
using ICSharpCode.Reports.Core.Project.Interfaces; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.Reports.Addin.ReportWizard |
||||
{ |
||||
/// <summary>
|
||||
/// This Class show the Result of the Query build in the previos window,
|
||||
/// also we can create *.xsd File's (Schema onla and/or Data + Schema)
|
||||
/// </summary>
|
||||
public class ResultPanel : AbstractWizardPanel |
||||
{ |
||||
|
||||
const string defaultContextMenu = "/ReportGenerator/ResultPanel/ContextMenuDefault"; |
||||
|
||||
private System.Windows.Forms.Label label1; |
||||
private System.Windows.Forms.TextBox txtSqlString; |
||||
private ReportStructure reportStructure; |
||||
private ReportModel model; |
||||
private DataSet resultDataSet; |
||||
|
||||
|
||||
#region Constructor
|
||||
|
||||
public ResultPanel() |
||||
{ |
||||
InitializeComponent(); |
||||
base.EnableFinish = true; |
||||
base.EnableCancel = true; |
||||
base.EnableNext = true; |
||||
base.Refresh(); |
||||
this.label1.Text = ResourceService.GetString("SharpReport.Wizard.PullModel.CommandText"); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Fill data
|
||||
|
||||
private DataSet FillGrid() |
||||
{ |
||||
SqlQueryChecker.Check(model.ReportSettings.CommandType, |
||||
model.ReportSettings.CommandText); |
||||
|
||||
DataSet dataSet = ResultPanel.CreateDataSet (); |
||||
|
||||
this.txtSqlString.Text = model.ReportSettings.CommandText; |
||||
|
||||
var dataAccess = new SqlDataAccessStrategy(model.ReportSettings); |
||||
|
||||
switch (model.ReportSettings.CommandType) { |
||||
case CommandType.Text: |
||||
dataSet = DataSetFromSqlText(dataAccess); |
||||
break; |
||||
case CommandType.StoredProcedure: |
||||
dataSet = DataSetFromStoredProcedure(dataAccess); |
||||
break; |
||||
case CommandType.TableDirect: |
||||
MessageService.ShowError("TableDirect is not suppurted at the moment"); |
||||
break; |
||||
default: |
||||
throw new Exception("Invalid value for CommandType"); |
||||
} |
||||
return dataSet; |
||||
} |
||||
|
||||
|
||||
string CreateTableName(ReportStructure reportStructure) |
||||
{ |
||||
ITable t = reportStructure.IDatabaseObjectBase as ITable; |
||||
string str = String.Empty; |
||||
|
||||
if (t != null) { |
||||
str = t.Name; |
||||
} |
||||
else |
||||
{ |
||||
str = "Table1"; |
||||
} |
||||
return str; |
||||
} |
||||
|
||||
|
||||
private DataSet DataSetFromSqlText(IDataAccessStrategy dataAccess) |
||||
{ |
||||
var dataSet = dataAccess.ReadData(); |
||||
dataSet.Tables[0].TableName = CreateTableName (reportStructure); |
||||
return dataSet; |
||||
} |
||||
|
||||
|
||||
private DataSet DataSetFromStoredProcedure(IDataAccessStrategy dataAccess) |
||||
{ |
||||
DataSet dataSet = ResultPanel.CreateDataSet(); |
||||
|
||||
IProcedure procedure = reportStructure.IDatabaseObjectBase as IProcedure; |
||||
var sqlParamCollection = CreateSqlParameters(procedure); |
||||
|
||||
if (sqlParamCollection.Count > 0) { |
||||
reportStructure.SqlQueryParameters.AddRange(sqlParamCollection); |
||||
model.ReportSettings.SqlParameters.AddRange(sqlParamCollection); |
||||
CollectParamValues(model.ReportSettings); |
||||
|
||||
} |
||||
dataSet = dataAccess.ReadData(); |
||||
dataSet.Tables[0].TableName = procedure.Name; |
||||
return dataSet; |
||||
} |
||||
|
||||
|
||||
void CollectParamValues(ReportSettings reportSettings){ |
||||
|
||||
CollectParametersCommand p = new CollectParametersCommand(reportSettings); |
||||
p.Run(); |
||||
} |
||||
|
||||
|
||||
SqlParameterCollection CreateSqlParameters(IProcedure procedure) |
||||
{ |
||||
SqlParameterCollection col = new SqlParameterCollection(); |
||||
SqlParameter par = null; |
||||
foreach (var element in procedure.Items) { |
||||
DbType dbType = TypeHelpers.DbTypeFromStringRepresenation(element.DataType); |
||||
par = new SqlParameter(element.Name,dbType,"",ParameterDirection.Input); |
||||
|
||||
if (element.ParameterMode == ParameterMode.In) { |
||||
par.ParameterDirection = ParameterDirection.Input; |
||||
|
||||
} else if (element.ParameterMode == ParameterMode. InOut){ |
||||
par.ParameterDirection = ParameterDirection.InputOutput; |
||||
} |
||||
col.Add(par); |
||||
} |
||||
return col; |
||||
} |
||||
|
||||
|
||||
private static DataSet CreateDataSet() |
||||
{ |
||||
DataSet dataSet = new DataSet(); |
||||
dataSet.Locale = CultureInfo.CurrentCulture; |
||||
return dataSet; |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private void GrdQueryMouseUp(object sender, System.Windows.Forms.MouseEventArgs e){ |
||||
|
||||
if (e.Button == MouseButtons.Right) { |
||||
DataGridView.HitTestInfo hti = this.grdQuery.HitTest(e.X,e.Y); |
||||
switch (hti.Type) { |
||||
case DataGridViewHitTestType.ColumnHeader: |
||||
break; |
||||
default: |
||||
ContextMenuStrip defMen = MenuService.CreateContextMenu (this, |
||||
ResultPanel.defaultContextMenu); |
||||
defMen.Show (this.grdQuery,new Point (e.X,e.Y)); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
#region called from commands
|
||||
|
||||
/// <summary>
|
||||
/// Create a *.xsd File
|
||||
/// </summary>
|
||||
/// <param name="schemaOnly">true = schema only</param>
|
||||
|
||||
public void SaveXsdFile(bool schemaOnly){ |
||||
|
||||
using (SaveFileDialog saveFileDialog = new SaveFileDialog()){ |
||||
saveFileDialog.Filter = GlobalValues.XsdFileFilter; |
||||
saveFileDialog.DefaultExt = GlobalValues.XsdExtension; |
||||
saveFileDialog.AddExtension = true; |
||||
|
||||
if(saveFileDialog.ShowDialog() == DialogResult.OK){ |
||||
using (System.IO.FileStream fileStream = |
||||
new System.IO.FileStream(saveFileDialog.FileName, |
||||
System.IO.FileMode.Create)){ |
||||
XmlTextWriter xmlWriter = new XmlTextWriter(fileStream, System.Text.Encoding.UTF8); |
||||
xmlWriter.WriteStartDocument(true); |
||||
|
||||
if (schemaOnly) { |
||||
this.resultDataSet.WriteXmlSchema(xmlWriter); |
||||
} else { |
||||
this.resultDataSet.WriteXml(xmlWriter,XmlWriteMode.WriteSchema); |
||||
} |
||||
xmlWriter.Close(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region overrides
|
||||
|
||||
public override bool ReceiveDialogMessage(DialogMessage message) |
||||
{ |
||||
reportStructure = (ReportStructure)base.CustomizationObject; |
||||
if (message == DialogMessage.Activated) |
||||
{ |
||||
ShowData(); |
||||
base.EnableNext = true; |
||||
base.EnableFinish = true; |
||||
|
||||
} |
||||
else if (message == DialogMessage.Next) |
||||
{ |
||||
base.EnableNext = true; |
||||
base.EnableFinish = true; |
||||
WriteResult(); |
||||
} |
||||
else if (message == DialogMessage.Finish) |
||||
{ |
||||
WriteResult(); |
||||
|
||||
base.EnableNext = true; |
||||
base.EnableFinish = true; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
|
||||
void ShowData() |
||||
{ |
||||
this.model = reportStructure.CreateAndFillReportModel(); |
||||
this.resultDataSet = FillGrid(); |
||||
if (resultDataSet.Tables.Count > 0) { |
||||
SetupGrid (); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
private void SetupGrid() |
||||
{ |
||||
if (this.resultDataSet != null) { |
||||
this.grdQuery.DataSource = this.resultDataSet.Tables[0]; |
||||
WizardHelper.SetupGridView(this.grdQuery); |
||||
this.grdQuery.AllowUserToOrderColumns = true; |
||||
} |
||||
} |
||||
|
||||
|
||||
private void WriteResult () |
||||
{ |
||||
if (this.resultDataSet != null) { |
||||
// check reordering of columns
|
||||
DataGridViewColumn[] displayCols; |
||||
DataGridViewColumnCollection dc = this.grdQuery.Columns; |
||||
|
||||
displayCols = new DataGridViewColumn[dc.Count]; |
||||
for (int i = 0; i < dc.Count; i++){ |
||||
if (dc[i].Visible) { |
||||
displayCols[dc[i].DisplayIndex] = dc[i]; |
||||
} |
||||
} |
||||
|
||||
ReportItemCollection destItems = WizardHelper.CreateItemsCollection(this.resultDataSet,displayCols); |
||||
reportStructure.ReportItemCollection.Clear(); |
||||
reportStructure.ReportItemCollection.AddRange(destItems); |
||||
|
||||
|
||||
var abstractColumns = WizardHelper.AvailableFieldsCollection(this.resultDataSet); |
||||
if (abstractColumns != null) { |
||||
reportStructure.AvailableFieldsCollection.Clear(); |
||||
reportStructure.AvailableFieldsCollection.AddRange(abstractColumns); |
||||
} |
||||
|
||||
} |
||||
base.EnableNext = true; |
||||
base.EnableFinish = true; |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
|
||||
if (this.grdQuery != null) { |
||||
this.grdQuery.Dispose(); |
||||
} |
||||
if (this.txtSqlString != null) { |
||||
this.txtSqlString.Dispose(); |
||||
} |
||||
if (this.resultDataSet != null) { |
||||
this.resultDataSet.Dispose(); |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.txtSqlString = new System.Windows.Forms.TextBox(); |
||||
this.label1 = new System.Windows.Forms.Label(); |
||||
this.grdQuery = new System.Windows.Forms.DataGridView(); |
||||
((System.ComponentModel.ISupportInitialize)(this.grdQuery)).BeginInit(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// txtSqlString
|
||||
//
|
||||
this.txtSqlString.Location = new System.Drawing.Point(16, 48); |
||||
this.txtSqlString.Name = "txtSqlString"; |
||||
this.txtSqlString.Size = new System.Drawing.Size(408, 20); |
||||
this.txtSqlString.TabIndex = 0; |
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(16, 24); |
||||
this.label1.Name = "label1"; |
||||
this.label1.Size = new System.Drawing.Size(120, 16); |
||||
this.label1.TabIndex = 1; |
||||
//
|
||||
// grdQuery
|
||||
//
|
||||
this.grdQuery.AllowUserToAddRows = false; |
||||
this.grdQuery.AllowUserToDeleteRows = false; |
||||
this.grdQuery.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; |
||||
this.grdQuery.Location = new System.Drawing.Point(16, 89); |
||||
this.grdQuery.Name = "grdQuery"; |
||||
this.grdQuery.Size = new System.Drawing.Size(408, 214); |
||||
this.grdQuery.TabIndex = 2; |
||||
this.grdQuery.MouseUp += new System.Windows.Forms.MouseEventHandler(this.GrdQueryMouseUp); |
||||
//
|
||||
// ResultPanel
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(529, 332); |
||||
this.Controls.Add(this.grdQuery); |
||||
this.Controls.Add(this.label1); |
||||
this.Controls.Add(this.txtSqlString); |
||||
this.Name = "ResultPanel"; |
||||
((System.ComponentModel.ISupportInitialize)(this.grdQuery)).EndInit(); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
} |
||||
private System.Windows.Forms.DataGridView grdQuery; |
||||
#endregion
|
||||
} |
||||
} |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
</root> |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue