public bool Deploy() { bool result = true; Dictionary <LinkBiInterfaceType, string> exports = new Dictionary <LinkBiInterfaceType, string>(); // Run through all server connections. foreach (LinkBiServerConnection serverConnection in this.Properties.ServerConnections.Values) { // Check if an export with the server connection's interface type was already created. if (exports.ContainsKey(serverConnection.InterfaceType)) { continue; } LinkBiInterface exportInterface = null; switch (serverConnection.InterfaceType) { case LinkBiInterfaceType.PowerBI: exportInterface = new Excel(this.Core, this); break; case LinkBiInterfaceType.CustomCharts: exportInterface = new CustomCharts(this.Core, this); break; } if (exportInterface == null) { continue; } // Create the export for the server connection's provider. string fileName = exportInterface.Render(); exports.Add(serverConnection.InterfaceType, fileName); } // Run through all server connections. foreach (LinkBiServerConnection serverConnection in this.Properties.ServerConnections.Values) { // Deploy the file to the server. if (serverConnection.Deploy( exports[serverConnection.InterfaceType] ) == false) { result = false; } } return(result); }
public bool Deploy(Guid idServerConnection) { bool result = true; string export = null; if (!this.Properties.ServerConnections.ContainsKey(idServerConnection)) { return(false); } LinkBiServerConnection serverConnection = this.Properties.ServerConnections[idServerConnection]; LinkBiInterface exportInterface = null; switch (serverConnection.InterfaceType) { case LinkBiInterfaceType.PowerBI: exportInterface = new Excel(this.Core, this); break; case LinkBiInterfaceType.CustomCharts: exportInterface = new CustomCharts(this.Core, this); break; } if (exportInterface != null) { // Create the export for the server connection's provider. export = exportInterface.Render(); // Deploy the file to the server. if (serverConnection.Deploy( export ) == false) { result = false; } } else { return(false); } return(result); }