private void repModelingKind(string head, AdminShell.ModelingKind k) { if (k == null) { return; } //-9- {Referable}.kind rep(head + "kind", "" + k.kind); }
public void DisplayOrEditEntityModelingKind(AnyUiStackPanel stack, AdminShell.ModelingKind kind, Action <AdminShell.ModelingKind> setOutput, string instanceExceptionStatement = null, AdminShell.Referable relatedReferable = null) { // access if (stack == null) { return; } // members this.AddGroup(stack, "Kind (of model):", levelColors.SubSection); this.AddHintBubble(stack, hintMode, new[] { new HintCheck( () => { return(kind == null); }, "Providing kind information is mandatory. Typically you want to model instances. " + "A manufacturer would define types of assets, as well.", breakIfTrue: true), new HintCheck( () => { return(kind.kind.Trim().ToLower() != "instance"); }, "Check for kind setting. 'Instance' is the usual choice." + instanceExceptionStatement, severityLevel: HintCheck.Severity.Notice) }); if (this.SafeguardAccess( stack, repo, kind, "kind:", "Create data element!", v => { setOutput?.Invoke(new AdminShell.ModelingKind()); return(new AnyUiLambdaActionRedrawEntity()); } )) { this.AddKeyValueRef( stack, "kind", kind, ref kind.kind, null, repo, v => { kind.kind = v as string; this.AddDiaryEntry(relatedReferable, new DiaryEntryStructChange()); return(new AnyUiLambdaActionNone()); }, new[] { AdminShell.ModelingKind.Template, AdminShell.ModelingKind.Instance }); } }