Skip to content

Commit

Permalink
Merge branch 'strong-typed'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Graf committed May 2, 2024
2 parents 3583057 + 1a9f05d commit 65f138b
Show file tree
Hide file tree
Showing 10 changed files with 469 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
.temp_cache
.vs/
obj/
bin/
52 changes: 52 additions & 0 deletions AppCode/Data/AppResources.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// DO NOT MODIFY THIS FILE - IT IS AUTO-GENERATED
// See also: https://go.2sxc.org/copilot-data
// To extend it, create a "AppResources.cs" with this contents:
/*
namespace AppCode.Data
{
public partial class AppResources
{
// Add your own properties and methods here
}
}
*/

// Generator: CSharpDataModelsGenerator v17.06.02
// App/Edition: QR Code/
// User: 2sic Web-Developer
// When: 2024-04-05 08:43:06Z
namespace AppCode.Data
{
// This is a generated class for AppResources (scope: System.App)
// To extend/modify it, see instructions above.

/// <summary>
/// AppResources data. <br/>
/// Generated 2024-04-05 08:43:06Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.PrintQrAdminHint`. <br/>
/// For other properties or uses, use methods such as
/// .IsNotEmpty("FieldName"), .String("FieldName"), .Children(...), .Picture(...), .Html(...).
/// </summary>
/// <remarks>
/// This Content-Type is NOT in the default scope, so you may not see it in the Admin UI. It's in the scope System.App.
/// </remarks>
public partial class AppResources: AutoGenerated.ZagAppResources
{ }
}

namespace AppCode.Data.AutoGenerated
{
/// <summary>
/// Auto-Generated base class for System.App.AppResources in separate namespace and special name to avoid accidental use.
/// </summary>
public abstract class ZagAppResources: Custom.Data.CustomItem
{
/// <summary>
/// PrintQrAdminHint as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("PrintQrAdminHint", scrubHtml: true) etc.
/// </summary>
public string PrintQrAdminHint => _item.String("PrintQrAdminHint", fallback: "");
}
}
69 changes: 69 additions & 0 deletions AppCode/Data/AppSettings.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// DO NOT MODIFY THIS FILE - IT IS AUTO-GENERATED
// See also: https://go.2sxc.org/copilot-data
// To extend it, create a "AppSettings.cs" with this contents:
/*
namespace AppCode.Data
{
public partial class AppSettings
{
// Add your own properties and methods here
}
}
*/

// Generator: CSharpDataModelsGenerator v17.06.02
// App/Edition: QR Code/
// User: 2sic Web-Developer
// When: 2024-04-05 08:43:06Z
namespace AppCode.Data
{
// This is a generated class for AppSettings (scope: System.App)
// To extend/modify it, see instructions above.

/// <summary>
/// AppSettings data. <br/>
/// Generated 2024-04-05 08:43:06Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.QrCodeSettings`. <br/>
/// For other properties or uses, use methods such as
/// .IsNotEmpty("FieldName"), .String("FieldName"), .Children(...), .Picture(...), .Html(...).
/// </summary>
/// <remarks>
/// This Content-Type is NOT in the default scope, so you may not see it in the Admin UI. It's in the scope System.App.
/// </remarks>
public partial class AppSettings: AutoGenerated.ZagAppSettings
{ }
}

namespace AppCode.Data.AutoGenerated
{
/// <summary>
/// Auto-Generated base class for System.App.AppSettings in separate namespace and special name to avoid accidental use.
/// </summary>
public abstract class ZagAppSettings: Custom.Data.CustomItem
{
/// <summary>
/// QrCodeSettings as single item of QrCodeSettings.
/// </summary>
/// <remarks>
/// Generated to only return 1 child because field settings had Multi-Value=false. The type QrCodeSettings was specified in the field settings.
/// </remarks>
/// <returns>
/// A single item OR null if nothing found, so you can use ?? to provide alternate objects.
/// </returns>
public QrCodeSettings QrCodeSettings => _qrCodeSettings ??= _item.Child<QrCodeSettings>("QrCodeSettings");
private QrCodeSettings _qrCodeSettings;

/// <summary>
/// Title as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("Title", scrubHtml: true) etc.
/// </summary>
/// <remarks>
/// This hides base property Title.
/// To access original, convert using AsItem(...) or cast to ITypedItem.
/// Consider renaming this field in the underlying content-type.
/// </remarks>
public new string Title => _item.String("Title", fallback: "");
}
}
108 changes: 108 additions & 0 deletions AppCode/Data/Link.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// DO NOT MODIFY THIS FILE - IT IS AUTO-GENERATED
// See also: https://go.2sxc.org/copilot-data
// To extend it, create a "Link.cs" with this contents:
/*
namespace AppCode.Data
{
public partial class Link
{
// Add your own properties and methods here
}
}
*/

