当前位置: 首页>>代码示例>>C#>>正文


C# Room.Commit方法代码示例

本文整理汇总了C#中Room.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# Room.Commit方法的具体用法?C# Room.Commit怎么用?C# Room.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Room的用法示例。


在下文中一共展示了Room.Commit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateRoom

 void CreateRoom()
 {
     // Create local Room.
     var room = new Room("Unity SDK Test Room", null);
     StartCoroutine(room.Commit(error =>
     {
         // Error on Commit.
         Debug.LogError(error.Message);
     }, success =>
     {
         // Move onto loading Room.
         var searchedRoom = new Room(room.Id);
         StartCoroutine(searchedRoom.Load(error =>
         {
             // Error on Load.
             Debug.LogError(error.Message);
         }, searchedRoomSuccess =>
         {
             if (searchedRoom.Title == room.Title)
             {
                 // Load Room proves it's passed here.
                 Debug.Log("Saving new Room to Spark passed!");
                 LoadRoom(searchedRoom);
             }
         }));
     }));
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:27,代码来源:TestRoom.cs

示例2: SetUp

 void SetUp()
 {
     // Create test room.
     var room = new Room("Unity SDK Test Room", null);
     StartCoroutine(room.Commit(error =>
     {
         // Error on Commit.
         IntegrationTest.Fail("Failed to create test room" + error.Message);
     }, success => {
         Test(room);
     }));
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:12,代码来源:TestUpdateRoom.cs

示例3: Test

 void Test(Room room)
 {
     // Update the room.
     room.Title = "Unity SDK Test Room - Updated";
     StartCoroutine(room.Commit(error =>
     {
         // Error on Commit.
         IntegrationTest.Fail(error.Message);
     }, success => {
         TearDown(room);
     }));
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:12,代码来源:TestUpdateRoom.cs

示例4: Test

 void Test()
 {
     var room = new Room("Unity SDK Test Room", null);
     StartCoroutine(room.Commit(error =>
     {
         // Error on Commit.
         IntegrationTest.Fail(error.Message);
     }, success =>
     {
         TearDown(room);
     }));
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:12,代码来源:TestCreateRoom.cs

示例5: SetUp

 void SetUp()
 {
     // Need a test room.
     var room = new Room("Unity SDK Test Room", null);
     StartCoroutine(room.Commit(error => {
         IntegrationTest.Fail("Failed to create test room: " + error.Message);
     }, success => {
         // Need a test message.
         var testMessage = new Message(room);
         testMessage.Text = "Test Message";
         StartCoroutine(testMessage.Commit(messageError => {
             IntegrationTest.Fail("Failed to create Test Message: " + messageError.Message);
         }, messageSuccess => {
             Test(testMessage);
         }));
     }));
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:17,代码来源:TestLoadMessage.cs

示例6: SetUp

 void SetUp()
 {
     // We need a test room for the messages.
     testRoom = new Room("Unity SDK Test Room", null);
     StartCoroutine(testRoom.Commit(error =>
     {
         IntegrationTest.Fail("Failed to create test room" + error.Message);
     }, success =>
     {
         // Need a message to look for.
         testMessage = new Message(testRoom);
         testMessage.Text = "Test Message";
         StartCoroutine(testMessage.Commit(error =>
         {
             TearDown();
             IntegrationTest.Fail("Failed to create test message: " + error.Message);
         }, createMessage =>
         {
             Test();
         }));
     }));
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:22,代码来源:TestListMessages.cs

示例7: CreateMessage

 void CreateMessage()
 {
     // Create Temporary Test Room.
     testRoom = new Room("Cisco Spark Unity Test Room", null);
     var roomCommit = testRoom.Commit(error =>
     {
         Debug.LogError("Couldn't create test room: " + error.Message);
     }, testRoomCreated =>
     {
         var testMessage = new Message(testRoom);
         testMessage.Text = testMessageContent;
         var messageCommit = testMessage.Commit(messageError =>
         {
             Debug.LogError("Create Message Failed: " + messageError.Message);
         }, createMessageSuccess =>
         {
             GetMessage(testMessage.Id);
         });
         StartCoroutine(messageCommit);
     });
     StartCoroutine(roomCommit);
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:22,代码来源:TestMessage.cs

示例8: TestStart

    void TestStart()
    {
        // Check people.
        if (testPersonid == Person.AuthenticatedUser.Id)
        {
            Fail("Test person cannot be the authenticated user.");
        }

        // Need a person and a room first!
        person = new Person(testPersonid);
        testRoom = new Room("Cisco Spark Unity SDK Test", null);
        // Commit Test Room.
        StartCoroutine(testRoom.Commit(error =>
        {
            Fail(error.Message);
        }, result =>
        {
            CreateMembership();
        }));
    }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:20,代码来源:TestMembership.cs

示例9: UpdateRoom

 void UpdateRoom(Room room)
 {
     room.Title = "Unity SDK Test Room - Updated";
     StartCoroutine(room.Commit(error =>
     {
         Debug.Log(room.Title);
         // Error on Update.
         Debug.LogError(error.Message);
     }, success =>
     {
         var checkUpdatedRoom = new Room(room.Id);
         StartCoroutine(checkUpdatedRoom.Load(error =>
         {
             Debug.LogError(error.Message);
         }, updateSuccess =>
         {
             if (checkUpdatedRoom.Title == room.Title)
             {
                 Debug.Log("Update Room passed!");
                 DeleteRoom(checkUpdatedRoom);
             }
         }));
     }));
 }
开发者ID:RichLogan,项目名称:CiscoSpark-UnitySDK,代码行数:24,代码来源:TestRoom.cs


注:本文中的Room.Commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。