public override bool ShowConnectionDialog(IConnectionInfo connectionInfo, ConnectionDialogOptions dialogOptions) { var connectionProperties = connectionInfo.GetConnectionProperties(); // Populate the default URI with a demo data: if (dialogOptions.IsNewConnection) { connectionProperties.Uri = "https://services.odata.org/TripPinRESTierService"; } return(new ConnectionDialog(connectionProperties).ShowDialog() == true); }
/// <summary> /// Shows the connection dialog. /// </summary> /// <param name="connectionInfo">The connection info.</param> /// <param name="isNewConnection">if set to <c>true</c> [is new connection].</param> /// <returns></returns> public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions dialogOptions) { if (dialogOptions.IsNewConnection) { _ = new StorageAccountProperties(cxInfo) { UseHttps = true, NumberOfRows = 100 }; } bool?result = new ConnectionDialog(cxInfo).ShowDialog(); return(result == true); }
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions dialogOptions) { var folderBrowserDialog = new FolderWindow(); var result = folderBrowserDialog.ShowDialog(); if (result.HasValue && result == true) { var path = (FolderViewModel)folderBrowserDialog.DataContext; cxInfo.DriverData.Add(new XElement("FileName", path.Path)); cxInfo.DriverData.Add(new XElement("Capitalize", path.Capitalize)); cxInfo.DriverData.Add(new XElement("BufferSize", path.BufferSize)); cxInfo.DriverData.Add(new XElement("RowStrategy", path.RowStrategy)); return(true); } return(false); }
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions connectionDialogOptions) { var properties = new CsvDataContextDriverProperties(cxInfo); if (connectionDialogOptions.IsNewConnection) { properties.Files = string.Join(Environment.NewLine, "# Drag&drop (use Ctrl to add files)", "# Type file paths, or directory paths with pattern like *.csv or **.csv (** will recurse subdirectories)", "# Press Ctrl+Shift+V to insert from clipboard and proceed", $"{FileUtils.GetDefaultDrive()}*.csv"); } if (new ConnectionDialog(properties).ShowDialog() != true) { return(false); } cxInfo.DisplayName = GetConnectionDescription(cxInfo); return(true); }
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions connectionDialogOptions) { var properties = new CsvDataContextDriverProperties(cxInfo); if (connectionDialogOptions.IsNewConnection) { properties.Files = $"{FileExtensions.InlineComment} Drag&drop here (from add files/folder dialogs as well). Ctrl adds files. Alt toggles * and ** masks.".JoinNewLine( $"{FileExtensions.InlineComment} {ConnectionDialog.WildcardsToolTip}.", $"{FileExtensions.InlineComment} Ctrl+V (Ctrl+Alt+V) pastes from clipboard, appends {FileExtensions.DefaultMask} ({FileExtensions.DefaultRecursiveMask}) to folders.", $"{FileExtensions.InlineComment} Ctrl+Shift+V (Ctrl+Shift+Alt+V) clears, pastes from clipboard, appends {FileExtensions.DefaultMask} ({FileExtensions.DefaultRecursiveMask}) to folders and proceeds.", string.Empty, string.Empty); } if (new ConnectionDialog(properties).ShowDialog() != true) { return(false); } cxInfo.DisplayName = GetConnectionDescription(cxInfo); return(true); }
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions dialogOptions) => new ConnectionDialog(cxInfo).ShowDialog() == true;
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions dialogOptions) { var result = new ConnectionDialog(cxInfo).ShowDialog(); return(result == true); }
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions dialogOptions) { // Prompt the user for a custom assembly and type name: return(new ConnectionDialog(cxInfo).ShowDialog() == true); }
//ExplorerItem GetChildItem(ILookup<Type, ExplorerItem> elementTypeLookup, PropertyInfo childProp) //{ // // If the property's type is in our list of entities, then it's a Many:1 (or 1:1) reference. // // We'll assume it's a Many:1 (we can't reliably identify 1:1s purely from reflection). // if (elementTypeLookup.Contains(childProp.PropertyType)) // return new ExplorerItem(childProp.Name, ExplorerItemKind.ReferenceLink, ExplorerIcon.ManyToOne) // { // HyperlinkTarget = elementTypeLookup[childProp.PropertyType].First(), // // FormatTypeName is a helper method that returns a nicely formatted type name. // ToolTipText = FormatTypeName(childProp.PropertyType, true) // }; // // Is the property's type a collection of entities? // Type ienumerableOfT = childProp.PropertyType.GetInterface("System.Collections.Generic.IEnumerable`1"); // if (ienumerableOfT != null) // { // Type elementType = ienumerableOfT.GetGenericArguments()[0]; // if (elementTypeLookup.Contains(elementType)) // return new ExplorerItem(childProp.Name, ExplorerItemKind.CollectionLink, ExplorerIcon.OneToMany) // { // HyperlinkTarget = elementTypeLookup[elementType].First(), // ToolTipText = FormatTypeName(elementType, true) // }; // } // // Ordinary property: // return new ExplorerItem(childProp.Name + " (" + FormatTypeName(childProp.PropertyType, false) + ")", // ExplorerItemKind.Property, ExplorerIcon.Column); //} #if NETCORE public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions dialogOptions)
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions dialogOptions) { return(new MainWindow(cxInfo, dialogOptions.IsNewConnection || dialogOptions.IsClonedConnection).ShowDialog() == true); }
public override bool ShowConnectionDialog(IConnectionInfo cxInfo, ConnectionDialogOptions options) => LoadExcelFileName.LoadExcelFileAsConnectionInfo(cxInfo);