示例#1
0
        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;
            }
        }
示例#2
0
        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;
            }
        }