Skip to content
This repository was archived by the owner on Feb 26, 2022. It is now read-only.

Commit e01ff52

Browse files
committed
Moved the DataTypes under /src
1 parent 550c641 commit e01ff52

311 files changed

Lines changed: 20207 additions & 20207 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

uComponents.DataTypes.RazorDataTypeModels/CheckBoxTree/CheckBoxTreeModelBinder.cs renamed to src/uComponents.DataTypes.RazorDataTypeModels/CheckBoxTree/CheckBoxTreeModelBinder.cs

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
using System.Linq;
2-
using uComponents.Core;
3-
using umbraco;
4-
using umbraco.MacroEngines;
5-
using umbraco.MacroEngines.Library;
6-
7-
namespace uComponents.DataTypes.RazorDataTypeModels.CheckBoxTree
8-
{
9-
/// <summary>
10-
/// Model binder for the CheckBoxTree data-type.
11-
/// </summary>
12-
[RazorDataTypeModel(DataTypeConstants.CheckBoxTreeId)]
13-
public class CheckBoxTreeModelBinder : IRazorDataTypeModel
14-
{
15-
/// <summary>
16-
/// Inits the specified current node id.
17-
/// </summary>
18-
/// <param name="CurrentNodeId">The current node id.</param>
19-
/// <param name="PropertyData">The property data.</param>
20-
/// <param name="instance">The instance.</param>
21-
/// <returns></returns>
22-
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
23-
{
24-
if (!Settings.RazorModelBindingEnabled)
25-
{
26-
if (Helper.Xml.CouldItBeXml(PropertyData))
27-
{
28-
#pragma warning disable 0618
29-
instance = new DynamicXml(PropertyData);
30-
#pragma warning restore 0618
31-
return true;
32-
}
33-
34-
instance = PropertyData;
35-
return true;
36-
}
37-
38-
var nodeIds = Helper.Xml.CouldItBeXml(PropertyData) ? uQuery.GetXmlIds(PropertyData) : uQuery.ConvertToIntArray(uQuery.GetCsvIds(PropertyData));
39-
var library = new RazorLibraryCore(null);
40-
41-
instance = library.NodesById(nodeIds.ToList()) as DynamicNodeList;
42-
43-
return true;
44-
}
45-
}
1+
using System.Linq;
2+
using uComponents.Core;
3+
using umbraco;
4+
using umbraco.MacroEngines;
5+
using umbraco.MacroEngines.Library;
6+
7+
namespace uComponents.DataTypes.RazorDataTypeModels.CheckBoxTree
8+
{
9+
/// <summary>
10+
/// Model binder for the CheckBoxTree data-type.
11+
/// </summary>
12+
[RazorDataTypeModel(DataTypeConstants.CheckBoxTreeId)]
13+
public class CheckBoxTreeModelBinder : IRazorDataTypeModel
14+
{
15+
/// <summary>
16+
/// Inits the specified current node id.
17+
/// </summary>
18+
/// <param name="CurrentNodeId">The current node id.</param>
19+
/// <param name="PropertyData">The property data.</param>
20+
/// <param name="instance">The instance.</param>
21+
/// <returns></returns>
22+
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
23+
{
24+
if (!Settings.RazorModelBindingEnabled)
25+
{
26+
if (Helper.Xml.CouldItBeXml(PropertyData))
27+
{
28+
#pragma warning disable 0618
29+
instance = new DynamicXml(PropertyData);
30+
#pragma warning restore 0618
31+
return true;
32+
}
33+
34+
instance = PropertyData;
35+
return true;
36+
}
37+
38+
var nodeIds = Helper.Xml.CouldItBeXml(PropertyData) ? uQuery.GetXmlIds(PropertyData) : uQuery.ConvertToIntArray(uQuery.GetCsvIds(PropertyData));
39+
var library = new RazorLibraryCore(null);
40+
41+
instance = library.NodesById(nodeIds.ToList()) as DynamicNodeList;
42+
43+
return true;
44+
}
45+
}
4646
}

uComponents.DataTypes.RazorDataTypeModels/CountryPicker/CountryPickerModelBinder.cs renamed to src/uComponents.DataTypes.RazorDataTypeModels/CountryPicker/CountryPickerModelBinder.cs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
using System.Collections.Generic;
2-
using uComponents.Core;
3-
using umbraco.MacroEngines;
4-
5-
namespace uComponents.DataTypes.RazorDataTypeModels.CountryPicker
6-
{
7-
/// <summary>
8-
/// Model binder for the Country Picker data-type.
9-
/// </summary>
10-
[RazorDataTypeModel(DataTypeConstants.CountryPickerId)]
11-
public class CountryPickerModelBinder : IRazorDataTypeModel
12-
{
13-
/// <summary>
14-
/// Inits the specified current node id.
15-
/// </summary>
16-
/// <param name="CurrentNodeId">The current node id.</param>
17-
/// <param name="PropertyData">The property data.</param>
18-
/// <param name="instance">The instance.</param>
19-
/// <returns></returns>
20-
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
21-
{
22-
if (!Settings.RazorModelBindingEnabled)
23-
{
24-
instance = PropertyData;
25-
return true;
26-
}
27-
28-
var values = new List<string>();
29-
30-
if (!string.IsNullOrEmpty(PropertyData))
31-
{
32-
foreach (var value in PropertyData.Split(Constants.Common.COMMA))
33-
{
34-
values.Add(value);
35-
}
36-
}
37-
38-
if (values.Count == 1)
39-
{
40-
instance = values[0];
41-
}
42-
else
43-
{
44-
instance = values;
45-
}
46-
47-
return true;
48-
}
49-
}
1+
using System.Collections.Generic;
2+
using uComponents.Core;
3+
using umbraco.MacroEngines;
4+
5+
namespace uComponents.DataTypes.RazorDataTypeModels.CountryPicker
6+
{
7+
/// <summary>
8+
/// Model binder for the Country Picker data-type.
9+
/// </summary>
10+
[RazorDataTypeModel(DataTypeConstants.CountryPickerId)]
11+
public class CountryPickerModelBinder : IRazorDataTypeModel
12+
{
13+
/// <summary>
14+
/// Inits the specified current node id.
15+
/// </summary>
16+
/// <param name="CurrentNodeId">The current node id.</param>
17+
/// <param name="PropertyData">The property data.</param>
18+
/// <param name="instance">The instance.</param>
19+
/// <returns></returns>
20+
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
21+
{
22+
if (!Settings.RazorModelBindingEnabled)
23+
{
24+
instance = PropertyData;
25+
return true;
26+
}
27+
28+
var values = new List<string>();
29+
30+
if (!string.IsNullOrEmpty(PropertyData))
31+
{
32+
foreach (var value in PropertyData.Split(Constants.Common.COMMA))
33+
{
34+
values.Add(value);
35+
}
36+
}
37+
38+
if (values.Count == 1)
39+
{
40+
instance = values[0];
41+
}
42+
else
43+
{
44+
instance = values;
45+
}
46+
47+
return true;
48+
}
49+
}
5050
}

uComponents.DataTypes.RazorDataTypeModels/DataTypeGrid/DTG_ModelBinder.cs renamed to src/uComponents.DataTypes.RazorDataTypeModels/DataTypeGrid/DTG_ModelBinder.cs

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
namespace uComponents.DataTypes.RazorDataTypeModels.DataTypeGrid
2-
{
3-
using System.Linq;
4-
5-
using uComponents.DataTypes.DataTypeGrid.Model;
6-
7-
using umbraco.MacroEngines;
8-
9-
using DynamicXml = Umbraco.Core.Dynamics.DynamicXml;
10-
11-
/// <summary>
12-
/// Model binder for the DataTypeGrid data-type.
13-
/// </summary>
14-
[RazorDataTypeModel(DataTypeConstants.DataTypeGridId)]
15-
public class DtgModelBinder : IRazorDataTypeModel
16-
{
17-
/// <summary>
18-
/// Initializes the model binder.
19-
/// </summary>
20-
/// <param name="CurrentNodeId">The current node id.</param>
21-
/// <param name="PropertyData">The property data.</param>
22-
/// <param name="instance">The instance.</param>
23-
/// <returns>True if initialization was successful. Otherwise false.</returns>
24-
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
25-
{
26-
if (!Settings.RazorModelBindingEnabled)
27-
{
28-
instance = new DynamicXml(PropertyData);
29-
30-
return true;
31-
}
32-
33-
try
34-
{
35-
var c = new GridRowCollection(PropertyData).OrderBy(x => x.SortOrder).ToList();
36-
37-
instance = (GridRowCollection)c;
38-
}
39-
catch
40-
{
41-
instance = new GridRowCollection();
42-
43-
return false;
44-
}
45-
46-
return true;
47-
}
48-
}
1+
namespace uComponents.DataTypes.RazorDataTypeModels.DataTypeGrid
2+
{
3+
using System.Linq;
4+
5+
using uComponents.DataTypes.DataTypeGrid.Model;
6+
7+
using umbraco.MacroEngines;
8+
9+
using DynamicXml = Umbraco.Core.Dynamics.DynamicXml;
10+
11+
/// <summary>
12+
/// Model binder for the DataTypeGrid data-type.
13+
/// </summary>
14+
[RazorDataTypeModel(DataTypeConstants.DataTypeGridId)]
15+
public class DtgModelBinder : IRazorDataTypeModel
16+
{
17+
/// <summary>
18+
/// Initializes the model binder.
19+
/// </summary>
20+
/// <param name="CurrentNodeId">The current node id.</param>
21+
/// <param name="PropertyData">The property data.</param>
22+
/// <param name="instance">The instance.</param>
23+
/// <returns>True if initialization was successful. Otherwise false.</returns>
24+
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
25+
{
26+
if (!Settings.RazorModelBindingEnabled)
27+
{
28+
instance = new DynamicXml(PropertyData);
29+
30+
return true;
31+
}
32+
33+
try
34+
{
35+
var c = new GridRowCollection(PropertyData).OrderBy(x => x.SortOrder).ToList();
36+
37+
instance = (GridRowCollection)c;
38+
}
39+
catch
40+
{
41+
instance = new GridRowCollection();
42+
43+
return false;
44+
}
45+
46+
return true;
47+
}
48+
}
4949
}

uComponents.DataTypes.RazorDataTypeModels/ImagePoint/ImagePointModelBinder.cs renamed to src/uComponents.DataTypes.RazorDataTypeModels/ImagePoint/ImagePointModelBinder.cs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
using System.Linq;
2-
using uComponents.Core;
3-
using umbraco;
4-
using umbraco.MacroEngines;
5-
using umbraco.MacroEngines.Library;
6-
using uComponents.DataTypes.ImagePoint;
7-
8-
namespace uComponents.DataTypes.RazorDataTypeModels.ImagePoint
9-
{
10-
[RazorDataTypeModel(DataTypeConstants.ImagePointId)]
11-
public class ImagePointModelBinder : IRazorDataTypeModel
12-
{
13-
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
14-
{
15-
// if model binding is disbaled, return a DynamicXml object
16-
if (!Settings.RazorModelBindingEnabled)
17-
{
18-
#pragma warning disable 0618
19-
instance = new DynamicXml(PropertyData);
20-
#pragma warning restore 0618
21-
return true;
22-
}
23-
24-
DataTypes.ImagePoint.ImagePoint imagePoint = new DataTypes.ImagePoint.ImagePoint();
25-
26-
// use the uQuery IGetProperty interface to do the work
27-
((uQuery.IGetProperty)imagePoint).LoadPropertyValue(PropertyData);
28-
29-
instance = imagePoint;
30-
return true;
31-
}
32-
}
33-
}
1+
using System.Linq;
2+
using uComponents.Core;
3+
using umbraco;
4+
using umbraco.MacroEngines;
5+
using umbraco.MacroEngines.Library;
6+
using uComponents.DataTypes.ImagePoint;
7+
8+
namespace uComponents.DataTypes.RazorDataTypeModels.ImagePoint
9+
{
10+
[RazorDataTypeModel(DataTypeConstants.ImagePointId)]
11+
public class ImagePointModelBinder : IRazorDataTypeModel
12+
{
13+
public bool Init(int CurrentNodeId, string PropertyData, out object instance)
14+
{
15+
// if model binding is disbaled, return a DynamicXml object
16+
if (!Settings.RazorModelBindingEnabled)
17+
{
18+
#pragma warning disable 0618
19+
instance = new DynamicXml(PropertyData);
20+
#pragma warning restore 0618
21+
return true;
22+
}
23+
24+
DataTypes.ImagePoint.ImagePoint imagePoint = new DataTypes.ImagePoint.ImagePoint();
25+
26+
// use the uQuery IGetProperty interface to do the work
27+
((uQuery.IGetProperty)imagePoint).LoadPropertyValue(PropertyData);
28+
29+
instance = imagePoint;
30+
return true;
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)