private void Awake()
 {
     this.Samples.Add(new SampleDescriptor(typeof(TextureDownloadSample), "Texture Download", "With HTTPManager.MaxConnectionPerServer you can control how many requests can be processed per server parallel.\n\nFeatures demoed in this example:\n-Parallel requests to the same server\n-Controlling the parallelization\n-Automatic Caching\n-Create a Texture2D from the downloaded data", CodeBlocks.TextureDownloadSample));
     this.Samples.Add(new SampleDescriptor(typeof(AssetBundleSample), "AssetBundle Download", "A small example that shows a possible way to download an AssetBundle and load a resource from it.\n\nFeatures demoed in this example:\n-Using HTTPRequest without a callback\n-Using HTTPRequest in a Coroutine\n-Loading an AssetBundle from the downloaded bytes\n-Automatic Caching", CodeBlocks.AssetBundleSample));
     this.Samples.Add(new SampleDescriptor(typeof(LargeFileDownloadSample), "Large File Download", "This example demonstrates how you can download a (large) file and continue the download after the connection is aborted.\n\nFeatures demoed in this example:\n-Setting up a streamed download\n-How to access the downloaded data while the download is in progress\n-Setting the HTTPRequest's StreamFragmentSize to controll the frequency and size of the fragments\n-How to use the SetRangeHeader to continue a previously disconnected download\n-How to disable the local, automatic caching", CodeBlocks.LargeFileDownloadSample));
     this.Samples.Add(new SampleDescriptor(typeof(WebSocketSample), "WebSocket - Echo", "A WebSocket demonstration that connects to a WebSocket echo service.\n\nFeatures demoed in this example:\n-Basic useage of the WebSocket class", CodeBlocks.WebSocketSample));
     this.Samples.Add(new SampleDescriptor(typeof(SocketIOChatSample), "Socket.IO - Chat", "This example uses the Socket.IO implementation to connect to the official Chat demo server(http://chat.socket.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Changing SocketOptions property\n-Subscribing to Socket.IO events\n-Sending custom events to the server", CodeBlocks.SocketIOChatSample));
     this.Samples.Add(new SampleDescriptor(typeof(SocketIOWePlaySample), "Socket.IO - WePlay", "This example uses the Socket.IO implementation to connect to the official WePlay demo server(http://weplay.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Subscribing to Socket.IO events\n-Receiving binary data\n-How to load a texture from the received binary data\n-How to disable payload decoding for fine tune for some speed\n-Sending custom events to the server", CodeBlocks.SocketIOWePlaySample));
     this.Samples.Add(new SampleDescriptor(typeof(CacheMaintenanceSample), "Cache Maintenance", "With this demo you can see how you can use the HTTPCacheService's BeginMaintainence function to delete too old cached entities and keep the cache size under a specified value.\n\nFeatures demoed in this example:\n-How to set up a HTTPCacheMaintananceParams\n-How to call the BeginMaintainence function", CodeBlocks.CacheMaintenanceSample));
     SampleSelector.SelectedSample = this.Samples[0];
 }
 private void DrawSample(SampleDescriptor sample)
 {
     if (GUILayout.Button(sample.DisplayName, new GUILayoutOption[0]))
     {
         sample.IsSelected = true;
         if (SampleSelector.SelectedSample != null)
         {
             SampleSelector.SelectedSample.IsSelected = false;
         }
         SampleSelector.SelectedSample = sample;
     }
 }
Example #3
0
    private void DrawSample(SampleDescriptor sample)
    {
        if (GUILayout.Button(sample.DisplayName))
        {
            sample.IsSelected = true;

            if (SelectedSample != null)
            {
                SelectedSample.IsSelected = false;
            }

            SelectedSample = sample;
        }
    }
