This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyProjectNamespace | |
{ | |
public interface IInjectedClass | |
{ | |
int TestMethod(); | |
} | |
public class InjectedClass : IInjectedClass | |
{ | |
private readonly IInjectedClassDependency _classDependency; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyProjectNamespace | |
{ | |
public interface IInjectedClassDependency | |
{ | |
} | |
public class InjectedClassDependency : IInjectedClassDependency | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<guide> | |
<InjectedClass type="MyProjectNamespace.InjectedClass, MyAssembly" /> | |
<InjectedClassDependency type="MyProjectNamespace.InjectedClassDependency, MyAssembly" /> | |
</guide> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Data.Items; | |
using Sitecore.Forms.Mvc.Attributes; | |
using Sitecore.Forms.Mvc.Controllers.ModelBinders.FieldBinders; | |
using Sitecore.Forms.Mvc.Models.Fields; | |
using Sitecore.Forms.Mvc.Validators; | |
namespace MyProject.Integration.Wfm | |
{ | |
public class TermsAgreementField : CheckBoxField | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Web.Mvc.Html | |
@model MyProject.Integration.Wfm.TermsAgreementField | |
@if (!Model.Visible) | |
{ | |
return; | |
} | |
<div class="@Model.CssClass checkbox-border"> | |
<div class="@Model.CssClass field-panel"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Form.Core.Attributes; | |
using Sitecore.Form.Core.Visual; | |
using Sitecore.Form.Web.UI.Controls; | |
namespace MyProject.Integration.Wfm | |
{ | |
public class TermsAgreement : Checkbox | |
{ | |
[VisualProperty("Agreement Text:", 200)] | |
[VisualFieldType(typeof(TextAreaField))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-16"?> | |
<hoursofoperationmodel xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<days> | |
<day> | |
<isclosed>false</isclosed> | |
<openingtime></openingtime> | |
<closingtime></closingtime> | |
<dayofweek>Monday</dayofweek> | |
</day> | |
<day> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-16"?> | |
<hoursofoperationmodel xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<days> | |
<day> | |
<isclosed>false</isclosed> | |
<openingtime>8:00 AM</openingtime> | |
<closingtime>5:00 PM</closingtime> | |
<dayofweek>Monday</dayofweek> | |
</day> | |
<day> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var model = new HoursOfOperationModel(rawXmlValue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string SerializeModelToRawValue(HoursOfOperationModel model) | |
{ | |
var serializer = new XmlSerializer(typeof(HoursOfOperationModel)); | |
var stringwriter = new StringWriter(); | |
serializer.Serialize(stringwriter, model); | |
return stringwriter.ToString(); | |
} |