diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs index 2c6dad31e3..b99024953d 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs @@ -28,29 +28,28 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog List items; PushModelContext context; - public PushDataReport() - { + public PushDataReport(){ InitializeComponent(); items = new List(); _DataGrid.ItemsSource = items; this.context = new PushModelContext(); cboType.ItemsSource = GlobalLists.DataTypeList(); - Projects = GetProjects(); _projectsCbo.ItemsSource = Projects; } + IProject SelectedProject {get;set;} IModelCollection GetProjects(){ var solution = SharpDevelop.SD.ProjectService.CurrentSolution; - return solution.Projects; + return solution == null ? null : solution.Projects; } + public IModelCollection Projects {get; private set;} - IEnumerable GetTypeDefinitions() - { + IEnumerable GetTypeDefinitions(){ if (SelectedProject != null) { var compilation = SharpDevelop.SD.ParserService.GetCompilation(SelectedProject); var definitions = compilation.MainAssembly.TopLevelTypeDefinitions.Where(x => x.Properties.Any()); @@ -59,8 +58,6 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog return null; } - public IModelCollection Projects {get; private set;} - #region SolutionCombo diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs index 4a9735d3e6..6347d78e0b 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs @@ -149,10 +149,7 @@ namespace ICSharpCode.Reporting.Items [Category("Page Settings")] public Size PageSize { get { - if (!Landscape) { - return pageSize; - } - return new Size(pageSize.Height, pageSize.Width); + return !Landscape ? pageSize : new Size(pageSize.Height, pageSize.Width); } // set { pageSize = value; } }