private void PixbufDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter) { CellRendererPixbuf pixbufRenderer = cell as CellRendererPixbuf; ISchemaContainer schema = model.GetValue(iter, columnObj) as ISchemaContainer; string iconString = null; switch (schema.SchemaContainerType) { case SchemaContainerType.Table: iconString = "md-db-table"; break; case SchemaContainerType.View: iconString = "md-db-view"; break; case SchemaContainerType.Procedure: iconString = "md-db-procedure"; break; case SchemaContainerType.Query: //TODO: iconString = Stock.Execute; break; } if (iconString != null) { pixbufRenderer.Pixbuf = MonoDevelop.Core.Gui.Services.Resources.GetIcon(iconString); } }
private void TextDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter) { CellRendererText textRenderer = cell as CellRendererText; ISchemaContainer schema = model.GetValue(iter, columnObj) as ISchemaContainer; textRenderer.Text = schema.Schema.Name; }
/// <summary> /// Gets all immediate subschemas for a keyword. /// </summary> /// <param name="keyword">The keyword.</param> /// <returns>An `IEnumerable<JsonSchema>`.</returns> public static IEnumerable <JsonSchema> GetSubschemas(this IJsonSchemaKeyword keyword) { return(keyword switch { ISchemaContainer container => new[] { container.Schema }, ISchemaCollector collector => collector.Schemas, IKeyedSchemaCollector collector => collector.Schemas.Values, _ => Enumerable.Empty <JsonSchema>() });
/// <summary> /// Gets all immediate subschemas for a keyword. /// </summary> /// <param name="keyword">The keyword.</param> /// <returns>An `IEnumerable<JsonSchema>`.</returns> public static IEnumerable <JsonSchema> GetSubschemas(this IJsonSchemaKeyword keyword) { return(keyword switch { // ReSharper disable once ConditionIsAlwaysTrueOrFalse ISchemaContainer container => container.Schema == null?Enumerable.Empty <JsonSchema>() : new[] { container.Schema }, // ReSharper disable ConstantNullCoalescingCondition ISchemaCollector collector => collector.Schemas ?? Enumerable.Empty <JsonSchema>(), IKeyedSchemaCollector collector => collector.Schemas.Values ?? Enumerable.Empty <JsonSchema>(), // ReSharper restore ConstantNullCoalescingCondition _ => Enumerable.Empty <JsonSchema>() });