public DragAndDropController(Draggable element, ManipulatableModel model, KinectRegion kinectRegion) { this.element = new WeakReference(element); this.kinectRegion = kinectRegion; this.inputModel = model; if (this.inputModel == null) { return; } this.eventSubscriptions = new CompositeDisposable { this.inputModel.ManipulationStartedObservable() .Subscribe(_ => VisualStateManager.GoToState(this.Control, "Entered", true)), this.inputModel.ManipulationInertiaStartingObservable() .Subscribe(_ => Debug.WriteLine(string.Format("ManipulationInertiaStarting: {0}, ", DateTime.Now))), this.inputModel.ManipulationUpdatedObservable() .Subscribe(_ => OnManipulationUpdated(_)), this.inputModel.ManipulationCompletedObservable() .Subscribe(_ => VisualStateManager.GoToState(this.Control, "Left", true)), }; }
//コンストラクタ public DragDropDecoratorController(IInputModel inputModel, KinectRegion kinectRegion) { _inputModel = inputModel as ManipulatableModel; _kinectRegion = kinectRegion; _dragDropDecorator = inputModel.Element as DragDropDecorator; _inputModel.ManipulationUpdated += inputModel_ManipulationUpdated; }
public IKinectController CreateController(IInputModel inputModel, KinectRegion kinectRegion) { // Only one controller is instantiated for one Control var model = new ManipulatableModel(inputModel.GestureRecognizer.GestureSettings, this); return(new DragAndDropController(this, model, kinectRegion)); }
private bool IsHandBelowScreen(PointF unclampedHandPosition, uint pointerId) { // if manipulatableModel is currently captured, means a grip for scroll or zoom is happening. // in that case, we should not disengage, even if the hand location qualifies. ManipulatableModel manipulatableModel = this.inputPointerManager.GetCapturedInputModel(pointerId) as ManipulatableModel; return(unclampedHandPosition.Y > 1.1 && manipulatableModel == null); }
//コンストラクタ public DragDropDecoratorController(IInputModel _inputModel, KinectRegion _kinectRegion) { inputModel = _inputModel as ManipulatableModel; kinectRegion = _kinectRegion; dragDropDecorator = _inputModel.Element as DragDropDecorator; inputModel.ManipulationUpdated += inputModel_ManipulationUpdated; }
public DragDropElementController(IInputModel inputModel, KinectRegion kinectRegion) { _inputModel = inputModel as ManipulatableModel; _kinectRegion = kinectRegion; _dragDropElement = _inputModel.Element as DragDropElement; _inputModel.ManipulationStarted += OnManipulationStarted; _inputModel.ManipulationUpdated += OnManipulationUpdated; _inputModel.ManipulationCompleted += OnManipulationCompleted; }
void System.IDisposable.Dispose() { if ( !disposed ) { kinectRegion = null; inputModel = null; dragDropDecorator = null; inputModel.ManipulationUpdated -= inputModel_ManipulationUpdated; disposed = true; } }
void System.IDisposable.Dispose() { if (!_disposed) { _kinectRegion = null; _inputModel = null; _dragDropDecorator = null; _inputModel.ManipulationUpdated -= inputModel_ManipulationUpdated; _disposed = true; } }
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; } }
//destruktor protected virtual void Dispose(bool disposing) { if (!_disposedValue) { _kinectRegion = null; _inputModel = null; _dragDropElement = null; _inputModel.ManipulationStarted -= OnManipulationStarted; _inputModel.ManipulationUpdated -= OnManipulationUpdated; _inputModel.ManipulationCompleted -= OnManipulationCompleted; _disposedValue = true; } }
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; } }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). } this.kinectRegion = null; this.inputModel = null; this.myThumb = null; this.inputModel.ManipulationStarted -= InputModel_ManipulationStarted; this.inputModel.ManipulationUpdated -= InputModel_ManipulationUpdated; this.inputModel.ManipulationCompleted -= InputModel_ManipulationCompleted; disposedValue = true; } }
public DragAndDropController(Draggable element, ManipulatableModel model, KinectRegion kinectRegion) { this.element = new WeakReference(element); this.kinectRegion = kinectRegion; this.inputModel = model; if (this.inputModel == null) return; this.eventSubscriptions = new CompositeDisposable { this.inputModel.ManipulationStartedObservable() .Subscribe(_ => VisualStateManager.GoToState(this.Control, "Entered", true)), this.inputModel.ManipulationInertiaStartingObservable() .Subscribe(_ => Debug.WriteLine(string.Format("ManipulationInertiaStarting: {0}, ", DateTime.Now))), this.inputModel.ManipulationUpdatedObservable() .Subscribe(_ => OnManipulationUpdated(_)), this.inputModel.ManipulationCompletedObservable() .Subscribe(_ => VisualStateManager.GoToState(this.Control, "Left", true)), }; }
public IKinectController CreateController(IInputModel inputModel, KinectRegion kinectRegion) { // Only one controller is instantiated for one Control var model = new ManipulatableModel(inputModel.GestureRecognizer.GestureSettings, this); return new DragAndDropController(this, model, kinectRegion); }
public static IObservable <KinectManipulationInertiaStartingEventArgs> ManipulationInertiaStartingObservable(this ManipulatableModel manipulatableModel) { return(GetObservable <KinectManipulationInertiaStartingEventArgs>(manipulatableModel, "ManipulationInertiaStarting")); }
private bool IsHandBelowScreen(PointF unclampedHandPosition, uint pointerId) { ManipulatableModel manipulatableModel = this.inputPointerManager.GetCapturedInputModel(pointerId) as ManipulatableModel; return(unclampedHandPosition.Y > 1.1 && manipulatableModel == null); }
public static IObservable <KinectManipulationCompletedEventArgs> ManipulationCompletedObservable(this ManipulatableModel manipulatableModel) { return(GetObservable <KinectManipulationCompletedEventArgs>(manipulatableModel, "ManipulationCompleted")); }
private static IObservable <T> GetObservable <T>(ManipulatableModel model, string eventName) { return(ModelObservable.GetObservable <ManipulatableModel, T>(model, eventName)); }