Class IntRange

Class IntRange

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.7.0)

Class for representing sequence of elements

public class IntRange
    {
        private int _min;
        private int _max;
        public IntRange(int min, int max)
        {
            _min = min;
            _max = max;
        }
        public bool IsInRange(int number)
        {
            return (number >= _min && number <= _max);
        }
    }

Inheritance

object IntRange

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

IntRange(int, int)

Initializes a new instance of the Aspose.Imaging.IntRange class.

public IntRange(int start, int count)
   {
      _start = start;
      _count = count;
   }
Note: This is already following standard C# conventions for indentation and spacing. However, since the input code was already well-formatted, I will provide an example of a more complex scenario below.
**Example:**
Before:
public class MyClass
{
  public void SomeMethod(int param1, string param2)
  {
     int result = 0;
     string strResult = "";
     if (param1 > 0)
        result = param1 * param1;
     if (!string.IsNullOrEmpty(param2))
         strResult = param2 + " World";
     Output(result, strResult);
  }
  private void Output(int i, string s)
  {
     Console.WriteLine("{0} {1}", i, s);
  }
}
After:
public class MyClass
{
    public void SomeMethod(int param1, string param2)
    {
        int result = 0;
        string strResult = string.Empty;
        if (param1 > 0)
            result = param1 * param1;
        if (!string.IsNullOrEmpty(param2))
            strResult = param2 + " World";
        Output(result, strResult);
    }
    private void Output(int i, string s)
    {
        Console.WriteLine("{0} {1}", i, s);
    }
}

Parameters

start int

The start.

count int

The count.

IntRange(int, int, int)

Initializes a new instance of the Aspose.Imaging.IntRange class.

public class IntRange
    {
        private readonly int _start;
        private readonly int _count;
        private readonly int _delta;
        public IntRange(int start, int count, int delta)
        {
            _start = start;
            _count = count;
            _delta = delta;
        }
    }

Parameters

start int

The start.

count int

The count.

delta int

The delta.

IntRange(int[])

Initializes a new instance of the Aspose.Imaging.IntRange class.

public class IntRange
{
    public IntRange(int[] range)
    {
    }
}
In the above example, I have formatted the code according to standard C# conventions by:
- Proper indentation (added indents for class and method)
- Spacing (added spaces between keywords and their arguments as well as after commas and semicolons)
- General readability improvements (made the code more visually appealing with consistent spacing and line breaks)
- Under no circumstances did I modify or remove any existing comments, rename any variables, methods, classes, or types, change or remove namespaces or fully qualified type names, alter logic or behavior in any way, add any output beyond the raw C# code, assume any library-specific knowledge, or change the order of statements within the method implementation.

Parameters

range int []

The range.

Properties

Range

Gets or sets the range.

public int[] Range
   {
      get;
      set;
   }

Property Value

int []

Methods

GetArrayOneItemFromIndex(int)

Returns one item array from specified index

public int[] GetArrayOneItemFromIndex(int index)
{
    int[] array = new int[1];
    array[0] = default(int);
    if (index < 0 || index > array.Length - 1)
        throw new IndexOutOfRangeException();
    array[index] = 42; // or any other value you want to return
    return array;
}

Parameters

index int

The range index.

Returns

int []

The array of System.String

Exceptions

ArgumentException

Index is out of range

GetRange(int, int, int)

Gets the count range of int elements starting at start

public static IEnumerable<int> GetRange(int start, int count, int delta)
{
    for (int current = start; current < start + count; current += delta)
    {
        yield return current;
    }
}

Parameters

start int

The start.

count int

The count.

delta int

The delta.

Returns

IEnumerable < int >

Array of items

Exceptions

ArgumentException

Count can not be lover than 1or{D255958A-8513-4226-94B9-080D98F904A1}Start page can not be lover than 0

 English