Files
2026-04-17 14:55:32 -04:00

54 lines
3.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
source_files:
- Common/DTS.Common/Classes/ISO/ExtraProperties/TextPastedArgs.cs
generated_at: "2026-04-16T03:18:29.951703+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "958951d2772f6a16"
---
# ExtraProperties
## 1. Purpose
`TextPastedArgs` is an immutable event argument class used to carry contextual data when a text-paste operation occurs on an extra property control within the ISO (likely *Intelligent System Operator* or similar domain) UI layer. It encapsulates the pasted text content, the originating extra property instance, a unique identifier for the operation, and an optional user-defined tag—enabling event subscribers to handle paste events with full context.
## 2. Public Interface
- **`TextPastedArgs(string text, IExtraProperty extraProperty, string id, object tag)`**
Constructor initializing all properties. Validates *none* of the parameters are null-checked in the constructor body (per source), but `text` and `id` are non-nullable reference types (C# 8+), implying callers must provide non-null values.
- `text`: The string content being pasted.
- `extraProperty`: The `IExtraProperty` instance that triggered the event (assigned to `Sender`).
- `id`: A string identifier for the paste operation (e.g., correlation ID, control ID).
- `tag`: An arbitrary object for caller-defined metadata.
- **`string Text { get; }`**
Immutable property containing the pasted text.
- **`object Sender { get; }`**
Immutable property referencing the `IExtraProperty` instance passed into the constructor (i.e., the source control).
- **`string Id { get; }`**
Immutable property holding the operation identifier.
- **`object Tag { get; }`**
Immutable property for user-defined contextual data.
## 3. Invariants
- All properties are **read-only** (no setters); instances are fully immutable after construction.
- `Text` and `Id` are expected to be non-null (as declared with non-nullable reference types), though the constructor does not enforce this at runtime.
- `Sender` is *always* the exact `IExtraProperty` instance passed as the second constructor parameter.
- `Tag` may be `null` (no constraints specified).
## 4. Dependencies
- **Depends on**:
- `System` (core types: `string`, `object`)
- `DTS.Common.Events` (namespace, likely contains event-related infrastructure)
- `DTS.Common.Interface.ISO.ExtraProperties` (specifically `IExtraProperty` interface)
- **Used by**: Event handlers subscribed to paste events (e.g., `ITextPastedEventArgs` consumers), likely in UI components managing extra property controls.
## 5. Gotchas
- **No null-safety in constructor**: While `Text` and `Id` are non-nullable reference types, the constructor does not validate inputs—passing `null` to `text` or `id` will compile (with warnings suppressed or ignored) but may cause runtime failures downstream.
- **`Sender` is misnamed**: The property is named `Sender` but stores `extraProperty` (not a generic UI sender like a control). This may confuse developers expecting `sender` to be the UI element.
- **No validation of `id` uniqueness**: The `Id` fields purpose is unclear without context—consumers must assume it is unique per operation or handle collisions.
- **`Tag` semantics undefined**: The meaning of `Tag` is entirely caller-defined; no standard usage pattern is evident from this class alone.
None identified beyond the above.