public static bool Display(ResultSetViewModel model, IDesignerContext context) { var window = new ResultSetEditorWindow(model, context); window.Owner = Application.Current.MainWindow; return(window.ShowDialog() ?? false); }
public static void Validate(Property property, IDesignerContext context, CustomValidationResults validations, ValidateDynamicValue validationMethod) { if (!property.IsVisible) { return; } var propertyValue = property.Value as string ?? string.Empty; if (string.IsNullOrEmpty(propertyValue)) { return; } var handler = SqlStringHandler.GetSqlStringHandler(propertyValue); var validationErrors = new StringBuilder(); foreach (var expression in handler.DistinctExpressionTexts) { string validationMessage; if (!validationMethod(context.CreateExpression(expression), out validationMessage)) { validationErrors.AppendLine(validationMessage); } } if (validationErrors.Length > 0) { validations.AddValidationResult(property.Name, validationErrors.ToString().TrimEnd(Environment.NewLine.ToCharArray()), CustomValidationType.Error); } }
private ResultSetEditorWindow(ResultSetViewModel model, IDesignerContext designerContext) { InitializeComponent(); DataContext = model; model.ShowMessage += model_ShowMessage; }
public ExecuteStoredProcedureDesigner(IFunctionData data, IDesignerContext context) : base(data, context) { foreach (var nextResultSet in ResultSets.Where(r => r.CustomType != null)) { nextResultSet.CustomType = context.CustomTypes.FirstOrDefault(t => t.Id == nextResultSet.CustomType.Id); } }
public SelectDesignTimeDataSourceForm(IDesignerContext context, MyReportBase report, Action<DesignTimeDataSourceDefinition> callback) { InitializeComponent(); _context = context; _report = report; _callback = callback; }
public ReadPdfDesigner(IDesignerContext context) : base(context) { Version = ReadPdfUpdater.Instance.CurrentVersion; InitializeProperties(); BuildOutput(); }
public PdfOperationsDesigner(IDesignerContext context) : base(context) { Version = PdfOperationsUpdater.Instance.CurrentVersion; InitializeProperties(); BuildOutput(); }
public SelectDesignTimeDataSourceForm(IDesignerContext context, MyReportBase report, Action <DesignTimeDataSourceDefinition> callback) { InitializeComponent(); _context = context; _report = report; _callback = callback; }
public ExecuteSQLDesigner(IFunctionData functionData, IDesignerContext context) : base(functionData, context) { if (ResultTypeValue.CustomType != null) { ResultTypeValue.CustomType = context.CustomTypes.FirstOrDefault(t => t.Id == ResultTypeValue.CustomType.Id); } }
public BinaryFileReadDesigner(IDesignerContext context) : base(context) { Version = BinaryFileReadFunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(FileShared.FilePathPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); SetPropertyAttributes(); Output = TypeReference.CreateList(typeof(byte)); }
public FileDesignerBase(IDesignerContext context) : base(context) { Properties.Add(new Property(FileShared.FilePathPropertyName, typeof(FileHandleType), ValueUseOption.RuntimeRead, null)); Properties.Add(new Property(FileShared.OwnsFileHandlePropertyName, typeof(bool), ValueUseOption.DesignTime, true) { IsVisible = false }); SetPropertyAttributes(); }
public static void UseReportControllerDuringPrintPreview(this IDesignerContext designerContext) { var controller = designerContext.DesignForm.DesignMdiController; controller.DesignPanelLoaded += (s, e) => { var designPanel = (XRDesignPanel)s; // Override Print Preview Behavior controller.AddCommandHandler(new PreviewCommandHandler(designPanel, designerContext)); }; }
public TextFileReadDesigner(IDesignerContext context) : base(context) { Properties.Add(new Property(FileShared.FilePathPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(TextFileReadShared.CodepagePropertyName, typeof(TextCodepage), ValueUseOption.DesignTime, TextCodepage.Default)); Properties.Add(new Property(TextFileReadShared.ReadTypePropertyName, typeof(FileReadOptions), ValueUseOption.DesignTime, FileReadOptions.Complete)); Properties.Add(new Property(TextFileReadShared.FieldsPropertyName, typeof(TextFileReaderFields), ValueUseOption.DesignTime, new TextFileReaderFields())); Properties.Add(new Property(TextFileReadShared.SkipHeaderLinesPropertyName, typeof(int), ValueUseOption.DesignTime, 0)); Properties.Add(new Property(TextFileReadShared.SkipFooterLinesPropertyName, typeof(int), ValueUseOption.DesignTime, 0)); BuildExecutionPaths(); SetPropertyAttributes(); }
public BinaryFileWriteDesigner(IDesignerContext context) : base(context) { Version = BinaryFileWriteFunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(BinaryFileWriteShared.ContentsPropertyName, typeof(IEnumerable <byte>), ValueUseOption.RuntimeRead, null)); Properties.Add(new Property(BinaryFileWriteShared.FileExistsPropertyName, typeof(ExistOptions), ValueUseOption.DesignTime, ExistOptions.AppendData)); Properties.Add(new Property(BinaryFileWriteShared.FileDoesNotExistPropertyName, typeof(DoesNotExistOptions), ValueUseOption.DesignTime, DoesNotExistOptions.CreateFile)); SetPropertyAttributes(); BuildOutput(); }
public MongoDBWriteDesigner(IDesignerContext context) : base(context) { Properties.Add(new Property(MongoDBWriteShared.Names.Operation, typeof(MongoDBWriteOperation), ValueUseOption.DesignTime, MongoDBWriteOperation.Insert)); Properties.Add(new Property(MongoDBWriteShared.Names.InsertIfNotFound, typeof(bool), ValueUseOption.DesignTime, false)); Properties.Add(new Property(MongoDBWriteShared.Names.UpdateOperation, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBWriteShared.Names.ConnectionString, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBWriteShared.Names.Collection, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBWriteShared.Names.Criteria, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBWriteShared.Names.Data, typeof(object), ValueUseOption.RuntimeRead, string.Empty)); Initialise(); }
public TextFileWriteDesigner(IDesignerContext context) : base(context) { Version = FunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(TextFileWriteShared.ContentsPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(TextFileWriteShared.DestinationCodepagePropertyName, typeof(TextCodepage), ValueUseOption.DesignTime, TextCodepage.Default)); Properties.Add(new Property(TextFileWriteShared.FileDoesNotExistPropertyName, typeof(DoesNotExistOptions), ValueUseOption.DesignTime, DoesNotExistOptions.CreateFile)); Properties.Add(new Property(TextFileWriteShared.FileExistsPropertyName, typeof(ExistOptions), ValueUseOption.DesignTime, ExistOptions.AppendData)); SetPropertyAttributes(); BuildOutput(); }
public static void SetupDesignTimeSubreportDatasourcePassing(this IDesignerContext designContext) { // Selected Subreport on Design Panel SubreportBase selectedSubreport = null; var controller = designContext.DesignForm.DesignMdiController; // Design-Time Event Handler controller.OnDesignPanelActivated(designPanel => { var report = designPanel.Report; // TODO: Set DesignPanel Filename? // string url; // report.Extensions.TryGetValue("StorageID", out url); // designPanel.FileName = url; // Populate Design-Time Datasource report.TryAs <MyReportBase>(myReport => { if (selectedSubreport == null) { // Stand-alone Report myReport.ChangeDesignTimeDatasourceToDefault(designContext); } else { // Subreport was Double-clicked, new DesignPanel has been activated for it // Pass Design-Time DataSource from Parent to Subreport PassDesignTimeDataSourceToSubreport(selectedSubreport, myReport, designContext); } }); // Capture selected Subreport // So we can enable double-clicking Subreport designPanel.SelectionChanged += (sender, e) => { var selected = designPanel.GetSelectedComponents(); selectedSubreport = selected.OfType <SubreportBase>().SingleOrDefault(); #if DEBUG if (selectedSubreport != null) { var path = selectedSubreport.Band.GetFullDataMemberPath(); Debug.WriteLine("You selected subreport with Path: {0}".FormatString(path)); } #endif }; }); }
public ExecuteSQLDesigner(IDesignerContext context) : base(context) { Version = FunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(ExecuteSQLShared.SqlStatementPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(ExecuteSQLShared.TimeoutPropertyName, typeof(int), ValueUseOption.DesignTime, 60)); Properties.Add(new Property(ExecuteSQLShared.ReturnOptionsPropertyName, typeof(ExecuteSQLShared.ReturnModeType), ValueUseOption.DesignTime, ExecuteSQLShared.ReturnModeType.RowByRow)); Properties.Add(new Property(ExecuteSQLShared.ResultTypePropertyName, typeof(ResultType), ValueUseOption.DesignTime, new ResultType())); SetPropertyAttributes(); BuildExecutionPaths(); BuildResultType(); }
public FileListDesigner(IDesignerContext context) : base(context) { Version = FileListFunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(FileListShared.FolderPathPropertyName, typeof(string), ValueUseOption.RuntimeRead, "")); Properties.Add(new Property(FileListShared.SearchPatternPropertyName, typeof(string), ValueUseOption.RuntimeRead, "")); Properties.Add(new Property(FileListShared.IncludeSubfoldersPropertyName, typeof(bool), ValueUseOption.DesignTime, false)); Properties.Add(new Property(FileListShared.ReturnFullPathPropertyName, typeof(bool), ValueUseOption.DesignTime, false)); Properties.Add(new Property(FileListShared.LoopResultsPropertyName, typeof(bool), ValueUseOption.DesignTime, false)); SetPropertyAttributes(); BuildDataOut(); }
public BeginTransactionDesigner(IDesignerContext context) : base(context) { Properties[DbShared.ConnectionTypePropertyName].IsVisible = false; Properties.Add(new Property(BeginTransactionShared.ConnectionTypePropertyName, typeof(ConnectionType), ValueUseOption.DesignTime, ConnectionType.SqlServer)); Properties.Add(new Property(BeginTransactionShared.SqlServerIsolationLevelPropertyName, typeof(SqlServerIsolationLevel), ValueUseOption.DesignTime, SqlServerIsolationLevel.ReadCommitted)); Properties.Add(new Property(BeginTransactionShared.OracleIsolationLevelPropertyName, typeof(OracleIsolationLevel), ValueUseOption.DesignTime, OracleIsolationLevel.ReadCommitted)); Properties.Add(new Property(BeginTransactionShared.OleDbIsolationLevelPropertyName, typeof(OleDbIsolationLevel), ValueUseOption.DesignTime, OleDbIsolationLevel.ReadCommitted)); Properties.Add(new Property(BeginTransactionShared.OdbcIsolationLevelPropertyName, typeof(OdbcIsolationLevel), ValueUseOption.DesignTime, OdbcIsolationLevel.ReadCommitted)); SetPropertyAttributes(); var output = TypeReference.CreateResource(typeof(Transaction)); ExecutionPaths.Add(BeginTransactionShared.ExecutionPathName, BeginTransactionShared.ExecutionPathName, output, IterationHint.Once); }
public FileOpenDesigner(IDesignerContext context) : base(context) { Version = FunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(FileOpenShared.FilePathPropertyName, typeof(string), ValueUseOption.RuntimeRead, null)); Properties.Add(new Property(FileOpenShared.IsTextPropertyName, typeof(bool), ValueUseOption.DesignTime, true)); Properties.Add(new Property(FileOpenShared.CodepagePropertyName, typeof(TextCodepage), ValueUseOption.DesignTime, TextCodepage.Default)); Properties.Add(new Property(FileOpenShared.FileDoesNotExistPropertyName, typeof(DoesNotExistOptions), ValueUseOption.DesignTime, DoesNotExistOptions.CreateFile)); Properties.Add(new Property(FileOpenShared.FileExistsPropertyName, typeof(ExistOptions), ValueUseOption.DesignTime, ExistOptions.AppendData)); SetPropertyAttributes(); ExecutionPaths.Add(FileOpenShared.ExecutionPathName, FileOpenShared.ExecutionPathName, BuildExecutionPathOutput(), IterationHint.Once); Output = TypeReference.Create(typeof(string)); }
public DbDesignerBase(IDesignerContext context) : base(context) { Properties.Add(new Property(DbShared.ConnectionTypePropertyName, typeof(ConnectionTypeSelection), ValueUseOption.DesignTime, ConnectionTypeSelection.SqlServer)); Properties.Add(new Property(DbShared.DesignTimeConnectionTypePropertyName, typeof(ConnectionType?), ValueUseOption.DesignTime, null) { IsVisible = false }); Properties.Add(new Property(DbShared.DesignTimeConnectionStringPropertyName, typeof(string), ValueUseOption.DesignTime, string.Empty) { IsVisible = false }); SetPropertyAttributes(); RefreshConnectionString(); }
public ExecuteStoredProcedureDesigner(IDesignerContext context) : base(context) { Version = FunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(ExecuteStoredProcedureShared.StoredProcedurePropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(ExecuteStoredProcedureShared.DesignTimeStoredProcedurePropertyName, typeof(string), ValueUseOption.DesignTime, string.Empty) { IsVisible = false }); Properties.Add(new Property(ExecuteStoredProcedureShared.ParametersPropertyName, typeof(DatabaseModel.ProcedureParameters), ValueUseOption.DesignTime, new DatabaseModel.ProcedureParameters())); Properties.Add(new Property(ExecuteStoredProcedureShared.ResultSetCountPropertyName, typeof(int), ValueUseOption.DesignTime, 0)); Properties.Add(new Property(ExecuteStoredProcedureShared.OutputOptionPropertyName, typeof(OutputOption), ValueUseOption.DesignTime, OutputOption.RowByRow)); SetPropertyAttributes(); }
public MongoDBMapReduceDesigner(IDesignerContext context) : base(context) { Version = MongoDBReadFunctionUpdater.Instance.CurrentVersion; Properties.Add(new Property(MongoDBMapReduceShared.Names.ConnectionString, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.Collection, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.Query, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.OutputType, typeof(ITypeReference), ValueUseOption.DesignTime, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.Sort, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.Limit, typeof(int), ValueUseOption.RuntimeRead, 0)); Properties.Add(new Property(MongoDBMapReduceShared.Names.Map, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.Reduce, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.Finalize, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(MongoDBMapReduceShared.Names.ReturnOptionsPropertyName, typeof(MongoDBMapReduceShared.ReturnModeType), ValueUseOption.DesignTime, MongoDBMapReduceShared.ReturnModeType.RowByRow)); Initialise(); }
public DbBulkCopyDesigner(IDesignerContext context) : base(context) { Version = FunctionUpdater.Instance.CurrentVersion; Properties[DbShared.ConnectionTypePropertyName].IsVisible = false; Properties.Add(new Property(DbBulkCopyShared.ConnectionTypePropertyName, typeof(ConnectionType), ValueUseOption.DesignTime, Database.DbBulkCopy.ConnectionType.SqlServer)); Properties.Add(new Property(DbBulkCopyShared.TimeoutPropertyName, typeof(int), ValueUseOption.DesignTime, 30)); Properties.Add(new Property(DbBulkCopyShared.TableNamePropertyName, typeof(string), ValueUseOption.DesignTime, string.Empty)); Properties.Add(new Property(DbBulkCopyShared.ColumnsPropertyName, typeof(DatabaseModel.Columns), ValueUseOption.DesignTime, new DatabaseModel.Columns()) { IsVisible = false }); Properties.Add(new Property(DbBulkCopyShared.BatchSizePropertyName, typeof(int), ValueUseOption.DesignTime, 10000)); SetPropertyAttributes(); }
public override FunctionDesigner CreateDesigner(IFunctionData data, IDesignerContext context) { if (String.IsNullOrEmpty(data.Version)) { data = data.UpdateVersion("1"); } switch (data.Version) { case "1": return(new V1.DirectoryOperationsDesigner(data, context)); case "2": return(new V2.DirectoryOperationsDesigner(data, context)); default: throw new Exception(string.Format("Unknown version [{0}] specified.", data.Version)); } }
public static bool ChangeDesignTimeDatasource(this MyReportBase report, DesignTimeDataSourceDefinition definition, IDesignerContext designContext) { object datasource = null; if (definition != null) { // Get Traversed Datasource var traversedResult = designContext.DataSourceLocator.GetTraversedObjectFromDataSourceDefinition(definition); datasource = traversedResult.TraversedDataSource; if (traversedResult.RootDataSource == null) MessageBox.Show("Datasource: {0} could not be found or did not return a datasource.".FormatString(definition.ToString())); else { // Store Definition on Report // If already in list, Remore & Re-add, so as to move definition to index 0 if (report.DesignTimeDataSources.Contains(definition)) { var index = report.DesignTimeDataSources.IndexOf(definition); report.DesignTimeDataSources.RemoveAt(index); } // Add item as first in list - So we know it was the last one used report.DesignTimeDataSources.Insert(0, definition); // Verify Traversal worked if (traversedResult.TraversedDataSource == null) MessageBox.Show("Datasource: {0} was found, but the traversed Relation Path did not return a value.".FormatString(definition.ToString())); } } // Set DataSource report.SetReportDataSource(datasource); // Refresh Design Panel Fields List var designPanel = designContext.DesignForm.DesignMdiController.ActiveDesignPanel; if (designPanel != null) designPanel.Activate(); return report.DataSource != null; }
public SQLViewModel(ExecuteSQLDesigner executeSQLDesigner) { this.connectionType = executeSQLDesigner.ResolvedConnectionType; this.connectionString = executeSQLDesigner.ResolvedConnectionString; this.sqlStringHandler = new SqlStringHandler(); this.sqlStringHandler.SqlString = executeSQLDesigner.ResolvedSqlStatementValue ?? string.Empty; this.sqlIndex = 0; this.designerContext = executeSQLDesigner.Context; Designer = executeSQLDesigner; this.queryResults = null; this.queryError = String.Empty; DatabaseObjects = new ObservableCollection <NodeViewModel>(); this.refreshIsRunning = false; this.executeSQLIsRunning = false; }
public DirectoryWatchDesigner(IDesignerContext context) : base(context) { Version = ServiceUpdater.Instance.CurrentVersion; Events.Add(new Event { Id = DirectoryWatchShared.ErrorEventEventName, Name = DirectoryWatchShared.ErrorEventEventName, DataType = TypeReference.Create(typeof(string)) }); Properties.Add(new Property(DirectoryWatchShared.BufferSizePropertyName, typeof(int), ValueUseOption.RuntimeRead, 8192)); Properties.Add(new Property(DirectoryWatchShared.FilterPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(DirectoryWatchShared.NotifyFilterPropertyName, typeof(NotifyFilter), ValueUseOption.DesignTime, new NotifyFilter())); Properties.Add(new Property(DirectoryWatchShared.PathPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)); Properties.Add(new Property(DirectoryWatchShared.IncludeSubdirectoriesPropertyName, typeof(bool), ValueUseOption.RuntimeRead, false)); Properties.Add(new Property(DirectoryWatchShared.WatchForChangesPropertyName, typeof(bool), ValueUseOption.DesignTime, false) { Category = watchOptionsCategoryName }); Properties.Add(new Property(DirectoryWatchShared.WatchForCreationPropertyName, typeof(bool), ValueUseOption.DesignTime, false) { Category = watchOptionsCategoryName }); Properties.Add(new Property(DirectoryWatchShared.WatchForDeletionsPropertyName, typeof(bool), ValueUseOption.DesignTime, false) { Category = watchOptionsCategoryName }); Properties.Add(new Property(DirectoryWatchShared.WatchForRenamingPropertyName, typeof(bool), ValueUseOption.DesignTime, false) { Category = watchOptionsCategoryName }); SetPropertyAttributes(); Properties[DirectoryWatchShared.WatchForCreationPropertyName].Value = true; }
public TextFileReadDesigner(IFunctionData data, IDesignerContext context) : base(data, context) { }
public static bool ChangeDesignTimeDatasourceToDefault(this MyReportBase report, IDesignerContext designContext) { var selectedSource = report.DesignTimeDataSources.FirstOrDefault(); return ChangeDesignTimeDatasource(report, selectedSource, designContext); }
public AddWatermarkDesigner(IFunctionData data, IDesignerContext context) : base(data, context) { }
public AddWatermarkDesigner(IDesignerContext context) : base(context) { InitializeProperties(); }
public PreviewCommandHandler(XRDesignPanel designPanel, IDesignerContext designerContext) { _designPanel = designPanel; _designerContext = designerContext; }
public static void PassDesignTimeDataSourceToSubreport(SubreportBase container, MyReportBase subreport, IDesignerContext designContext) { var parentReport = (MyReportBase)container.RootReport; var parentDataSourceItem = parentReport.GetSelectedDesignTimeDatasource(); if (parentDataSourceItem != null) { var path = DesignTimeHelper.GetFullDataMemberPath(container.Band); var datasourceDefinition = new DesignTimeDataSourceDefinition(parentDataSourceItem.DataSourceName, parentDataSourceItem.DataSourceAssemblyLocationPath, path); // Go! subreport.ChangeDesignTimeDatasource(datasourceDefinition, designContext); } }