If both operations are complex and can't be arranged into a single inheritance hierarchy, you should compose, not inherit. Take out the main features of each part into a provider class, so
class SensitiveTreeNode : SensitiveNode, TreeNode {
public void SomeSensitiveMethod(string arg) { ... }
public TreeNode Parent { get; set; }
}
... becomes:
class SensitiveTreeNode : Node, ISensitiveNode, ITreeNode {
public TreeNodeProvider TreeProvider {get; private set; }
public SensitivityProvider SensitivityProvider { get; private set; }
SensitiveTreeNode() {
TreeProvider = GetTreeNodeProvider();
SensitivityProvider = GetSensitivityProvider();
}
virtual TreeNodeProvider GetTreeNodeProvider() { return new TreeNodeProvider(this); }
virtual SensitivityProvider GetSensitivityProvider() { return new SensitivityProvider(this); }
}
class TreeNodeProvider {
ITreeNode host;
public ITreeNode Parent { get; set; }
public TreeNodeProvider(ITreeNode host) { this.host = host; }
}
class SensitivityProvider {
ISensitiveNode host;
public void SomeSensitiveMethod(string arg) { ... }
public SensitivityTreeNodeProvider(ISensitiveNode host) { this.host = host; }
}
interface ISensitiveNode {
SensitivityProvider SensitivityProvider { get; }
}
interface ITreeNode {
TreeNodeProvider TreeProvider { get; }
}
The providers are by their nature fairly general, as they will provide functionality for
any tree or sensitive node. If you want a special implementation for a particular node class, you can create a nested class which inherits from the appropriate base provider class, and assign that to the provider property.
This means that all calls to tree node or sensitive node methods and properties get an extra bit of text in them:
myTreeNode.TreeProvider.Parent = myOtherTreeNode;
... and it's quite a bit of work, so it's not perfect. It is the closest thing that can reasonably be done in C# (or Java or other single-inheritance languages) to inheriting two things, though – SensitiveTreeNode now really does provide two sets of functionality, and it is all inheritable, polymorphic etc (through overriding provider classes and GetXxxProvider methods).
The length of this reply emphasises how, if it is at all reasonable, you should try to make at least your main inheritance hierarchy be arranged so that you don't need multiple inheritance. In the case of your example, nodes are usually expected to be bound to a particular data structure; I would expect that you could make TreeNode be a base class and have sensitivity inherit from it. (Nodes not currently in a tree can simply have a null tree/parent.) But obviously we don't have the details of your problem and that may not be appropriate.