Example #4
0
    // Token: 0x060025AA RID: 9642 RVA: 0x000B9C44 File Offset: 0x000B8044
    private void DrawSampleDetails(SampleDescriptor sample)
    {
        Rect rect = new Rect((float)(Screen.width / 3), 165f, (float)(Screen.width / 3 * 2), (float)(Screen.height - 160 - 5));

        GUI.Box(rect, string.Empty);
        GUILayout.BeginArea(rect);
        GUILayout.BeginVertical(new GUILayoutOption[0]);
        GUIHelper.DrawCenteredText(sample.DisplayName);
        GUILayout.Space(5f);
        GUILayout.Label(sample.Description, new GUILayoutOption[0]);
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Start Sample", new GUILayoutOption[0]))
        {
            sample.CreateUnityObject();
        }
        GUILayout.EndVertical();
        GUILayout.EndArea();
    }
Example #5
0
 // Token: 0x060025A9 RID: 9641 RVA: 0x000B9BD0 File Offset: 0x000B7FD0
 private void DrawSample(SampleDescriptor sample)
 {
     if (sample.IsLabel)
     {
         GUILayout.Space(15f);
         GUIHelper.DrawCenteredText(sample.DisplayName);
         GUILayout.Space(5f);
     }
     else if (GUILayout.Button(sample.DisplayName, new GUILayoutOption[0]))
     {
         sample.IsSelected = true;
         if (SampleSelector.SelectedSample != null)
         {
             SampleSelector.SelectedSample.IsSelected = false;
         }
         SampleSelector.SelectedSample = sample;
     }
 }
