Hex Editor - Binary File Editing Software for Windows
Download Hex Editor Neo Hide this button

PC.IPatternColoring Interface

This interface exposes functionality provided by Hex Editor Neo's Pattern Coloring component. Use the global object pc to obtain a reference to this interface.

Declaration

interface PC.IPatternColoring {
    // Properties
    readonly ${rulesCount}: number;
    ${coloringEnabled}: boolean;

    // Methods
    ${getRule}(index: number): ${PC.IRule};
    ${addRule}(rule: ${PC.IRule}): number;
    ${replaceRule}(index: number, rule: ${PC.IRule}): void;
    ${insertRule}(index: number, rule: ${PC.IRule}): void;
    ${removeRule}(index: number): ${PC.IRule};
    ${moveRule}(from: number, to: number): void;
    ${toggleRule}(index: number, state?: boolean): void;
    ${clear}(): void;
    ${loadRules}(path: string): void;
    ${saveRules}(path: string): void;
    ${enableAll}(newState: boolean): void;
}
// This interface is not available in managed environment
// This interface is not available in native environment

PC.IPatternColoring Properties

rulesCount

readonly rulesCount: number;
// This property is not available in managed environment
// This property is not available in native environment

Current number of rules

coloringEnabled

coloringEnabled: boolean;
// This property is not available in managed environment
// This property is not available in native environment

True if pattern coloring is enabled.

PC.IPatternColoring Methods

getRule

getRule(index: number): ${PC.IRule};
// This method is not available in managed environment
// This method is not available in native environment
index
Index of the rule to read.

Rule object stored at a given object.

Note that returned object is a copy of an actual rule. If you have made any changes to its properties, use methods of this interface to update existing rule or add a new rule.

Get rule at index.

addRule

addRule(rule: ${PC.IRule}): number;
// This method is not available in managed environment
// This method is not available in native environment
rule
New rule object.

Ordinal of a newly added rule.

Add new pattern coloring rule.

replaceRule

replaceRule(index: number, rule: ${PC.IRule}): void;
// This method is not available in managed environment
// This method is not available in native environment
index
Index of the rule to replace.
rule
New rule object.

Replace rule at a given index.

insertRule

insertRule(index: number, rule: ${PC.IRule}): void;
// This method is not available in managed environment
// This method is not available in native environment
index
Index of the rule to insert.
rule
New rule object.

Insert new rule at specified index.

removeRule

removeRule(index: number): ${PC.IRule};
// This method is not available in managed environment
// This method is not available in native environment
index
Index of the rule to remove.

A copy of removed rule object.

Remove rule at specified index.

moveRule

moveRule(from: number, to: number): void;
// This method is not available in managed environment
// This method is not available in native environment
from
Original index of the rule.
to
New index of the rule. Note that this new index is calculated before the rule is removed from the original position.

Move rule from one position to another.

toggleRule

toggleRule(index: number, state?: boolean): void;
// This method is not available in managed environment
// This method is not available in native environment
index
Index of the rule.
state
New state of the rule. If omitted, the rule's state is toggled.

Toggle rule's state or set the state of the rule.

clear

clear(): void;
// This method is not available in managed environment
// This method is not available in native environment

Delete all pattern coloring rules.

loadRules

loadRules(path: string): void;
// This method is not available in managed environment
// This method is not available in native environment
path
Path of the file.

Load rules from a file.

saveRules

saveRules(path: string): void;
// This method is not available in managed environment
// This method is not available in native environment
path
Path of the file.

Save rules to a file.

enableAll

enableAll(newState: boolean): void;
// This method is not available in managed environment
// This method is not available in native environment
newState
New state for all rules.

Enable or disable all rules.