|
| static string | Create (string content) |
| | Wraps newly generated content in explicit ownership markers.
|
| static string | RebaseLocalReferences (string source, string originPath, string companionSource=null, string companionTarget=null) |
| | Rebases quoted local URL references for a source copied to another folder.
|
| static bool | TryAdopt (string source, int firstLine, int lastLine, out string adoptedSource, out string error) |
| | Marks an explicitly selected range of whole lines as framework-owned.
|
| static bool | TryReplace (string source, string generatedContent, out string updatedSource, out string error) |
| | Replaces only a validated generated region; never writes files itself.
|
| static bool | TryUpdateSettings (string source, string editedSettings, out string updatedSource, out string error) |
| | Updates explicitly supplied root settings in place without requiring manual ownership adoption.
|
Defines explicit source ownership for editable USS and TSS theme files.
Current Save uses TryUpdateSettings to update supplied root declarations in place without manual line-range adoption. TryReplace and TryAdopt remain explicit marker-region helpers with different prerequisites; their presence does not imply a required ownership window. Methods return text only and do not save/import files or enable player stylesheet execution. Use transactional writing after validation and preserve ambiguous developer source.
| bool GWG.WindowFramework.Editor.ThemeSourceRegions.TryAdopt |
( |
string | source, |
|
|
int | firstLine, |
|
|
int | lastLine, |
|
|
out string | adoptedSource, |
|
|
out string | error ) |
|
inlinestatic |
Marks an explicitly selected range of whole lines as framework-owned.
- Parameters
-
| source | Unmarked original source. |
| firstLine | First framework-owned line, one-based and inclusive. |
| lastLine | Last framework-owned line, one-based and inclusive. |
| adoptedSource | Marked text on success; original text otherwise. |
| error | Validation message, or null on success. |
- Returns
- True when the exact developer-selected range can be marked safely.
Does not infer ownership from names or parse CSS. Callers must show the selected range for developer confirmation, preserve an original backup, and commit safely. All original characters are retained; only marker lines and a necessary terminal newline are inserted. Existing markers require repair, not another adoption.
| bool GWG.WindowFramework.Editor.ThemeSourceRegions.TryReplace |
( |
string | source, |
|
|
string | generatedContent, |
|
|
out string | updatedSource, |
|
|
out string | error ) |
|
inlinestatic |
Replaces only a validated generated region; never writes files itself.
- Parameters
-
| source | Original complete source text. |
| generatedContent | New framework content without markers. |
| updatedSource | Updated text on success; original text on failure. |
| error | Actionable validation message, or null on success. |
- Returns
- True only when ownership boundaries are complete and unambiguous.
Rejects unmarked, duplicate, incomplete, nested, or reversed boundaries. Preserves all exterior text, developer content and original line-ending style. Caller must validate before performing a transactional file write. Marker lines must stand alone.
{
}
else { UnityEngine.Debug.LogWarning(error); }
Defines explicit source ownership for editable USS and TSS theme files.
Definition ThemeSourceRegions.cs:14
static bool TryReplace(string source, string generatedContent, out string updatedSource, out string error)
Replaces only a validated generated region; never writes files itself.
Definition ThemeSourceRegions.cs:54