IfNull() public static method

public static IfNull ( string paramName, object value ) : void
paramName string
value object
return void
Ejemplo n.º 1
0
        public ushort[] ToShortArray(MagickGeometry geometry, string mapping)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(ToShortArray(geometry.X, geometry.Y, geometry.Width, geometry.Height, mapping));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Performs lossless compression on the file. If the new file size is not smaller the file
        /// won't be overwritten.
        /// </summary>
        /// <param name="file">The image file to optimize</param>
        public void LosslessCompress(FileInfo file)
        {
            Throw.IfNull("file", file);

            DoLosslessCompress(file);
        }
Ejemplo n.º 3
0
        ///<summary>
        /// Creates a new DrawableStrokeColor instance.
        ///</summary>
        ///<param name="color">The color to use.</param>
        public DrawableStrokeColor(MagickColor color)
        {
            Throw.IfNull("color", color);

            Color = color;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MagickScript"/> class.
        /// </summary>
        /// <param name="xml">The <see cref="XElement"/> that contains the script.</param>
        public MagickScript(XElement xml)
        {
            Throw.IfNull(nameof(xml), xml);

            Initialize(xml.CreateNavigator());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Read basic information about an image with multiple frames/pages.
        /// </summary>
        /// <param name="file">The file to read the frames from.</param>
        /// <returns>A <see cref="MagickImageInfo"/> iteration.</returns>
        /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
        public static IEnumerable <IMagickImageInfo> ReadCollection(FileInfo file)
        {
            Throw.IfNull(nameof(file), file);

            return(ReadCollection(file.FullName));
        }
Ejemplo n.º 6
0
        protected DrawableCoordinates(IEnumerable <TCoordinateType> coordinates, int minCount)
        {
            Throw.IfNull(nameof(coordinates), coordinates);

            CheckCoordinates(new List <TCoordinateType>(coordinates), minCount);
        }
Ejemplo n.º 7
0
        public override void SetPixel(IEnumerable <IPixel <QuantumType> > pixels)
        {
            Throw.IfNull(nameof(pixels), pixels);

            base.SetPixel(pixels);
        }
Ejemplo n.º 8
0
 public static void IfNull(string paramName, object value)
 {
     Throw.IfNull(paramName, value);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DrawableTextEncoding"/> class.
        /// </summary>
        /// <param name="encoding">Encoding to use.</param>
        public DrawableTextEncoding(Encoding encoding)
        {
            Throw.IfNull(nameof(encoding), encoding);

            Encoding = encoding;
        }
Ejemplo n.º 10
0
        public override void SetArea(IMagickGeometry geometry, QuantumType[] values)
        {
            Throw.IfNull(nameof(geometry), geometry);

            base.SetArea(geometry, values);
        }
Ejemplo n.º 11
0
        public override void SetByteArea(IMagickGeometry geometry, byte[] values)
        {
            Throw.IfNull(nameof(geometry), geometry);

            base.SetByteArea(geometry, values);
        }
Ejemplo n.º 12
0
        public override QuantumType[] GetArea(IMagickGeometry geometry)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(base.GetArea(geometry));
        }
Ejemplo n.º 13
0
        public override ushort[] ToShortArray(IMagickGeometry geometry, string mapping)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(base.ToShortArray(geometry, mapping));
        }
Ejemplo n.º 14
0
        public override byte[] ToByteArray(IMagickGeometry geometry, PixelMapping mapping)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(base.ToByteArray(geometry, mapping.ToString()));
        }
Ejemplo n.º 15
0
        public QuantumType[] GetArea(MagickGeometry geometry)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(GetArea(geometry.X, geometry.Y, geometry.Width, geometry.Height));
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DrawableFillColor"/> class.
        /// </summary>
        /// <param name="color">The color to use.</param>
        public DrawableFillColor(IMagickColor <QuantumType> color)
        {
            Throw.IfNull(nameof(color), color);

            Color = color;
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Returns a string that represents the current value with the specified encoding.
        /// </summary>
        /// <param name="encoding">The encoding to use.</param>
        /// <returns>A string that represents the current value with the specified encoding.</returns>
        public string ToString(Encoding encoding)
        {
            Throw.IfNull(nameof(encoding), encoding);

            return(encoding.GetString(_data));
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MagickScript"/> class.
 /// </summary>
 /// <param name="xml">The IXPathNavigable that contains the script.</param>
 public MagickScript(IXPathNavigable xml)
 {
     Throw.IfNull(nameof(xml), xml);
     Initialize(xml.CreateNavigator());
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Performs compression on the specified file. With some formats the image will be decoded
        /// and encoded and this will result in a small quality reduction. If the new file size is not
        /// smaller the file won't be overwritten.
        /// </summary>
        /// <param name="file">The image file to compress.</param>
        /// <returns>True when the image could be compressed otherwise false.</returns>
        public bool Compress(FileInfo file)
        {
            Throw.IfNull(nameof(file), file);

            return(DoCompress(file));
        }
Ejemplo n.º 20
0
        public override void SetPixel(IPixel <QuantumType> pixel)
        {
            Throw.IfNull(nameof(pixel), pixel);

            SetPixelPrivate(pixel.X, pixel.Y, pixel.ToArray());
        }