Example #1
0
        /// <summary>
        /// Construct a new surface.
        /// </summary>
        /// <param name="sIdentifier">The unique identifier for this surface.  Cannot be null.  If this is not unique, it will not be checked until the surface is registered with an authority.</param>
        public Surface(String sIdentifier)
        {
            // If the identifier is not valid, throw an error.
            if (sIdentifier == null || sIdentifier.Length == 0)
            {
                throw new Exception("Surface identifier cannot be empty.");
            }

            // Otherwise set the value.  HOWEVER.. this is not authorised by the authority.  It will be checked on registration.
            this.Authority_SetIdentifier(sIdentifier);

            // Load the debug for this surface.
            //pDebugImageControl = new Image();
            //pDebugImageControl.Source = new BitmapImage(new Uri("pack://application:,,,/UbiDisplays;component/Interface/Images/DebugImage.png"));

            // Generate a key to access the projected surface.
            sProjectionDisplayKey = System.Guid.NewGuid().ToString();

            // A surface control.
            pSurfaceContent           = new SurfaceView();
            pSurfaceContent.ShowDebug = true;

            // Create a projected display for this surface.
            pProjectionDisplay         = ProjectionRenderer.AddDisplay(sProjectionDisplayKey, pSurfaceContent);//, pDebugImageControl);
            pProjectionDisplay.Visible = true;
        }