IfNull() публичный статический Метод

public static IfNull ( string paramName, object value ) : void
paramName string
value object
Результат void
Пример #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));
        }
Пример #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);
        }
Пример #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;
        }
Пример #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());
        }
Пример #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));
        }
Пример #6
0
        protected DrawableCoordinates(IEnumerable <TCoordinateType> coordinates, int minCount)
        {
            Throw.IfNull(nameof(coordinates), coordinates);

            CheckCoordinates(new List <TCoordinateType>(coordinates), minCount);
        }
Пример #7
0
        public override void SetPixel(IEnumerable <IPixel <QuantumType> > pixels)
        {
            Throw.IfNull(nameof(pixels), pixels);

            base.SetPixel(pixels);
        }
Пример #8
0
 public static void IfNull(string paramName, object value)
 {
     Throw.IfNull(paramName, value);
 }
Пример #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;
        }
Пример #10
0
        public override void SetArea(IMagickGeometry geometry, QuantumType[] values)
        {
            Throw.IfNull(nameof(geometry), geometry);

            base.SetArea(geometry, values);
        }
Пример #11
0
        public override void SetByteArea(IMagickGeometry geometry, byte[] values)
        {
            Throw.IfNull(nameof(geometry), geometry);

            base.SetByteArea(geometry, values);
        }
Пример #12
0
        public override QuantumType[] GetArea(IMagickGeometry geometry)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(base.GetArea(geometry));
        }
Пример #13
0
        public override ushort[] ToShortArray(IMagickGeometry geometry, string mapping)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(base.ToShortArray(geometry, mapping));
        }
Пример #14
0
        public override byte[] ToByteArray(IMagickGeometry geometry, PixelMapping mapping)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(base.ToByteArray(geometry, mapping.ToString()));
        }
Пример #15
0
        public QuantumType[] GetArea(MagickGeometry geometry)
        {
            Throw.IfNull(nameof(geometry), geometry);

            return(GetArea(geometry.X, geometry.Y, geometry.Width, geometry.Height));
        }
Пример #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;
        }
Пример #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));
        }
Пример #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());
 }
Пример #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));
        }
Пример #20
0
        public override void SetPixel(IPixel <QuantumType> pixel)
        {
            Throw.IfNull(nameof(pixel), pixel);

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