// Generator: CSharpDataModelsGenerator v17.06.02
// App/Edition: QR Code/
// User: 2sic Web-Developer
// When: 2024-04-05 08:43:06Z
using ToSic.Sxc.Adam;

namespace AppCode.Data
{
// This is a generated class for Link
// To extend/modify it, see instructions above.

/// <summary>
/// Link data. <br/>
/// Generated 2024-04-05 08:43:06Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.DisplayLinkOrTitle`. <br/>
/// For other properties or uses, use methods such as
/// .IsNotEmpty("FieldName"), .String("FieldName"), .Children(...), .Picture(...), .Html(...).
/// </summary>
public partial class Link: AutoGenerated.ZagLink
{ }
}

namespace AppCode.Data.AutoGenerated
{
/// <summary>
/// Auto-Generated base class for Default.Link in separate namespace and special name to avoid accidental use.
/// </summary>
public abstract class ZagLink: Custom.Data.CustomItem
{
/// <summary>
/// DisplayLinkOrTitle as bool. <br/>
/// To get nullable use .Get("DisplayLinkOrTitle") as bool?;
/// </summary>
public bool DisplayLinkOrTitle => _item.Bool("DisplayLinkOrTitle");

/// <summary>
/// Link as link (url). <br/>
/// To get the underlying value like 'file:72' use String("Link")
/// </summary>
public string Link => _item.Url("Link");

/// <summary>
/// LinkCurrentPage as bool. <br/>
/// To get nullable use .Get("LinkCurrentPage") as bool?;
/// </summary>
public bool LinkCurrentPage => _item.Bool("LinkCurrentPage");

/// <summary>
/// Get the file object for Link - or null if it's empty or not referencing a file.
/// </summary>
public IFile LinkFile => _item.File("Link");

/// <summary>
/// Get the folder object for Link.
/// </summary>
public IFolder LinkFolder => _item.Folder("Link");

/// <summary>
/// NotesInternal as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("NotesInternal", scrubHtml: true) etc.
/// </summary>
public string NotesInternal => _item.String("NotesInternal", fallback: "");

/// <summary>
/// QrCodeSettings as single item of QrCodeSettings.
/// </summary>
/// <remarks>
/// Generated to only return 1 child because field settings had Multi-Value=false. The type QrCodeSettings was specified in the field settings.
/// </remarks>
/// <returns>
/// A single item OR null if nothing found, so you can use ?? to provide alternate objects.
/// </returns>
public QrCodeSettings QrCodeSettings => _qrCodeSettings ??= _item.Child<QrCodeSettings>("QrCodeSettings");
private QrCodeSettings _qrCodeSettings;

/// <summary>
/// Title as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("Title", scrubHtml: true) etc.
/// </summary>
/// <remarks>
/// This hides base property Title.
/// To access original, convert using AsItem(...) or cast to ITypedItem.
/// Consider renaming this field in the underlying content-type.
/// </remarks>
public new string Title => _item.String("Title", fallback: "");

/// <summary>
/// VarOverrideQrSettings as bool. <br/>
/// To get nullable use .Get("VarOverrideQrSettings") as bool?;
/// </summary>
public bool VarOverrideQrSettings => _item.Bool("VarOverrideQrSettings");
}
}
90 changes: 90 additions & 0 deletions AppCode/Data/QrCodeSettings.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// DO NOT MODIFY THIS FILE - IT IS AUTO-GENERATED
// See also: https://go.2sxc.org/copilot-data
// To extend it, create a "QrCodeSettings.cs" with this contents:
/*
namespace AppCode.Data
{
public partial class QrCodeSettings
{
// Add your own properties and methods here
}
}
*/

