Ejemplo n.º 1
0
        /// <summary>
        /// Inits the specified current node id.
        /// </summary>
        /// <param name="CurrentNodeId">The current node id.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            if (!Settings.RazorModelBindingEnabled)
            {
                instance = PropertyData;
                return true;
            }

            var nodeIds = uQuery.GetCsvIds(PropertyData);
            var library = new RazorLibraryCore(null);

            instance = (library.NodesById(nodeIds) as DynamicNodeList);

            return true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Inits the specified current node id.
        /// </summary>
        /// <param name="CurrentNodeId">The current node id.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            if (!Settings.RazorModelBindingEnabled)
            {
                instance = PropertyData;
                return(true);
            }

            var nodeIds = uQuery.GetCsvIds(PropertyData);
            var library = new RazorLibraryCore(null);

            instance = (library.NodesById(nodeIds) as DynamicNodeList);

            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Inits the specified current node id.
        /// </summary>
        /// <param name="CurrentNodeId">The current node id.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            if (!Settings.RazorModelBindingEnabled)
            {
                if (Helper.Xml.CouldItBeXml(PropertyData))
                {
#pragma warning disable 0618
                    instance = new DynamicXml(PropertyData);
#pragma warning restore 0618
                    return(true);
                }

                instance = PropertyData;
                return(true);
            }

            var nodeIds = Helper.Xml.CouldItBeXml(PropertyData) ? umbraco.uQuery.GetXmlIds(PropertyData) : umbraco.uQuery.ConvertToIntArray(umbraco.uQuery.GetCsvIds(PropertyData));
            var library = new RazorLibraryCore(null);

            instance = (library.NodesById(nodeIds.ToList()) as DynamicNodeList);

            return(true);
        }
        /// <summary>
        /// Inits the specified current node id.
        /// </summary>
        /// <param name="CurrentNodeId">The current node id.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            if (!Settings.RazorModelBindingEnabled)
            {
                if (Helper.Xml.CouldItBeXml(PropertyData))
                {
            #pragma warning disable 0618
                    instance = new DynamicXml(PropertyData);
            #pragma warning restore 0618
                    return true;
                }

                instance = PropertyData;
                return true;
            }

            var nodeIds = Helper.Xml.CouldItBeXml(PropertyData) ? umbraco.uQuery.GetXmlIds(PropertyData) : umbraco.uQuery.ConvertToIntArray(umbraco.uQuery.GetCsvIds(PropertyData));
            var library = new RazorLibraryCore(null);

            instance = (library.NodesById(nodeIds.ToList()) as DynamicNodeList);

            return true;
        }