A modeling framework is proposed for circuits that are subject both to externally induced switches (time events) and to state events. The framework applies to switched networks with linear and piecewise-linear elements, including diodes. We show that the linear complementarity formulation, which already has proved effective for piecewise-linear networks, can be extended in a natural way to also cover switching circuits. To achieve this, we use a generalization of the linear complementarity problem known as the cone-complementarity problem.We show that the proposed framework is sound in the sense that existence and uniqueness of solutions is guaranteed under a passivity assumption. We prove that only first-order impulses occur and characteri...