// Generator: CSharpDataModelsGenerator v17.06.02
// App/Edition: QR Code/
// User: 2sic Web-Developer
// When: 2024-04-05 08:43:06Z
namespace AppCode.Data
{
// This is a generated class for QrCodeSettings
// To extend/modify it, see instructions above.

/// <summary>
/// QrCodeSettings data. <br/>
/// Generated 2024-04-05 08:43:06Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.BackgroundColor`. <br/>
/// For other properties or uses, use methods such as
/// .IsNotEmpty("FieldName"), .String("FieldName"), .Children(...), .Picture(...), .Html(...).
/// </summary>
public partial class QrCodeSettings: AutoGenerated.ZagQrCodeSettings
{ }
}

namespace AppCode.Data.AutoGenerated
{
/// <summary>
/// Auto-Generated base class for Default.QrCodeSettings in separate namespace and special name to avoid accidental use.
/// </summary>
public abstract class ZagQrCodeSettings: Custom.Data.CustomItem
{
/// <summary>
/// BackgroundColor as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("BackgroundColor", scrubHtml: true) etc.
/// </summary>
public string BackgroundColor => _item.String("BackgroundColor", fallback: "");

/// <summary>
/// Border as int. <br/>
/// To get other types use methods such as .Decimal("Border")
/// </summary>
public int Border => _item.Int("Border");

/// <summary>
/// Color as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("Color", scrubHtml: true) etc.
/// </summary>
public string Color => _item.String("Color", fallback: "");

/// <summary>
/// ErrorCorrection as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("ErrorCorrection", scrubHtml: true) etc.
/// </summary>
public string ErrorCorrection => _item.String("ErrorCorrection", fallback: "");

/// <summary>
/// ShowLinkOrTitleBelow as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("ShowLinkOrTitleBelow", scrubHtml: true) etc.
/// </summary>
public string ShowLinkOrTitleBelow => _item.String("ShowLinkOrTitleBelow", fallback: "");

/// <summary>
/// Size as int. <br/>
/// To get other types use methods such as .Decimal("Size")
/// </summary>
public int Size => _item.Int("Size");

/// <summary>
/// Title as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("Title", scrubHtml: true) etc.
/// </summary>
/// <remarks>
/// This hides base property Title.
/// To access original, convert using AsItem(...) or cast to ITypedItem.
/// Consider renaming this field in the underlying content-type.
/// </remarks>
public new string Title => _item.String("Title", fallback: "");
}
}
33 changes: 33 additions & 0 deletions AppCode/Razor/AppRazor.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// DO NOT MODIFY THIS FILE - IT IS AUTO-GENERATED
// All the classes are partial, so you can extend them in a separate file.

// Generator: RazorViewsGenerator v17.06.02
// App/Edition: QR Code/
// User: 2sic Web-Developer
// When: 2024-04-05 08:43:09Z

using AppCode.Data;
using ToSic.Sxc.Apps;

namespace AppCode.Razor
{
/// <summary>
/// Base Class for Razor Views which have a typed App but don't use the Model or use the typed MyModel.
/// </summary>
public abstract partial class AppRazor: AppRazor<object>
{
}

/// <summary>
/// Base Class for Razor Views which have a typed App and a typed Model
/// </summary>
public abstract partial class AppRazor<TModel>: Custom.Hybrid.RazorTyped<TModel>
{

/// <summary>
/// Typed App with typed Settings & Resources
/// </summary>
public new IAppTyped<AppSettings, AppResources> App => _app ??= Customize.App<AppSettings, AppResources>();
private IAppTyped<AppSettings, AppResources> _app;
}
}
Loading

0 comments on commit 65f138b

Please sign in to comment.