Add operators and override methods to PROPERTYKEY
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.5k
- Forks
- 123
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
I want to implement the UIRibbon in C# with the help from CsWin32. Here I need the PROPERTYKEY. In the UIRibbon I have to compare the values of PROPERTYKEYs. But the actual implementation had no features for comparing.
Describe the solution you'd like
Something like the following would be useful:
public static bool operator ==(PROPERTYKEY left, PROPERTYKEY right) =>
((left.fmtid == right.fmtid) && (left.pid == right.pid));
public static bool operator !=(PROPERTYKEY left, PROPERTYKEY right) => !(left == right);
public bool Equals(PROPERTYKEY other) => this == other;
public override bool Equals(object obj) => obj is PROPERTYKEY other && this.Equals(other);
public override int GetHashCode() => (fmtid.GetHashCode() ^ pid.GetHashCode());
public override string ToString() =>
"PROPERTYKEY: " + fmtid.ToString() + ":" + pid.ToString(System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named; start by locating the PROPERTYKEY definition in the CsWin32 source and inspect nearby generated supporting types for comparison conventions. Add the requested operators and overrides for PROPERTYKEY, then run the relevant project tests or build to verify the type compiles and comparisons behave as specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100