Say I have a SlimDX based game editor. I have a DeviceContext instance which basically controls all states of the device, handles lost device, creates it, etc. The editor does not always have a view-port open where rendering is taking place. Instead it contains various editors, a scene editor, texture viewer/editor, animation editor, material editor, etc, etc.
Now say a user opens up the SceneEditor (a dialog with four views rendered into panels). When the editor is instanced, it grabs a reference from the DeviceContext and if found 'null' it calls on context.CreateDevice(Control ctrl). This method 'ensures' the device is not lost, null or disposed. If so, it takes care of it based on what is going on. Now the editor sends the 'CreateDevice' method the control(Panel) to use when creating/resetting the device, this control is the panel that represents the TopLeft view. Next it grabs a 'Device' reference from the context and then creates it's swap-chains views (being the other three view-port Panels).
Now let's say a user opens up the ModelViewer dialog. This too makes sure the device instance is not 'null' , if so calls on DeviceContext.CreateDevice(ModelViewPanel) and grabs the Device reference from it. If Device is not null, it creates a swap-chain for it's view (where the Model will be rendered).
Ok so we have a scene editor with four views (the TopLeft Panel being the control used to create the Device object) and three other Panel objects created as swap-chains. Next we have the ModelViewer that the user opened. This has a single panel created as a swap-chain.
My question is: Since the scene-editor has the control that initially created the device instance, what do I do if the user closes the scene editor? Do I call on Devi)ce.Reset() or create a 'new' Device()' using the presentation parameters of the ModelViewer?
Please ask to re-factor the question if something is not understood, thanks.