private static int GetDepthOfSerialization(PSObject source, int depth)
 {
     if (source == null)
     {
         return depth;
     }
     int serializationDepth = source.GetSerializationDepth(null);
     if (serializationDepth <= 0)
     {
         return depth;
     }
     return serializationDepth;
 }
        private static int GetDepthOfSerialization(PSObject source, int depth)
        {
            if (source == null)
            {
                return(depth);
            }
            int serializationDepth = source.GetSerializationDepth(null);

            if (serializationDepth <= 0)
            {
                return(depth);
            }
            return(serializationDepth);
        }
Example #3
0
        /// <summary>
        /// Compute the serialization depth for an PSObject instance subtree.
        /// </summary>
        /// <param name="source">PSObject whose serialization depth has to be computed</param>
        /// <param name="depth">current depth</param>
        /// <returns></returns>
        private static int GetDepthOfSerialization(PSObject source, int depth)
        {
            if (source == null)
            {
                return(depth);
            }

            // get the depth from the PSObject
            // NOTE: we assume that the depth out of the PSObject is > 0
            // else we consider it not set in types.ps1xml
            int objectLevelDepth = source.GetSerializationDepth(null);

            if (objectLevelDepth <= 0)
            {
                // no override at the type level
                return(depth);
            }

            return(objectLevelDepth);
        }
Example #4
0
        /// <summary>
        /// compute the serialization depth for an PSObject instance subtree
        /// </summary>
        /// <param name="source">PSObject whose serialization depth has to be computed</param>
        /// <param name="depth">current depth</param>
        /// <returns></returns>
        private static int GetDepthOfSerialization(PSObject source, int depth)
        {
            if (source == null)
                return depth;

            // get the depth from the PSObject
            // NOTE: we assume that the depth out of the PSObject is > 0
            // else we consider it not set in types.ps1xml
            int objectLevelDepth = source.GetSerializationDepth(null);
            if (objectLevelDepth <= 0)
            {
                // no override at the type level
                return depth;
            }

            return objectLevelDepth;
        }