diff --git a/src/Framework/Core/ViewModel/AllowStaticCommandAttribute.cs b/src/Framework/Core/ViewModel/AllowStaticCommandAttribute.cs
index 307da6592e..f09f0fb468 100644
--- a/src/Framework/Core/ViewModel/AllowStaticCommandAttribute.cs
+++ b/src/Framework/Core/ViewModel/AllowStaticCommandAttribute.cs
@@ -3,6 +3,11 @@
namespace DotVVM.Framework.ViewModel
{
+ /// Allows DotVVM to call the method from staticCommand.
+ ///
+ /// This attribute must be used to prevent attackers from calling any method in your system.
+ /// While DotVVM signs the method names used staticCommand and it shouldn't be possible to execute any other method,
+ /// the attribute offers a decent protection against RCE in case the Asp.Net Core encryption keys are compromised.
public class AllowStaticCommandAttribute : Attribute
{
}
diff --git a/src/Framework/Core/ViewModel/Direction.cs b/src/Framework/Core/ViewModel/Direction.cs
index c47a9a2922..2f51f88980 100644
--- a/src/Framework/Core/ViewModel/Direction.cs
+++ b/src/Framework/Core/ViewModel/Direction.cs
@@ -5,19 +5,31 @@
namespace DotVVM.Framework.ViewModel
{
///
- /// ServerToClient, ServerToClient on postback, ClientToServer, C2S iff in command path
+ /// Specifies on which requests should the property be serialized and sent. Default is Both.
+ /// Set to None to disable serialization of the property.
+ /// This enumeration can be treated as flags, the directions can be arbitrarily combined.
///
[Flags]
public enum Direction
{
+ /// Never send this property to the client, it won't be allowed to use this property from value and staticCommand bindings.
None = 0,
+ /// Sent to client on the initial GET request, but not sent again on postbacks
ServerToClientFirstRequest = 1,
+ /// Property is updated on postbacks, but not sent on the first request (initially it will be set to null or default value of the primitive type)
ServerToClientPostback = 2,
+ /// Sent from server to client, but not sent back.
ServerToClient = ServerToClientFirstRequest | ServerToClientPostback,
+ /// Complement to , not meant to be used on its own.
ClientToServerNotInPostbackPath = 4,
+ /// Sent from client to server, but only if the current data context is this property. If the data context is a child object of this property, only that part of the object will be sent, all other properties are ignored.
+ /// To sent the initial value to client, use Direction.ServerToClientFirstRequest | Direction.ClientToServerInPostbackPath
ClientToServerInPostbackPath = 8,
+ /// Sent back on postbacks. Initially the property will set to null or primitive default value. To send the initial value to client, use Direction.ServerToClientFirstRequest | Direction.ClientToServer
ClientToServer = ClientToServerInPostbackPath | ClientToServerNotInPostbackPath,
+ /// Always sent to client, sent back only when the object is the current data context (see also )
IfInPostbackPath = ServerToClient | ClientToServerInPostbackPath,
+ /// Value is sent on each request. This is the default value.
Both = 15,
}
-}
\ No newline at end of file
+}
diff --git a/src/Framework/Core/ViewModel/ProtectMode.cs b/src/Framework/Core/ViewModel/ProtectMode.cs
index 18c2c9a958..288ee41e6d 100644
--- a/src/Framework/Core/ViewModel/ProtectMode.cs
+++ b/src/Framework/Core/ViewModel/ProtectMode.cs
@@ -11,17 +11,17 @@ namespace DotVVM.Framework.ViewModel
public enum ProtectMode
{
///
- /// The property value is sent to the client unencrypted and it is not signed. It can be modified on the client with no restrictions.
+ /// The property value is sent to the client unencrypted and it is not signed. It can be modified on the client with no restrictions. This is the default.
///
None,
///
- /// The property value is sent to the client unencrypted, but it is also signed. If it is modified on the client, the server will throw an exception during postback.
+ /// The property value is sent to the client in both unencrypted and encrypted form. On server, the encrypted value is read, so it cannot be modified on the client.
///
SignData,
///
- /// The property value is encrypted before it is sent to the client.
+ /// The property value is encrypted before it is sent to the client. Encrypted properties thus cannot be used in value bindings.
///
EncryptData
}
diff --git a/src/Framework/Framework/Binding/ActiveDotvvmProperty.cs b/src/Framework/Framework/Binding/ActiveDotvvmProperty.cs
index 719beda699..831b85d787 100644
--- a/src/Framework/Framework/Binding/ActiveDotvvmProperty.cs
+++ b/src/Framework/Framework/Binding/ActiveDotvvmProperty.cs
@@ -10,6 +10,7 @@
namespace DotVVM.Framework.Binding
{
+ /// An abstract DotvvmProperty which contains code to be executed when the assigned control is being rendered.
public abstract class ActiveDotvvmProperty : DotvvmProperty
{
public abstract void AddAttributesToRender(IHtmlWriter writer, IDotvvmRequestContext context, DotvvmControl control);
diff --git a/src/Framework/Framework/Binding/AttachedPropertyAttribute.cs b/src/Framework/Framework/Binding/AttachedPropertyAttribute.cs
index 65ee39234e..a30427ab94 100644
--- a/src/Framework/Framework/Binding/AttachedPropertyAttribute.cs
+++ b/src/Framework/Framework/Binding/AttachedPropertyAttribute.cs
@@ -6,6 +6,8 @@
namespace DotVVM.Framework.Binding
{
+ /// Used to mark DotvvmProperty which are used on other control than the declaring type. For example, Validation.Target is an attached property.
+ /// Note that DotVVM allows this for any DotvvmProperty, but this attribute instructs editor extension to include the property in autocompletion.
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public class AttachedPropertyAttribute : Attribute
{
diff --git a/src/Framework/Framework/Binding/BindingCompilationOptionsAttribute.cs b/src/Framework/Framework/Binding/BindingCompilationOptionsAttribute.cs
index d04de43a34..5a7e8eddc8 100644
--- a/src/Framework/Framework/Binding/BindingCompilationOptionsAttribute.cs
+++ b/src/Framework/Framework/Binding/BindingCompilationOptionsAttribute.cs
@@ -1,11 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
+using DotVVM.Framework.Binding.Expressions;
+using DotVVM.Framework.Compilation.Binding;
namespace DotVVM.Framework.Binding
{
+ /// Allow to adjust how bindings are compiled. Can be placed on custom binding type (for example, see ) or on a dotvvm property
public abstract class BindingCompilationOptionsAttribute : Attribute
{
+ /// Returns a list of resolvers - functions which accept any set of existing binding properties and returns one new binding property.
+ /// It will be automatically invoked when the returned property is needed.
+ /// See for a list of default property resolvers - to adjust how the binding is compiled, you'll want to redefine one of the default resolvers.
+ /// See for example how to use this method.
public abstract IEnumerable GetResolvers();
}
}
diff --git a/src/Framework/Framework/Binding/BindingCompilationService.cs b/src/Framework/Framework/Binding/BindingCompilationService.cs
index d349303b5e..f5e2ee7ddd 100644
--- a/src/Framework/Framework/Binding/BindingCompilationService.cs
+++ b/src/Framework/Framework/Binding/BindingCompilationService.cs
@@ -26,10 +26,13 @@ public class BindingCompilationOptions
public List