agrath
10529d9a9a
Fixed another issue where CSV strings were swallowed by DynamicNode trying to interpret them as integers. This upcast will now only happen if you are using the datatype Integer/Number
2011-09-22 11:56:07 -12:00
agrath
0c9edb5fbc
Fixed an issue with HasValue recursive overloads not passing the recursive flag down to GetProperty
2011-09-21 21:20:08 -12:00
agrath
b5dddc5e7c
Bypassed a dictionary lookup if the datatype is Guid.Empty
2011-09-06 10:27:20 -12:00
agrath
b023455068
Added an overload to NodesById and DynamicBackingItem/DynamicNode to signify you want a List<int> to be treated as media, not content
2011-08-15 10:18:15 -12:00
agrath
adc3a36ac2
Changed the decimal parsing in ConvertPropertyValueByDataType so it only tries to do this if the string contains the current decimal seperator character to prevent CSV strings from converting to decimals in cultures where , is used as the decimal seperator
2011-07-31 16:34:58 -12:00
agrath
2ea3c4b624
Got rid of InternalHtmlString as it wasn't being used and was throwing off some of the RazorLibraryCore overloads
2011-07-31 10:10:01 -12:00
agrath
d022b4a52a
Added the datatype GUID to the DateTime parsing code for the Date picker without time
2011-07-28 11:51:04 -12:00
agrath@gmail.com
31169380f8
Changed the return type of RTE to a different HtmlString (internal) so that it can be implicitly convertible for string for If comparisons. Added an extension method for string.HasValue so that .Where can invoke it to improve readibility when comparing RTE to empty string based on feedback from @cultiv. Cleaned up an empty if in DynamicQuerable
2011-07-21 20:19:54 -12:00
agrath@gmail.com
ba965a95e9
Made ConvertPropertyValueByDataType return DynamicNull instead of empty string when the datatype is a Date/Time and the TryParse fails. Only applied DateTime parsing to datatype Date/Time rather than always trying it
2011-07-21 12:18:58 -12:00
sgay
f20931cfa4
Refactored Razor DynamicNode.XPath() to returns an empty list when no nodes are found, instead of throwing [ #30361 ]
2011-07-14 06:47:40 -02:00
agrath@gmail.com
892a382eca
Added HasValue overloads that function like If/Where shorthands for writing out a value if a property has a value, e.g. Class Name
2011-07-11 11:24:00 -12:00
agrath@gmail.com
d5e3ceecec
Made IsHelper methods on DynamicNode and DynamicXml return HtmlString instead of string
2011-07-03 22:41:33 -12:00
agrath@gmail.com
41d3c9f3d9
Formatting in Linq Foreach of IRazorDataTypeModel cache build code
2011-07-03 10:14:04 -12:00
agrath@gmail.com
1164ea3ab1
Fixed a bug where if the ContentType (DocumentType) tree was a different tree to the Content or Media (Node) tree then the datatype lookup could fail when retrieving a property recursively.
...
If GetProperty recursively walked up the content tree to the first node that defined the property and eventutally found it, and the NodeType[Alias] of the node it was found on was not a parent of the original content's node type, then the lookup would fail.
Changed DynamicBackingItem.GetProperty (and PropertyResult class) to return the Node/Context where the property is being returned from and used this context's NodeTypeAlias as the in the data type lookup.
2011-07-03 09:32:29 -12:00
agrath@gmail.com
75d15cdc31
Made GetProperty break earlier if context/parent is null (prevents NRE) and slightly changed behaviour so that empty strings will go recursively to the parent. Added prefix to property access (_) which will cause the property to be looked up recursively. This syntax is used when you want to get the value recursively, but you want to still apply the IRazorDataTypeModel (as @Model.GetPropertyValue won't do that). Syntax is: @Model._propertyName - had to be a _ as that is legal c#
2011-07-02 17:29:47 -12:00
agrath@gmail.com
eff692249d
Made the int.TryParse and decimal.TryParse in DynamicNode culture aware so that , and . as numeric/decimal seperators are handled properly
2011-06-30 11:00:15 -12:00
agrath@gmail.com
0589d34abd
Changed the implementation of IRazorDataTypeModel to allow for immutable types to be returned such as string, int. Thanks @zpqrtbnk
2011-06-30 10:32:50 -12:00
agrath@gmail.com
cce3cdc18b
fixed some potential crashes in datatype lookups and a keyalreadyexists exception in datatype lookup
2011-06-29 17:36:37 -12:00
agrath@gmail.com
0475b48a8c
Fixed an issue with new DynamicNode() and DynamicNode.XPath using the wrong overload, thanks @cultiv
2011-06-29 17:18:10 -12:00
agrath@gmail.com
d0d48f18ff
Removed upcasting for uComponents multitreenode picker in DynamicNode ConvertPropertyValueByDataType in favour of the new plugin interface [I]RazorDataTypeModel
2011-06-19 14:40:10 -02:00
agrath@gmail.com
00141ba801
Added a new feature for plugin developers to create a model class that DynamicNode will return for their data type instead of the underlying type
2011-06-19 08:19:11 -02:00
agrath@gmail.com
3480a5d957
Made DynamicNodeList.XPath only work for content as it is the only one with an XML Backing document
2011-06-18 15:46:34 -02:00
agrath@gmail.com
86c9e8bde0
Added IsNotEqual IfHelper to DynamicNode and DynamicXml
2011-06-16 10:55:41 -02:00
agrath@gmail.com
ee57f4c449
Adds pageName attribute to DynamicNode
...
Rename NodeById to NodesById when dealing with multiple parameters
Fixes work item 30290 : Strip - in element and attribute names for DynamicXml
2011-06-13 15:21:16 -02:00
agrath@gmail.com
b79586b4d7
Added new methods to HtmlTagWrapper: AddChild(TagWrapperBase [text or node]), AddChild(string), AddChildAt, RemoveChildAt, ClearChildren
...
Added new overloads to Library.Wrap - Adding children in one call and applying predicate check (bool - use @Model.Where() to return a bool)
Added new DynamicNode.Where overload that doesn't ternary text and just returns true/false (same as Element.Match in prototypejs)
2011-06-13 07:01:04 -02:00
agrath@gmail.com
11b64ccd0d
Fixed an issue with parent recursion and an ArgumentException being thrown when I really want null if no parent
...
Added DynamicNode.Where to enable string predicate parsing IIF
Added overloads to DynamicXml which take an xml string and a XPathNodeIterator
Added If method to @Library to make ternaries easier to read in a Razor template (no need for extra brackets)
Added ToDynamicXml overload methods for XPathNodeIterator and XElement to @Library
2011-06-12 13:34:15 -02:00
agrath@gmail.com
1f6cc18ba4
Clarified exceptions when using NodeById and MediaById and passing empty strings, e.g. if your source came from @Parameter
2011-06-12 12:17:00 -02:00
agrath@gmail.com
e2bbccdf6f
Added fallback overloads to GetPropertyValue - GetPropertyValue(string alias, bool recursive, string fallback), GetPropertyValue(string alias, string fallback)
2011-06-12 11:55:38 -02:00
agrath@gmail.com
b367f63c1d
Fixed null reference problems with new dynamicbackingitem
...
Fixed recursive property null reference problems
Fixed issue with node having no children and property check crashing
Made DynamicXml behave more consistently based on user feedback
Added IsNull and HasValue to PropertyResult (comes back from GetProperty but you may need to cast it)
Added new Model.IsNull(string alias, bool recursive) and Model.HasValue(string alias, bool recursive) and Model.IsNull(string alias) and Model.HasValue(string alias)
2011-06-12 11:21:44 -02:00
agrath@gmail.com
f2d8363556
Added IsHelper methods back into DynamicNode after I accidentally removed them while refactoring
...
Added new IsHelper methods for IsModZero, IsNotModZero, IsPosition, IsNotPosition, IsNotFirst, IsNotLast
Added .Count to DynamicXML
Fixed Media .Url and .NiceUrl to bring back umbracoFile
Moved MediaById and NodeById implementations to RazorLibraryCore and deprecated original methods with redirection
Fixed parsing issue with ExamineBackedMedia XPathNodeIterator cast method
2011-06-12 08:23:10 -02:00
agrath@gmail.com
9c2a9f81f4
Finished ExamineBackedMedia implementation and fixed bug with GetMedia fallback in example code (didn't add current node attributes so was inconsistent compared to examine)
2011-06-12 06:40:18 -02:00
agrath@gmail.com
d63ae05693
Got rid of DynamicMedia and DynamicMediaList implementations (still there but subclasses of DynamicNode & DynamicNodeList now) to enable navigation on Media
...
Started implementing ExamineBackedMedia instead of using new Media()
2011-06-11 22:15:01 -02:00
agrath@gmail.com
40099d9d22
Made DynamicNode and DynamicMedia share an intermediary base class (that inherits from DynamicObject) rather than both inheriting from DynamicObject directly
...
Want to share some functionality between them
2011-05-21 14:55:10 -12:00
agrath@gmail.com
6a0dfc2c11
Razor @Library empty implementation
2011-05-21 14:34:46 -12:00
agrath@gmail.com
5c6e8526da
Changed IsLast implementation to behave properly when the DynamicNodeList is not a parent item children list
...
Changed IsHelper default valueIfFalse to be string.Empty on IsHelper(Func<DynamicNode,bool> func, string valueIfTrue) implementation
2011-04-05 23:15:23 -12:00
agrath@gmail.com
3c52ac851f
Slight change to handling of True/False when value isn't defined on a node but property is in DynamicNode
2011-04-05 23:06:30 -12:00
agrath@gmail.com
76f83ddda0
Fixed RTE types in DynamicNode from still getting converted to DynamicXml due to missing return statement
2011-03-25 09:33:00 -13:00
agrath@gmail.com
23aa9e60fe
Added GetProperty(string alias, bool recursive) overload to DynamicNode
...
Added GetPropertyValue(string alias) and GetPropertyValue(string alias, bool recursive) to DynamicNode
2011-03-22 19:01:17 -13:00
agrath@gmail.com
3d396d2b63
Added Index/Position method to DynamicNode for when it's contained within a DynamicNodeList and you're iterating
...
Added bool IsHelper(Func<DynamicNode,bool>), string IsHelper(Func<DynamicNode,bool>, string valueIfTrue), string IsHelper(Func<DynamicNode,bool>, string valueIfTrue, string valueIfFlase)
Added IsFirst/IsLast/IsOdd/IsEven helpers for checking position in current context/list
Added IsEqual for checking if the current node matches another by Id
Added IsDescendant/IsDescendantOrSelf/IsAncestor/IsAncestorOrSelf for checking relationships between two nodes
2011-03-22 18:48:57 -13:00
agrath@gmail.com
93d65ced40
Add IsNull and HasValue methods to Dynamic* classes
...
**Breaking Change: DynamicNull.HasValue and DynamicNull.IsNull have been changed from properties to methods
Rename umbraco.MacroEngines.ExtensionMethods as umbraco.MacroEngines.PrivateExtensionMethods
Implement extension method invokes for DynamicNode
2011-03-22 18:02:32 -13:00
hartvig
8833034a35
Updates to Razor snippets (WIP)
2011-03-14 11:42:41 -01:00
agrath@gmail.com
1a2bba4b2b
Added data type detection for MNTP/CSV to return List<int> and fix for NodeById/MediaById to handle List<int> correctly
2011-03-12 15:19:54 -13:00
agrath@gmail.com
44bfcaf373
Changed the decimal.TryParse code slightly to replace , with . before parse attempt
...
This is because strings like this: "2442,5453,5366" were incorrectly parsing to be "244254535366"
2011-03-12 15:07:17 -13:00
agrath@gmail.com
ddcf34b80c
Added .Sibling to DynamicNodeWalker which is a shorthand for checking both .Next() and .Previous()
...
overloads are .Sibling(int) [which you can pass negative to and is equivilent to .Previous(+int) ] or .Sibling(string) which checks nodeTypeAlias
.Sibling(string) will start walking forward at the current node and then wrap back to 0 until it reaches the starting point again
2011-03-08 19:54:55 -13:00
agrath@gmail.com
a02aca0f62
Added support to DynamicNodeWalker for finding nodes that are Up/Down/Previous/Next by NodeTypeAlias
...
Up and down are similar to Ancestors(string nodeTypeAlias)/Descendants(string nodeTypeAlias) but return the first match
2011-03-08 19:42:59 -13:00
agrath@gmail.com
017ed3635a
Fixed .Ancestors(int) to return ancestors where the level <= int rather than level = int to match .Descendants(int) >= behaviour
2011-03-08 18:43:59 -13:00
agrath@gmail.com
9949420c6d
Change HasAccess and IsProtected to be getters so they can be used in .Where
...
http://umbraco.codeplex.com/workitem/30096
Add support to DynamicQueryable for accessing properties that are not dynamic and are actually defined on DynamicNode
2011-03-08 18:38:06 -13:00
agrath@gmail.com
bc8f21f92d
Added implementation for .Visible which wraps umbracoNaviHide != 1
2011-03-08 18:09:06 -13:00
agrath@gmail.com
aaa90bea14
More graceful handling of missing properties in .Where - TryGetMember now returns DynamicNull
...
Only return DynamicNull if property truely doesn't exist - if it does exist and has no value, still return null
2011-02-27 22:55:50 -13:00
agrath@gmail.com
60c18bdff9
More graceful handling of missing properties in .Where - TryGetMember now returns DynamicNull (IEnumerable with fake .Where and .OrderBy) when the property/child type doesn't exist.
...
Expression Tree in DynamicQueryable explictly checks for this type and forces that portion of the predicate/expression tree to return true, bypassing the missing property
Handy when you are checking e.g. a boolean property in a .Where and that boolean doesn't exist on all nodes.
2011-02-27 21:53:45 -13:00