diff --git a/src/AasxCore.Samm2_2_0/SammClasses.cs b/src/AasxCore.Samm2_2_0/SammClasses.cs
index 50fc576f4..0bba28e3b 100644
--- a/src/AasxCore.Samm2_2_0/SammClasses.cs
+++ b/src/AasxCore.Samm2_2_0/SammClasses.cs
@@ -330,6 +330,23 @@ public SammReference(string val = "")
}
}
+ ///
+ /// When Properties are used in Aspects and Entities, they can be marked as optional
+ /// (not possible for properties of Abstract Entities).
+ /// This means that a Property’s usage is optional, not the Property itself, which
+ /// would make reusing a Property more difficult.
+ ///
+ public class OptionalSammReference : SammReference
+ {
+ public bool Optional { get; set; } = false;
+
+ public OptionalSammReference(string val = "", bool optional = false)
+ {
+ Value = val;
+ Optional = optional;
+ }
+ }
+
///
/// Single item for NamespaceMap.
///
@@ -417,7 +434,7 @@ public bool AddOrIgnore(string prefix, string uri)
/// Base class for other constraints that constrain a Characteristic in some way, e.g., the Range Constraint
/// limits the value range for a Property.
///
- ///
+ ///
///
public class Constraint : ModelElement
{
@@ -426,7 +443,7 @@ public class Constraint : ModelElement
///
/// Restricts a value to a specific language.
///
- ///
+ ///
///
public class LanguageConstraint : Constraint
{
@@ -434,19 +451,21 @@ public class LanguageConstraint : Constraint
/// An ISO 639-1 [iso639] language code for the language of the value of the constrained Property,
/// e.g., "de".
///
+ [SammPropertyUri("bamm-c:languageCode")]
public string? LanguageCode;
}
///
/// Restricts a value to a specific locale, i.e., a language with additional region information.
///
- ///
+ ///
///
public class LocaleConstraint : Constraint
{
///
/// An IETF BCP 47 language code for the locale of the value of the constrained Property, e.g., "de-DE".
///
+ [SammPropertyUri("bamm-c:localeCode")]
public string? LocaleCode;
}
@@ -459,30 +478,34 @@ public class RangeConstraint : Constraint
///
/// The upper bound of a range.
///
+ [SammPropertyUri("bamm-c:maxValue")]
public string? MaxValue;
///
/// The lower bound of a range.
///
+ [SammPropertyUri("bamm-c:minValue")]
public string? MinValue;
///
/// Defines whether the upper bound of a range is inclusive or exclusive. Possible values are
/// AT_MOST and LESS_THAN.
///
+ [SammPropertyUri("bamm-c:upperBoundDefinition")]
public SammUpperBoundDefinition? UpperBoundDefinition;
///
/// Defines whether the lower bound of a range is inclusive or exclusive. Possible values are
/// AT_LEAST and GREATER_THAN.
///
+ [SammPropertyUri("bamm-c:lowerBoundDefinition")]
public SammLowerBoundDefinition? LowerBoundDefinition;
}
///
/// Restricts the encoding of a Property.
///
- ///
+ ///
///
public class EncodingConstraint : Constraint
{
@@ -490,6 +513,7 @@ public class EncodingConstraint : Constraint
/// Configures the encoding. This must be one of the following:
/// US-ASCII, ISO-8859-1, UTF-8, UTF-16, UTF-16BE or UTF-16LE.
///
+ [SammPropertyUri("bamm:value")]
public SammEncoding? Value;
}
@@ -500,18 +524,20 @@ public class EncodingConstraint : Constraint
/// Collection Characteristics (Collection, Set, Sorted Set, List). In this case the Constraint restricts the
/// number of elements in the collection.
///
- ///
+ ///
///
public class LengthConstraint : Constraint
{
///
/// The maximum length. Must be given as xsd:nonNegativeInteger.
///
+ [SammPropertyUri("bamm-c:maxValue")]
public uint? MaxValue;
///
/// The minimum length. Must be given as xsd:nonNegativeInteger.
///
+ [SammPropertyUri("bamm-c:minValue")]
public uint? MinValue;
}
@@ -520,7 +546,7 @@ public class LengthConstraint : Constraint
/// and Operators [xpath-functions].
///
///
- ///
+ ///
///
public class RegularExpressionConstraint : Constraint
{
@@ -528,6 +554,7 @@ public class RegularExpressionConstraint : Constraint
/// The regular expression.
///
///
+ [SammPropertyUri("bamm-c:value")]
public string? Value;
}
@@ -535,7 +562,7 @@ public class RegularExpressionConstraint : Constraint
/// Defines the scaling factor as well as the amount of integral numbers for a fixed point number.
/// The constraint may only be used in conjunction with Characteristics which use the xsd:decimal data type.
///
- ///
+ ///
///
public class FixedPointConstraint : Constraint
{
@@ -544,6 +571,7 @@ public class FixedPointConstraint : Constraint
/// scaling factor is 2 (the number of digits after the decimal point).
/// Must be given as xsd:positiveInteger.
///
+ [SammPropertyUri("bamm-c:scale")]
public uint? Scale;
///
@@ -551,6 +579,7 @@ public class FixedPointConstraint : Constraint
/// is 123.04, the integer factor is 3 (the number of digits before the decimal point).
/// Must be given as xsd:positiveInteger.
///
+ [SammPropertyUri("bamm-c:integer")]
public uint? Integer;
}
@@ -558,13 +587,15 @@ public class FixedPointConstraint : Constraint
/// Base class of all characteristics. This Characteristics Class can also be instantiated directly
/// (i.e., without creating a subclass).
///
- ///
+ ///
///
public class Characteristic : ModelElement, ISammSelfDescription, ISammStructureModel
{
// self description
public string GetSelfName() => "samm-characteristic";
- public string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Characteristic";
+ // public string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Characteristic";
+ // FIX: seems to use bamm: instead of bamm-c: !!
+ public string GetSelfUrn() => "urn:bamm:io.openmanufacturing:meta-model:1.0.0#Characteristic";
// structure model
public bool IsTopElement() => false;
@@ -577,8 +608,9 @@ public IEnumerable DescendOnce()
///
/// Reference to a scalar or complex (Entity) data type. See Section "Type System" in the Aspect Meta Model.
/// Also the scalar data types (e.g. xsd:decimal) are treated as references in the first degree.
- ///
+ ///
[SammPresetList("SammXsdDataTypes")]
+ [SammPropertyUri("bamm:dataType")]
public SammReference DataType { get; set; }
public Characteristic()
@@ -592,24 +624,26 @@ public Characteristic()
/// referred to as the "base Characteristic". A Trait itself has no samm:dataType,
/// because it inherits the type of its samm-c:baseCharacteristic.
///
- ///
+ ///
///
public class Trait : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-trait";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Trait";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Trait";
///
/// The Characterstic that is being constrained.
/// Identified via preferredName in any language
///
+ [SammPropertyUri("bamm-c:baseCharacteristic")]
public SammReference? BaseCharacteristic { get; set; }
///
/// A Constraint that is applicable to the base Characteristic. This attribute may be used multiple times,
/// to add multiple Constraints to the base Characteristic.
///
+ [SammPropertyUri("bamm-c:constraint")]
public List? Constraint { get; set; }
}
@@ -617,34 +651,36 @@ public class Trait : Characteristic, ISammSelfDescription
/// A value which can be quantified and may have a unit, e.g., the number of bolts required for a
/// processing step or the expected torque with which these bolts should be tightened.
///
- ///
+ ///
///
public class Quantifiable : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-quantifiable";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Quantifiable";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Quantifiable";
///
/// Reference to a Unit as defined in the Unit catalog
///
+ [SammPropertyUri("bamm-c:unit")]
public SammReference? Unit { get; set; }
}
///
/// A measurement is a numeric value with an associated unit and quantity kind.
///
- ///
+ ///
///
public class Measurement : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-measurement";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Measurement";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Measurement";
///
/// Reference to a Unit as defined in the Unit catalog
///
+ [SammPropertyUri("bamm-c:unit")]
public SammReference Unit { get; set; }
public Measurement()
@@ -656,18 +692,19 @@ public Measurement()
///
/// An enumeration represents a list of possible values.
///
- ///
+ ///
///
public class Enumeration : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-enumeration";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Enumeration";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Enumeration";
///
/// List of possible values. The dataType of each of the values must match the
/// dataType of the Enumeration.
///
+ [SammPropertyUri("bamm-c:values")]
public List Values { get; set; }
public Enumeration()
@@ -679,17 +716,18 @@ public Enumeration()
///
/// A state is subclass of Enumeration with a default value.
///
- ///
+ ///
///
public class State : Enumeration, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-state";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#State";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#State";
///
/// The default value for the state.
///
+ [SammPropertyUri("bamm-c:defaultValue")]
public string DefaultValue { get; set; }
public State()
@@ -701,13 +739,13 @@ public State()
///
/// A time duration.
///
- ///
+ ///
///
public class Duration : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-duration";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Duration";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Duration";
///
/// Reference to a Unit as defined in the Unit catalog. The referenced unit or its referenceUnit
@@ -719,6 +757,7 @@ public class Duration : Characteristic, ISammSelfDescription
/// unit:poisePerBar unit:poisePerPascal unit:reciprocalMinute unit:secondUnitOfTime
/// unit:shake unit:siderealYear unit:tropicalYear unit:week unit:year
///
+ [SammPropertyUri("bamm-c:unit")]
public SammReference Unit { get; set; }
public Duration()
@@ -731,17 +770,18 @@ public Duration()
/// A group of values which may be either of a scalar or Entity type. The values may be duplicated and
/// are not ordered (i.e., bag semantics).
///
- ///
+ ///
///
public class Collection : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-collection";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Collection";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Collection";
///
/// Reference to a Characteristic which describes the individual elements contained in the Collection.
///
+ [SammPropertyUri("bamm-c:elementCharacteristic")]
public SammReference ElementCharacteristic { get; set; }
public Collection()
@@ -753,49 +793,49 @@ public Collection()
///
/// A subclass of Collection which may contain duplicates and is ordered.
///
- ///
+ ///
///
public class List : Collection, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-list";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#List";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#List";
}
///
/// A subclass of Collection which may not contain duplicates and is unordered.
///
- ///
+ ///
///
public class Set : Collection, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-set";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Set";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Set";
}
///
/// A subclass of Collection which may not contain duplicates and is ordered.
///
- ///
+ ///
///
public class SortedSet : Collection, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-sorted-set";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#SortedSet";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#SortedSet";
}
///
/// A subclass of Sorted Set containing values with the exact point in time when the values where recorded.
///
- ///
+ ///
///
public class TimeSeries : SortedSet, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-time-series";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#TimeSeries";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#TimeSeries";
// For DataType
// Set to samm-e:TimeSeriesEntity. This Entity consists of two Properties, namely samm-e:timestamp
@@ -810,13 +850,13 @@ public class TimeSeries : SortedSet, ISammSelfDescription
/// Describes a Property which contains any kind of code. Note that this Characteristic does not
/// define a samm:dataType, this must therefore be done when instantiating the Characteristic.
///
- ///
+ ///
///
public class Code : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-code";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Code";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Code";
}
///
@@ -824,22 +864,24 @@ public class Code : Characteristic, ISammSelfDescription
/// This Characteristic does not have one explicit samm:dataType, as it can be the datatype of either
/// the left or the right.
///
- /// "/>
+ /// "/>
///
public class Either : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-either";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Either";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#Either";
///
/// The left side of the Either. The attribute references another Characteristic which describes the value.
///
+ [SammPropertyUri("bamm-c:left")]
public string Left { get; set; }
///
/// The right side of the Either. The attribute references another Characteristic which describes the value.
///
+ [SammPropertyUri("bamm-c:right")]
public string Right { get; set; }
public Either()
@@ -853,13 +895,13 @@ public Either()
/// Describes a Property whose data type is an Entity. The Entity used as data type could be defined in the
/// same Aspect Model or the shared Entity namespace of the Semantic Aspect Meta Model.
///
- ///
+ ///
///
public class SingleEntity : Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-single-entity";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#SingleEntity";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#SingleEntity";
}
///
@@ -868,13 +910,13 @@ public class SingleEntity : Characteristic, ISammSelfDescription
/// linking to a separate Property definition for each part. To define the parts, the value must be
/// deconstructed using a regular expression.
///
- ///
+ ///
///
public class StructuredValue: Characteristic, ISammSelfDescription
{
// self description
public new string GetSelfName() => "samm-structured-value";
- public new string GetSelfUrn() => "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#StructuredValue";
+ public new string GetSelfUrn() => "urn:bamm:io.openmanufacturing:characteristic:1.0.0#StructuredValue";
///
/// The regular expression used to deconstruct the value into parts that are mapped to separate
@@ -882,12 +924,14 @@ public class StructuredValue: Characteristic, ISammSelfDescription
/// are Properties given in the elements list. The nth capture group maps to the nth Property
/// in the elements list.
///
+ [SammPropertyUri("bamm-c:deconstructionRule")]
public string DeconstructionRule { get; set; }
///
/// A list of entries each of which can either be a Property reference or a string literal.
/// The list must contain at least one Property reference.
///
+ [SammPropertyUri("bamm-c:elements")]
public List Elements { get; set; }
public StructuredValue()
@@ -921,12 +965,14 @@ public IEnumerable DescendOnce()
/// in a corresponding Characteristic. It is important to ensure that the data type has the correct format.
/// Find the Data Types (SAMM 2.1.0) with an example value.
///
+ [SammPropertyUri("bamm:exampleValue")]
public string? ExampleValue { get; set; }
///
/// One Property has exactly one Characteristic.
///
[SammPresetList("Characteristics")]
+ [SammPropertyUri("bamm:characteristic")]
public SammReference Characteristic { get; set; }
public Property()
@@ -954,6 +1000,7 @@ public IEnumerable DescendOnce()
}
// own
+ [SammPropertyUri("bamm:properties")]
public List Properties { get; set; }
public Entity()
@@ -995,18 +1042,71 @@ public IEnumerable DescendOnce()
[SammMultiLine(maxLines: 5)]
public string Comments { get; set; } = "";
+ ///
+ /// A Property represents a named value. This element is optional and can appear
+ /// multiple times in a model ([0..n]).
+ ///
[SammPropertyUri("bamm:properties")]
- public List Properties { get; set; }
-
- public List Events { get; set; }
- public List Operations { get; set; }
+ public List Properties { get; set; } = new List();
- public Aspect()
- {
- Properties = new List();
- Events = new List();
- Operations = new List();
- }
+ ///
+ /// An Event is a model element that represents a single occurence where the timing is important.
+ ///
+ [SammPropertyUri("bamm:events")]
+ public List Events { get; set; } = new List();
+
+ ///
+ /// An Operation represents an action that can be triggered on the Aspect.
+ ///
+ [SammPropertyUri("bamm:operations")]
+ public List Operations { get; set; } = new List();
+ }
+
+ public class Unit : ModelElement, ISammSelfDescription
+ {
+ // self description
+ public string GetSelfName() => "samm-unit";
+ public string GetSelfUrn() => "urn:bamm:io.openmanufacturing:meta-model:1.0.0#Unit";
+
+ ///
+ /// Normalized short code for unit; please refer to the original
+ /// specification for more details.
+ ///
+ [SammPropertyUri("bamm:commonCode")]
+ public string? CommonCode { get; set; } = null;
+
+ ///
+ /// If the unit is derived from a reference unit, the human readable
+ /// multiplication factor, e.g., "10⁻²⁸ m²"
+ ///
+ [SammPropertyUri("bamm:conversionFactor")]
+ public string? ConversionFactor { get; set; } = null;
+
+ ///
+ /// If the unit is derived from a reference unit, the numeric
+ /// multiplication factor, e.g., "1.0E-28"
+ ///
+ [SammPropertyUri("bamm:numericConversionFactor")]
+ public string? NumericConversionFactor { get; set; } = null;
+
+ ///
+ /// The list of quantity kinds, for example unit litre has quantity kind volume, unit
+ /// metre has quantity kinds length, distance, diameter etc.
+ ///
+ [SammPropertyUri("bamm:quantityKind")]
+ public string? QuantityKind { get; set; } = null;
+
+ ///
+ /// The unit this unit is derived from, e.g., centimetre is derived from metre.
+ ///
+ [SammPropertyUri("bamm:referenceUnit")]
+ public SammReference? ReferenceUnit { get; set; } = null;
+
+ ///
+ /// The unit’s symbol, e.g., for centimetre the symbol is cm
+ ///
+ [SammPropertyUri("bamm:symbol")]
+ public string? symbol { get; set; } = null;
}
///
@@ -1262,7 +1362,8 @@ static Util()
{
if (Activator.CreateInstance(st, new object[] { }) is ISammSelfDescription ssd)
{
- SammUrnToType.Add(ssd.GetSelfUrn().ToLower(), st);
+ // assumption: RDF matching is case sensitive?!
+ SammUrnToType.Add(ssd.GetSelfUrn(), st);
SammTypeToName.Add(st, "" + ssd.GetSelfName());
}
}
@@ -1272,8 +1373,8 @@ static Util()
{
if (urn == null)
return null;
- if (SammUrnToType.ContainsKey(urn.ToLower()))
- return SammUrnToType[urn.ToLower()];
+ if (SammUrnToType.ContainsKey(urn))
+ return SammUrnToType[urn];
return null;
}
diff --git a/src/AasxPackageExplorer/debug.MIHO.script b/src/AasxPackageExplorer/debug.MIHO.script
index 1afc3eb2b..f7f53a963 100644
--- a/src/AasxPackageExplorer/debug.MIHO.script
+++ b/src/AasxPackageExplorer/debug.MIHO.script
@@ -6,4 +6,4 @@
// Select("Submodel", "Next");
// Tool("exportsmtasciidoc", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\new.zip", "ExportHtml", "true");
// Tool("Exit");
-Tool("sammaspectimport", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\BatteryPass-spiel-short.ttl");
\ No newline at end of file
+Tool("sammaspectimport", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\BatteryPass-spiel.ttl");
\ No newline at end of file
diff --git a/src/AasxPackageExplorer/options-debug.MIHO.json b/src/AasxPackageExplorer/options-debug.MIHO.json
index fbca1b4d3..8141ef50c 100644
--- a/src/AasxPackageExplorer/options-debug.MIHO.json
+++ b/src/AasxPackageExplorer/options-debug.MIHO.json
@@ -26,7 +26,7 @@
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\SMT_Sample_B.aasx",
// "AuxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\SMT_Sample_A.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\00_FestoDemoBox-Module-2-Kopie2.aasx",
- "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\samm_spiel.aasx",
+ "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\samm_spiel_empty.aasx",
"WindowLeft": 200,
"WindowTop": -1,
"WindowWidth": 900,
diff --git a/src/AasxPackageLogic/DispEditHelperBasics.cs b/src/AasxPackageLogic/DispEditHelperBasics.cs
index 3ce0f4540..54b047484 100644
--- a/src/AasxPackageLogic/DispEditHelperBasics.cs
+++ b/src/AasxPackageLogic/DispEditHelperBasics.cs
@@ -301,7 +301,9 @@ public void AddKeyValueExRef(
AnyUiLambdaActionBase takeOverLambdaAction = null,
bool limitToOneRowForNoEdit = false,
int comboBoxMinWidth = -1,
- bool noFirstColumnWidth = false)
+ bool noFirstColumnWidth = false,
+ int maxLines = -1,
+ bool keyVertCenter = false)
{
AddKeyValue(
view, key, value, nullValue, repo, setValue, comboBoxItems, comboBoxIsEditable,
@@ -310,7 +312,9 @@ public void AddKeyValueExRef(
(value == null) ? 0 : value.GetHashCode(), containingObject: containingObject,
limitToOneRowForNoEdit: limitToOneRowForNoEdit,
comboBoxMinWidth: comboBoxMinWidth,
- noFirstColumnWidth: noFirstColumnWidth);
+ noFirstColumnWidth: noFirstColumnWidth,
+ maxLines: maxLines,
+ keyVertCenter: keyVertCenter);
}
///
@@ -347,7 +351,9 @@ public void AddKeyValue(
object containingObject = null,
bool limitToOneRowForNoEdit = false,
int comboBoxMinWidth = -1,
- bool noFirstColumnWidth = false)
+ bool noFirstColumnWidth = false,
+ int maxLines = -1,
+ bool keyVertCenter = false)
{
// draw anyway?
if (repo != null && value == null)
@@ -399,7 +405,13 @@ public void AddKeyValue(
}
// Label for key
- AddSmallLabelTo(g, 0, 0, padding: new AnyUiThickness(5, 0, 0, 0), content: "" + key + ":");
+ var klb = AddSmallLabelTo(g, 0, 0, padding: new AnyUiThickness(5, 0, 0, 0), content: "" + key + ":");
+ if (keyVertCenter)
+ {
+ klb.VerticalAlignment = AnyUiVerticalAlignment.Center;
+ klb.VerticalContentAlignment = AnyUiVerticalAlignment.Center;
+ klb.Margin = new AnyUiThickness(0, -1, 0, 0);
+ }
// Label / TextBox for value
if (repo == null)
@@ -443,6 +455,8 @@ public void AddKeyValue(
{
// use plain text box
var tb = AddSmallTextBoxTo(g, 0, 1, margin: new AnyUiThickness(4, 2, 2, 2), text: "" + value);
+ if (maxLines > 0)
+ tb.MaxLines = maxLines;
AnyUiUIElement.RegisterControl(tb,
setValue, takeOverLambda: takeOverLambdaAction);
@@ -478,8 +492,6 @@ public void AddKeyValue(
view.Children.Add(g);
}
-
-
public void AddKeyDropTarget(
AnyUiStackPanel view, string key, string value, string nullValue = null,
ModifyRepo repo = null, Func