|
|
|
@ -8,12 +8,13 @@
@@ -8,12 +8,13 @@
|
|
|
|
|
*/ |
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Linq; |
|
|
|
|
using ICSharpCode.Core; |
|
|
|
|
using ICSharpCode.NRefactory.TypeSystem; |
|
|
|
|
using ICSharpCode.Reporting.BaseClasses; |
|
|
|
|
using Xceed.Wpf.Toolkit; |
|
|
|
|
using ICSharpCode.Reporting.Addin.Globals; |
|
|
|
|
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels; |
|
|
|
|
using System.Linq; |
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog |
|
|
|
|
{ |
|
|
|
@ -31,17 +32,19 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
@@ -31,17 +32,19 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
|
|
|
|
|
items = new List<AbstractColumn>(); |
|
|
|
|
_DataGrid.ItemsSource = items; |
|
|
|
|
this.context = new PushModelContext(); |
|
|
|
|
var data = new AbstractColumn("MyColumn",typeof(string)); |
|
|
|
|
items.Add(data); |
|
|
|
|
cboType.ItemsSource = GlobalLists.DataTypeList(); |
|
|
|
|
var definitions = GetTypeDefinitions(); |
|
|
|
|
|
|
|
|
|
if (definitions != null) { |
|
|
|
|
var definitions = GetTypeDefinitions(); |
|
|
|
|
if (definitions.Any()) { |
|
|
|
|
_cboTypes.Visibility = System.Windows.Visibility.Visible; |
|
|
|
|
_availTxt.Visibility = System.Windows.Visibility.Visible; |
|
|
|
|
_cboTypes.ItemsSource = definitions; |
|
|
|
|
_cboTypes.SelectedIndex = 0; |
|
|
|
|
} else { |
|
|
|
|
var data = new AbstractColumn("MyColumn", typeof(string)); |
|
|
|
|
items.Add(data); |
|
|
|
|
_projTxt.Text = ResourceService.GetString("SharpReport.Wizard.PushModel.NoProject"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static IEnumerable<ITypeDefinition> GetTypeDefinitions() |
|
|
|
@ -57,15 +60,16 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
@@ -57,15 +60,16 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
|
|
|
|
|
|
|
|
|
|
void _cboTypes_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e){ |
|
|
|
|
|
|
|
|
|
var s = (ITypeDefinition)e.AddedItems[0]; |
|
|
|
|
var l = CreateItemsSource(s); |
|
|
|
|
if (l.Count > 0) { |
|
|
|
|
_DataGrid.ItemsSource = l; |
|
|
|
|
var typeDefinition = (ITypeDefinition)e.AddedItems[0]; |
|
|
|
|
var itemsList = CreateItemsSource(typeDefinition); |
|
|
|
|
if (itemsList.Count > 0) { |
|
|
|
|
_DataGrid.ItemsSource = itemsList; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static List<AbstractColumn> CreateItemsSource(ITypeDefinition s){ |
|
|
|
|
return s.Properties.Select(p => new AbstractColumn(){ |
|
|
|
|
|
|
|
|
|
static List<AbstractColumn> CreateItemsSource(ITypeDefinition typeDefinitions){ |
|
|
|
|
return typeDefinitions.Properties.Select(p => new AbstractColumn(){ |
|
|
|
|
ColumnName = p.Name, |
|
|
|
|
DataTypeName = p.ReturnType.ReflectionName |
|
|
|
|
}).ToList(); |
|
|
|
@ -90,44 +94,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
@@ -90,44 +94,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
|
|
|
|
|
get {return WizardPageType.PushModelPage;} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
private void PopulateTestItems() |
|
|
|
|
{ |
|
|
|
|
TestItems = new ObservableCollection<TestItem>(); |
|
|
|
|
for (int i = 0; i < 5; i++) |
|
|
|
|
{ |
|
|
|
|
TestItem ti = new TestItem(); |
|
|
|
|
ti.Name = "TestItem" + i; |
|
|
|
|
ti.IsSelected = true; |
|
|
|
|
TestItems.Add(ti); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private bool _AllSelected; |
|
|
|
|
public bool AllSelected |
|
|
|
|
{ |
|
|
|
|
get { return _AllSelected; } |
|
|
|
|
set |
|
|
|
|
{ |
|
|
|
|
_AllSelected = value; |
|
|
|
|
TestItems.ToList().ForEach(x => x.IsSelected = value); |
|
|
|
|
NotifyPropertyChanged(m => m.AllSelected); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ObservableCollection<TestItem> _TestItems; |
|
|
|
|
public ObservableCollection<TestItem> TestItems |
|
|
|
|
{ |
|
|
|
|
get { return _TestItems; } |
|
|
|
|
set |
|
|
|
|
{ |
|
|
|
|
_TestItems = value; |
|
|
|
|
NotifyPropertyChanged(m => m.TestItems); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
} |