public DragDropElementController(IInputModel inputModel, KinectRegion kinectRegion) { this._inputModel = inputModel as ManipulatableModel; this._kinectRegion = kinectRegion; var manipulatableModel = this._inputModel; if (manipulatableModel != null) { _dragDropElement = manipulatableModel.Element as DragDropElement; manipulatableModel.ManipulationStarted += InputModel_ManipulationStarted; manipulatableModel.ManipulationUpdated += InputModel_ManipulationUpdated; manipulatableModel.ManipulationCompleted += InputModel_ManipulationCompleted; } }
private bool disposedValue; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). } _kinectRegion = null; _inputModel = null; _dragDropElement = null; _inputModel.ManipulationStarted -= InputModel_ManipulationStarted; _inputModel.ManipulationUpdated -= InputModel_ManipulationUpdated; _inputModel.ManipulationCompleted -= InputModel_ManipulationCompleted; disposedValue = true; } }