public KinectOutputHandler(IConfigurationService configurationService, Configuration.Adapter _config, KinectAdapter adapter)
        {
            this._configurationService = configurationService;
            this._config            = _config;
            this.adapter            = adapter;
            this.DataDir            = Path.Combine(this._configurationService.GetConfiguration().HomeDir, this._config.DataDir);
            this.ColorStreamPath    = Path.Combine(this.DataDir, this._config.ColorStreamFlushDir);
            this.DepthStreamPath    = Path.Combine(this.DataDir, this._config.DepthStreamFlushDir);
            this.SkeletonStreamPath = Path.Combine(this.DataDir, this._config.SkeletonStreamFlushDir);

            // Subscribe Frame Available Event
            this.adapter.FrameAvailable += flushFrames;
            // Subscribe to DepthAvailable Event
            this.adapter.DepthFramAvailable += flushDepth;
            // Subscribe to ColorAvailable Event
            this.adapter.ColorFramAvailable += flushColor;

            // Check if the DataDirectory exists
            if (!(Directory.Exists(this.DataDir)))
            {
                // Create the DataDirectory
                Directory.CreateDirectory(this.DataDir);
            }

            // ColorStream
            if (this._config.ColorStreamEnabled && this._config.ColorStreamFlush)
            {
                if (!Directory.Exists(this.ColorStreamPath))
                {
                    Directory.CreateDirectory(this.ColorStreamPath);
                }
            }

            // DepthStream
            if (this._config.DepthStreamEnabled && this._config.DepthStreamFlush)
            {
                if (!Directory.Exists(this.DepthStreamPath))
                {
                    Directory.CreateDirectory(this.DepthStreamPath);
                }
            }


            // SkeletonStream
            if (this._config.SkeletonStreamFlush)
            {
                if (!Directory.Exists(this.SkeletonStreamPath))
                {
                    Directory.CreateDirectory(this.SkeletonStreamPath);
                }
            }
        }
 public KinectEventHandler(KinectAdapter adapter, Configuration.Adapter _config)
 {
     this._config = _config;
     this.adapter = adapter;
 }