private void GenerateManagedComponents() { fuelComponent = new ManagedComponentWrapper(EventIDs.FUEL_READING_EVENT, manager.managerInstance) { title = "Fuel: ", unitText = (panelSettings.showInMetric) ? "Liters" : "Gallons", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; milesToEmptyComponent = new ManagedComponentWrapper(EventIDs.DISTANCE_REMAINING_EVENT, manager.managerInstance) { title = "To Empty: ", unitText = (panelSettings.showInMetric) ? "Kilometers" : "Miles", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; mpgComponent = new ManagedComponentWrapper(EventIDs.CURRENT_MPG_EVENT, manager.managerInstance) { title = "Recent: ", unitText = (panelSettings.showInMetric) ? "L/100Km" : "MPG", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; }
private void GenerateManagedComponents() { distanceComponent = new ManagedComponentWrapper(EventIDs.DISTANCE_TRAVELLED_EVENT, manager.managerInstance) { title = "Distance", unitText = (panelSettings.showInMetric) ? "Kilometers" : "Miles", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; fuelComponent = new ManagedComponentWrapper(EventIDs.FUEL_READING_EVENT, manager.managerInstance) { title = "Fuel", unitText = (panelSettings.showInMetric) ? "Liters" : "Gallons", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; runtimeComponent = new ManagedComponentWrapper(EventIDs.HOURS_EVENT, manager.managerInstance) { title = "Run Time", unitText = "", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; speedComponent = new ManagedComponentWrapper(EventIDs.AVERAGE_SPEED_EVENT, manager.managerInstance) { title = "Speed", unitText = (panelSettings.showInMetric) ? "KPH" : "MPH", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; economyComponent = new ManagedComponentWrapper(EventIDs.CURRENT_MPG_EVENT, manager.managerInstance) { title = "Economy", unitText = (panelSettings.showInMetric) ? "L/100Km" : "MPG", showTitle = panelSettings.showCaptions, showUnit = panelSettings.showUnits, orientation = (panelSettings.orientation == Orientation.Horizontal) ? Orientation.Vertical : Orientation.Horizontal, }; }
public Component(Dataflow pipeline, string moniker) { if (pipeline == null) { throw new ArgumentNullException(nameof(pipeline)); } if (string.IsNullOrWhiteSpace(moniker)) { throw new ArgumentException("Value cannot be null or whitespace.", nameof(moniker)); } Pipeline = pipeline.Pipeline; ComponentMetadata = (IDTSComponentMetaData130)Pipeline.ComponentMetaDataCollection.New(); ComponentMetadata.ComponentClassID = moniker; ManagedComponentWrapper = ComponentMetadata.Instantiate(); ManagedComponentWrapper.ProvideComponentProperties(); Connections = pipeline.Connections; }