예제 #1
0
    bool IsDirty()
    {
        if (dirty)
        {
            dirty = false;
            return(true);
        }

        if (currentConfiguration == null || iconTemplate == null)
        {
            return(false);
        }

        var hash = MadHashCode.FirstPrime;

        hash = MadHashCode.Add(hash, currentConfiguration);
        hash = MadHashCode.Add(hash, configurationGroup);
        hash = MadHashCode.Add(hash, iconTemplate);
        hash = MadHashCode.Add(hash, backgroundTexture);
        hash = MadHashCode.Add(hash, (int)enumerationType);
        hash = MadHashCode.Add(hash, enumerationOffset);

        if (hash != lastHash)
        {
            lastHash = hash;
            return(true);
        }

        return(false);
    }
예제 #2
0
    private int ComputeHash()
    {
        var h = MadHashCode.FirstPrime;

        h = MadHashCode.Add(h, currentConfiguration);
        h = MadHashCode.Add(h, configurationGroup);
        h = MadHashCode.Add(h, hideManagedObjects);
        h = MadHashCode.Add(h, limitLevelsPerPage);
        h = MadHashCode.Add(h, levelsPerPage);
        h = MadHashCode.Add(h, (int)setupMethod);
        h = MadHashCode.Add(h, iconTemplate);
        h = MadHashCode.Add(h, iconScale);
        h = MadHashCode.Add(h, iconOffset);
        h = MadHashCode.Add(h, leftSlideSprite);
        h = MadHashCode.Add(h, leftSlideScale);
        h = MadHashCode.Add(h, leftSlideOffset);
        h = MadHashCode.Add(h, rightSlideSprite);
        h = MadHashCode.Add(h, rightSlideScale);
        h = MadHashCode.Add(h, rightSlideOffset);
        h = MadHashCode.Add(h, gridWidth);
        h = MadHashCode.Add(h, gridHeight);
        h = MadHashCode.Add(h, (int)horizontalAlign);
        h = MadHashCode.Add(h, (int)verticalAlign);
        h = MadHashCode.Add(h, pixelsWidth);
        h = MadHashCode.Add(h, pixelsHeight);
        h = MadHashCode.Add(h, pagesOffsetManual);
        h = MadHashCode.Add(h, pagesOffsetFromResolution);
        h = MadHashCode.Add(h, (int)enumerationType);
        h = MadHashCode.Add(h, enumerationOffset);
        h = MadHashCode.Add(h, (int)pagingMethod);
        h = MadHashCode.Add(h, pagingInvert);
        h = MadHashCode.Add(h, pagesOffsetPercent);

        return(h);
    }
예제 #3
0
    // ===========================================================
    // Methods
    // ===========================================================

    public override int GetHashCode()
    {
        var hash = new MadHashCode();

        hash.Add(texture);
        hash.Add(glyphs);
        hash.Add(linesCount);
        hash.Add(fillFactorTolerance);
        hash.Add(createStatus);
        hash.Add(created);
        hash.Add(material);
        hash.Add(dimensions);
        hash.Add(height);

        return(hash.GetHashCode());
    }
예제 #4
0
    // ===========================================================
    // Methods
    // ===========================================================

    private void UpdateTextIfNeeded()
    {
        int h = MadHashCode.FirstPrime;

        h += MadHashCode.Add(h, text);
        h += MadHashCode.Add(h, wordWrap);
        h += MadHashCode.Add(h, wordWrapLength);
        h += MadHashCode.Add(h, scale);

        if (h != hash)
        {
            UpdateText();
            hash = h;
        }
    }
    int ConfigurationHash()
    {
        var hash = new MadHashCode();

        hash.Add(bulletTextureOff);
        hash.Add(bulletTextureOn);
        hash.Add(hideManagedObjects);
        hash.Add(bulletDistance);
        hash.Add(guiDepth);
        if (draggable != null)
        {
            hash.Add(draggable.dragStopCount);
        }
        return(hash.GetHashCode());
    }
예제 #6
0
    int ComputeHash()
    {
        var hashCode = new MadHashCode();

        hashCode.Add(configuration);
        hashCode.Add(hideManagedObjects);
        hashCode.Add(setupMethod);
        hashCode.Add(iconTemplate);
        hashCode.Add(iconScale);
        hashCode.Add(iconOffset);
        hashCode.Add(leftSlideSprite);
        hashCode.Add(leftSlideScale);
        hashCode.Add(leftSlideOffset);
        hashCode.Add(rightSlideSprite);
        hashCode.Add(rightSlideScale);
        hashCode.Add(rightSlideOffset);
        hashCode.Add(gridWidth);
        hashCode.Add(gridHeight);
        hashCode.Add(pixelsWidth);
        hashCode.Add(pixelsHeight);
        hashCode.Add(pagesOffsetManual);
        hashCode.Add(pagesOffsetFromResolution);

        return(hashCode.GetHashCode());
    }