Example #6
0
    private void Awake()
    {
        HTTPManager.Logger.Level = Loglevels.All;
        HTTPManager.UseAlternateSSLDefaultValue = true;
        SampleDescriptor item = new SampleDescriptor(null, "HTTP Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        };

        this.Samples.Add(item);
        this.Samples.Add(new SampleDescriptor(typeof(TextureDownloadSample), "Texture Download", "With HTTPManager.MaxConnectionPerServer you can control how many requests can be processed per server parallel.\n\nFeatures demoed in this example:\n-Parallel requests to the same server\n-Controlling the parallelization\n-Automatic Caching\n-Create a Texture2D from the downloaded data", CodeBlocks.TextureDownloadSample));
        this.Samples.Add(new SampleDescriptor(typeof(AssetBundleSample), "AssetBundle Download", "A small example that shows a possible way to download an AssetBundle and load a resource from it.\n\nFeatures demoed in this example:\n-Using HTTPRequest without a callback\n-Using HTTPRequest in a Coroutine\n-Loading an AssetBundle from the downloaded bytes\n-Automatic Caching", CodeBlocks.AssetBundleSample));
        this.Samples.Add(new SampleDescriptor(typeof(LargeFileDownloadSample), "Large File Download", "This example demonstrates how you can download a (large) file and continue the download after the connection is aborted.\n\nFeatures demoed in this example:\n-Setting up a streamed download\n-How to access the downloaded data while the download is in progress\n-Setting the HTTPRequest's StreamFragmentSize to controll the frequency and size of the fragments\n-How to use the SetRangeHeader to continue a previously disconnected download\n-How to disable the local, automatic caching", CodeBlocks.LargeFileDownloadSample));
        item = new SampleDescriptor(null, "WebSocket Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        };
        this.Samples.Add(item);
        this.Samples.Add(new SampleDescriptor(typeof(WebSocketSample), "Echo", "A WebSocket demonstration that connects to a WebSocket echo service.\n\nFeatures demoed in this example:\n-Basic usage of the WebSocket class", CodeBlocks.WebSocketSample));
        item = new SampleDescriptor(null, "Socket.IO Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        };
        this.Samples.Add(item);
        this.Samples.Add(new SampleDescriptor(typeof(SocketIOChatSample), "Chat", "This example uses the Socket.IO implementation to connect to the official Chat demo server(http://chat.socket.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Changing SocketOptions property\n-Subscribing to Socket.IO events\n-Sending custom events to the server", CodeBlocks.SocketIOChatSample));
        this.Samples.Add(new SampleDescriptor(typeof(SocketIOWePlaySample), "WePlay", "This example uses the Socket.IO implementation to connect to the official WePlay demo server(http://weplay.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Subscribing to Socket.IO events\n-Receiving binary data\n-How to load a texture from the received binary data\n-How to disable payload decoding for fine tune for some speed\n-Sending custom events to the server", CodeBlocks.SocketIOWePlaySample));
        item = new SampleDescriptor(null, "SignalR Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        };
        this.Samples.Add(item);
        this.Samples.Add(new SampleDescriptor(typeof(SimpleStreamingSample), "Simple Streaming", "A very simple example of a background thread that broadcasts the server time to all connected clients every two seconds.\n\nFeatures demoed in this example:\n-Subscribing and handling non-hub messages", CodeBlocks.SignalR_SimpleStreamingSample));
        this.Samples.Add(new SampleDescriptor(typeof(ConnectionAPISample), "Connection API", "Demonstrates all features of the lower-level connection API including starting and stopping, sending and receiving messages, and managing groups.\n\nFeatures demoed in this example:\n-Instantiating and setting up a SignalR Connection to connect to a SignalR server\n-Changing the default Json encoder\n-Subscribing to state changes\n-Receiving and handling of non-hub messages\n-Sending non-hub messages\n-Managing groups", CodeBlocks.SignalR_ConnectionAPISample));
        this.Samples.Add(new SampleDescriptor(typeof(ConnectionStatusSample), "Connection Status", "Demonstrates how to handle the events that are raised when connections connect, reconnect and disconnect from the Hub API.\n\nFeatures demoed in this example:\n-Connecting to a Hub\n-Setting up a callback for Hub events\n-Handling server-sent method call requests\n-Calling a Hub-method on the server-side\n-Opening and closing the SignalR Connection", CodeBlocks.SignalR_ConnectionStatusSample));
        this.Samples.Add(new SampleDescriptor(typeof(DemoHubSample), "Demo Hub", "A contrived example that exploits every feature of the Hub API.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Handling long running server-side functions by handling progress messages\n-Groups\n-Handling server-side functions with return value\n-Handling server-side functions throwing Exceptions\n-Calling server-side functions with complex type parameters\n-Calling server-side functions with array parameters\n-Calling overloaded server-side functions\n-Changing Hub states\n-Receiving and handling hub state changes\n-Calling server-side functions implemented in VB .NET", CodeBlocks.SignalR_DemoHubSample));
        this.Samples.Add(new SampleDescriptor(typeof(AuthenticationSample), "Authentication", "Demonstrates how to use the authorization features of the Hub API to restrict certain Hubs and methods to specific users.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Create and use a Header-based authenticator to access protected APIs\n-SignalR over HTTPS", CodeBlocks.SignalR_AuthenticationSample));
        item = new SampleDescriptor(null, "Plugin Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        };
        this.Samples.Add(item);
        this.Samples.Add(new SampleDescriptor(typeof(CacheMaintenanceSample), "Cache Maintenance", "With this demo you can see how you can use the HTTPCacheService's BeginMaintainence function to delete too old cached entities and keep the cache size under a specified value.\n\nFeatures demoed in this example:\n-How to set up a HTTPCacheMaintananceParams\n-How to call the BeginMaintainence function", CodeBlocks.CacheMaintenanceSample));
        SelectedSample = this.Samples[1];
    }
Example #7
0
    private void DrawSampleDetails(SampleDescriptor sample)
    {
        Rect area = new Rect(Screen.width / 3, statisticsHeight + 5, (Screen.width / 3) * 2, Screen.height - statisticsHeight - 5);

        GUI.Box(area, string.Empty);

        GUILayout.BeginArea(area);
        GUILayout.BeginVertical();
        GUIHelper.DrawCenteredText(sample.DisplayName);
        GUILayout.Space(5);
        GUILayout.Label(sample.Description);
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("Start Sample"))
        {
            sample.CreateUnityObject();
        }

        GUILayout.EndVertical();
        GUILayout.EndArea();
    }
Example #8
0
    void Awake()
    {
        HTTPManager.Logger.Level = BestHTTP.Logger.Loglevels.All;

#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
        BestHTTP.HTTPManager.UseAlternateSSLDefaultValue = true;
#endif

#if UNITY_SAMSUNGTV
        SamsungTV.touchPadMode = SamsungTV.TouchPadMode.Mouse;

        // Create a red 'cursor' to see where we are pointing to
        Texture2D tex = new Texture2D(8, 8, TextureFormat.RGB24, false);
        for (int i = 0; i < tex.width; ++i)
        {
            for (int cv = 0; cv < tex.height; ++cv)
            {
                tex.SetPixel(i, cv, Color.red);
            }
        }
        tex.Apply(false, true);
        Cursor.SetCursor(tex, Vector2.zero, CursorMode.Auto);
#endif

#if UNITY_WEBPLAYER
    #if !BESTHTTP_DISABLE_PROXY
        // Set up a global proxy in webplayer builds to breach the Socket Policy Service restriction
        BestHTTP.HTTPManager.Proxy = new BestHTTP.HTTPProxy(new Uri("http://u3assets.cloudapp.net:8888"), null, true);
    #endif
#endif
        Samples.Add(new SampleDescriptor(null, "HTTP Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        });

        Samples.Add(new SampleDescriptor(typeof(TextureDownloadSample), "Texture Download", "With HTTPManager.MaxConnectionPerServer you can control how many requests can be processed per server parallel.\n\nFeatures demoed in this example:\n-Parallel requests to the same server\n-Controlling the parallelization\n-Automatic Caching\n-Create a Texture2D from the downloaded data", CodeBlocks.TextureDownloadSample));
        Samples.Add(new SampleDescriptor(typeof(AssetBundleSample), "AssetBundle Download", "A small example that shows a possible way to download an AssetBundle and load a resource from it.\n\nFeatures demoed in this example:\n-Using HTTPRequest without a callback\n-Using HTTPRequest in a Coroutine\n-Loading an AssetBundle from the downloaded bytes\n-Automatic Caching", CodeBlocks.AssetBundleSample));
#if !UNITY_WEBGL || UNITY_EDITOR
        Samples.Add(new SampleDescriptor(typeof(LargeFileDownloadSample), "Large File Download", "This example demonstrates how you can download a (large) file and continue the download after the connection is aborted.\n\nFeatures demoed in this example:\n-Setting up a streamed download\n-How to access the downloaded data while the download is in progress\n-Setting the HTTPRequest's StreamFragmentSize to controll the frequency and size of the fragments\n-How to use the SetRangeHeader to continue a previously disconnected download\n-How to disable the local, automatic caching", CodeBlocks.LargeFileDownloadSample));
#endif

#if !BESTHTTP_DISABLE_WEBSOCKET
        Samples.Add(new SampleDescriptor(null, "WebSocket Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        });
        Samples.Add(new SampleDescriptor(typeof(WebSocketSample), "Echo", "A WebSocket demonstration that connects to a WebSocket echo service.\n\nFeatures demoed in this example:\n-Basic useage of the WebSocket class", CodeBlocks.WebSocketSample));
#endif

#if !BESTHTTP_DISABLE_SOCKETIO
        Samples.Add(new SampleDescriptor(null, "Socket.IO Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        });
        Samples.Add(new SampleDescriptor(typeof(SocketIOChatSample), "Chat", "This example uses the Socket.IO implementation to connect to the official Chat demo server(http://chat.socket.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Changing SocketOptions property\n-Subscribing to Socket.IO events\n-Sending custom events to the server", CodeBlocks.SocketIOChatSample));
        Samples.Add(new SampleDescriptor(typeof(SocketIOWePlaySample), "WePlay", "This example uses the Socket.IO implementation to connect to the official WePlay demo server(http://weplay.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Subscribing to Socket.IO events\n-Receiving binary data\n-How to load a texture from the received binary data\n-How to disable payload decoding for fine tune for some speed\n-Sending custom events to the server", CodeBlocks.SocketIOWePlaySample));
#endif

#if !BESTHTTP_DISABLE_SIGNALR
        Samples.Add(new SampleDescriptor(null, "SignalR Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        });
        Samples.Add(new SampleDescriptor(typeof(SimpleStreamingSample), "Simple Streaming", "A very simple example of a background thread that broadcasts the server time to all connected clients every two seconds.\n\nFeatures demoed in this example:\n-Subscribing and handling non-hub messages", CodeBlocks.SignalR_SimpleStreamingSample));
        Samples.Add(new SampleDescriptor(typeof(ConnectionAPISample), "Connection API", "Demonstrates all features of the lower-level connection API including starting and stopping, sending and receiving messages, and managing groups.\n\nFeatures demoed in this example:\n-Instantiating and setting up a SignalR Connection to connect to a SignalR server\n-Changing the default Json encoder\n-Subscribing to state changes\n-Receiving and handling of non-hub messages\n-Sending non-hub messages\n-Managing groups", CodeBlocks.SignalR_ConnectionAPISample));
        Samples.Add(new SampleDescriptor(typeof(ConnectionStatusSample), "Connection Status", "Demonstrates how to handle the events that are raised when connections connect, reconnect and disconnect from the Hub API.\n\nFeatures demoed in this example:\n-Connecting to a Hub\n-Setting up a callback for Hub events\n-Handling server-sent method call requests\n-Calling a Hub-method on the server-side\n-Opening and closing the SignalR Connection", CodeBlocks.SignalR_ConnectionStatusSample));
        Samples.Add(new SampleDescriptor(typeof(DemoHubSample), "Demo Hub", "A contrived example that exploits every feature of the Hub API.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Handling long running server-side functions by handling progress messages\n-Groups\n-Handling server-side functions with return value\n-Handling server-side functions throwing Exceptions\n-Calling server-side functions with complex type parameters\n-Calling server-side functions with array parameters\n-Calling overloaded server-side functions\n-Changing Hub states\n-Receiving and handling hub state changes\n-Calling server-side functions implemented in VB .NET", CodeBlocks.SignalR_DemoHubSample));
#if !UNITY_WEBGL
        Samples.Add(new SampleDescriptor(typeof(AuthenticationSample), "Authentication", "Demonstrates how to use the authorization features of the Hub API to restrict certain Hubs and methods to specific users.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Create and use a Header-based authenticator to access protected APIs\n-SignalR over HTTPS", CodeBlocks.SignalR_AuthenticationSample));
#endif
#endif

#if !BESTHTTP_DISABLE_CACHING && (!UNITY_WEBGL || UNITY_EDITOR)
        Samples.Add(new SampleDescriptor(null, "Plugin Samples", string.Empty, string.Empty)
        {
            IsLabel = true
        });
        Samples.Add(new SampleDescriptor(typeof(CacheMaintenanceSample), "Cache Maintenance", "With this demo you can see how you can use the HTTPCacheService's BeginMaintainence function to delete too old cached entities and keep the cache size under a specified value.\n\nFeatures demoed in this example:\n-How to set up a HTTPCacheMaintananceParams\n-How to call the BeginMaintainence function", CodeBlocks.CacheMaintenanceSample));
#endif

        SelectedSample = Samples[1];
    }
Example #9
0
    void Awake()
    {
        HTTPManager.Logger.Level = BestHTTP.Logger.Loglevels.All;
        BestHTTP.HTTPManager.UseAlternateSSLDefaultValue = true;

#if UNITY_SAMSUNGTV
        SamsungTV.touchPadMode = SamsungTV.TouchPadMode.Mouse;

        // Create a red 'cursor' to see where we are pointing to
        Texture2D tex = new Texture2D(8, 8, TextureFormat.RGB24, false);
        for (int i = 0; i < tex.width; ++i)
            for (int cv = 0; cv < tex.height; ++cv)
                tex.SetPixel(i, cv, Color.red);
        tex.Apply(false, true);
        Cursor.SetCursor(tex, Vector2.zero, CursorMode.Auto);
#endif

#if UNITY_WEBPLAYER
    #if !BESTHTTP_DISABLE_PROXY
        // Set up a global proxy in webplayer builds to breach the Socket Policy Service restriction
        BestHTTP.HTTPManager.Proxy = new BestHTTP.HTTPProxy(new Uri("http://u3assets.cloudapp.net:8888"), null, true);
    #endif      
#endif
        Samples.Add(new SampleDescriptor(null, "HTTP Samples", string.Empty, string.Empty) { IsLabel = true } );

        Samples.Add(new SampleDescriptor(typeof(TextureDownloadSample), "Texture Download", "With HTTPManager.MaxConnectionPerServer you can control how many requests can be processed per server parallel.\n\nFeatures demoed in this example:\n-Parallel requests to the same server\n-Controlling the parallelization\n-Automatic Caching\n-Create a Texture2D from the downloaded data", CodeBlocks.TextureDownloadSample));
        Samples.Add(new SampleDescriptor(typeof(AssetBundleSample), "AssetBundle Download", "A small example that shows a possible way to download an AssetBundle and load a resource from it.\n\nFeatures demoed in this example:\n-Using HTTPRequest without a callback\n-Using HTTPRequest in a Coroutine\n-Loading an AssetBundle from the downloaded bytes\n-Automatic Caching", CodeBlocks.AssetBundleSample));
        Samples.Add(new SampleDescriptor(typeof(LargeFileDownloadSample), "Large File Download", "This example demonstrates how you can download a (large) file and continue the download after the connection is aborted.\n\nFeatures demoed in this example:\n-Setting up a streamed download\n-How to access the downloaded data while the download is in progress\n-Setting the HTTPRequest's StreamFragmentSize to controll the frequency and size of the fragments\n-How to use the SetRangeHeader to continue a previously disconnected download\n-How to disable the local, automatic caching", CodeBlocks.LargeFileDownloadSample));

#if !BESTHTTP_DISABLE_WEBSOCKET
        Samples.Add(new SampleDescriptor(null, "WebSocket Samples", string.Empty, string.Empty) { IsLabel = true });
        Samples.Add(new SampleDescriptor(typeof(WebSocketSample), "Echo", "A WebSocket demonstration that connects to a WebSocket echo service.\n\nFeatures demoed in this example:\n-Basic useage of the WebSocket class", CodeBlocks.WebSocketSample));
#endif

#if !BESTHTTP_DISABLE_SOCKETIO
        Samples.Add(new SampleDescriptor(null, "Socket.IO Samples", string.Empty, string.Empty) { IsLabel = true });
        Samples.Add(new SampleDescriptor(typeof(SocketIOChatSample), "Chat", "This example uses the Socket.IO implementation to connect to the official Chat demo server(http://chat.socket.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Changing SocketOptions property\n-Subscribing to Socket.IO events\n-Sending custom events to the server", CodeBlocks.SocketIOChatSample));
        Samples.Add(new SampleDescriptor(typeof(SocketIOWePlaySample), "WePlay", "This example uses the Socket.IO implementation to connect to the official WePlay demo server(http://weplay.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Subscribing to Socket.IO events\n-Receiving binary data\n-How to load a texture from the received binary data\n-How to disable payload decoding for fine tune for some speed\n-Sending custom events to the server", CodeBlocks.SocketIOWePlaySample));
#endif

#if !BESTHTTP_DISABLE_SIGNALR
        Samples.Add(new SampleDescriptor(null, "SignalR Samples", string.Empty, string.Empty) { IsLabel = true });
        Samples.Add(new SampleDescriptor(typeof(SimpleStreamingSample), "Simple Streaming", "A very simple example of a background thread that broadcasts the server time to all connected clients every two seconds.\n\nFeatures demoed in this example:\n-Subscribing and handling non-hub messages", CodeBlocks.SignalR_SimpleStreamingSample));
        Samples.Add(new SampleDescriptor(typeof(ConnectionAPISample), "Connection API", "Demonstrates all features of the lower-level connection API including starting and stopping, sending and receiving messages, and managing groups.\n\nFeatures demoed in this example:\n-Instantiating and setting up a SignalR Connection to connect to a SignalR server\n-Changing the default Json encoder\n-Subscribing to state changes\n-Receiving and handling of non-hub messages\n-Sending non-hub messages\n-Managing groups", CodeBlocks.SignalR_ConnectionAPISample));
        Samples.Add(new SampleDescriptor(typeof(ConnectionStatusSample), "Connection Status", "Demonstrates how to handle the events that are raised when connections connect, reconnect and disconnect from the Hub API.\n\nFeatures demoed in this example:\n-Connecting to a Hub\n-Setting up a callback for Hub events\n-Handling server-sent method call requests\n-Calling a Hub-method on the server-side\n-Opening and closing the SignalR Connection", CodeBlocks.SignalR_ConnectionStatusSample));
        Samples.Add(new SampleDescriptor(typeof(DemoHubSample), "Demo Hub", "A contrived example that exploits every feature of the Hub API.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Handling long running server-side functions by handling progress messages\n-Groups\n-Handling server-side functions with return value\n-Handling server-side functions throwing Exceptions\n-Calling server-side functions with complex type parameters\n-Calling server-side functions with array parameters\n-Calling overloaded server-side functions\n-Changing Hub states\n-Receiving and handling hub state changes\n-Calling server-side functions implemented in VB .NET", CodeBlocks.SignalR_DemoHubSample));
        Samples.Add(new SampleDescriptor(typeof(AuthenticationSample), "Authentication", "Demonstrates how to use the authorization features of the Hub API to restrict certain Hubs and methods to specific users.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Create and use a Header-based authenticator to access protected APIs\n-SignalR over HTTPS", CodeBlocks.SignalR_AuthenticationSample));
#endif

#if !BESTHTTP_DISABLE_CACHING
        Samples.Add(new SampleDescriptor(null, "Plugin Samples", string.Empty, string.Empty) { IsLabel = true });
        Samples.Add(new SampleDescriptor(typeof(CacheMaintenanceSample), "Cache Maintenance", "With this demo you can see how you can use the HTTPCacheService's BeginMaintainence function to delete too old cached entities and keep the cache size under a specified value.\n\nFeatures demoed in this example:\n-How to set up a HTTPCacheMaintananceParams\n-How to call the BeginMaintainence function", CodeBlocks.CacheMaintenanceSample));
#endif

        SelectedSample = Samples[1];
    }
Example #10
0
    private void DrawSampleDetails(SampleDescriptor sample)
    {
        Rect area = new Rect(Screen.width / 3, statisticsHeight + 5, (Screen.width / 3) * 2, Screen.height - statisticsHeight - 5);
        GUI.Box(area, string.Empty);

        GUILayout.BeginArea(area);
            GUILayout.BeginVertical();
                GUIHelper.DrawCenteredText(sample.DisplayName);
                GUILayout.Space(5);
                GUILayout.Label(sample.Description);
                GUILayout.FlexibleSpace();

                if (GUILayout.Button("Start Sample"))
                    sample.CreateUnityObject();

            GUILayout.EndVertical();
        GUILayout.EndArea();
    }
Example #11
0
    private void DrawSample(SampleDescriptor sample)
    {
        if (sample.IsLabel)
        {
            GUILayout.Space(15);
            GUIHelper.DrawCenteredText(sample.DisplayName);
            GUILayout.Space(5);
        }
        else if (GUILayout.Button(sample.DisplayName))
        {
            sample.IsSelected = true;

            if (SelectedSample != null)
                SelectedSample.IsSelected = false;

            SelectedSample = sample;
        }
    }