Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }