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


C# Conversation类代码示例

本文整理汇总了C#中Conversation的典型用法代码示例。如果您正苦于以下问题:C# Conversation类的具体用法?C# Conversation怎么用?C# Conversation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AssignConnectors

        private void AssignConnectors(DialogueEntry entry, Conversation conversation, HashSet<string> alreadyConnected, HashSet<int> entriesVisited, int level)
        {
            // Sanity check to prevent infinite recursion:
            if (level > 10000) return;

            // Set non-connectors:
            foreach (Link link in entry.outgoingLinks) {
                if (link.originConversationID == link.destinationConversationID) {
                    string destination = string.Format("{0}.{1}", link.destinationConversationID, link.destinationDialogueID);
                    if (alreadyConnected.Contains(destination)) {
                        link.isConnector = true;
                    } else {
                        link.isConnector = false;
                        alreadyConnected.Add(destination);
                    }
                }
            }

            // Then process each child:
            foreach (Link link in entry.outgoingLinks) {
                if (link.originConversationID == link.destinationConversationID) {
                    if (!entriesVisited.Contains(link.destinationDialogueID)) {
                        entriesVisited.Add(link.destinationDialogueID);
                        var childEntry = conversation.GetDialogueEntry(link.destinationDialogueID);
                        if (childEntry != null) {
                            AssignConnectors(childEntry, conversation, alreadyConnected, entriesVisited, level + 1);
                        }
                    }
                }
            }
        }
开发者ID:farreltr,项目名称:OneLastSunset,代码行数:31,代码来源:DialogueEditorWindowDatabaseSection.cs

示例2: BeginCinematic

    public void BeginCinematic(Type CinematicType)
    {
        // Disable player input
        // Hide castle UI

        // Handle enum types
        switch(CinematicType)
        {
            case Type.HoarderConversation:
                // NOTE (zesty): For special types, always use index 0, the list is used for other types that have
                //  a randomization feature
                Conv = GameData.Cinematics[CinematicType][0];
                break;
            case Type.RandomExclamation:
                Conv = GameData.Cinematics[CinematicType][Random.Range(0, GameData.Cinematics[CinematicType].Count)];
                break;
        }

        // TESTING
        //Conv = GameData.Cinematics[Type.RandomExclamation][3];

        LetterDelay = Conv.LetterDelay;
        TimeToNextLetter = LetterDelay;

        SentenceIndex = 0;
        LetterIndex = 0;
        CurSentence = Conv.Sentences[SentenceIndex];

        CurTextBox = GetTextBox(CurSentence.OwningTextBox);
        SetTextBoxVisible(CurTextBox, true);
        bSentenceComplete = false;

        if(Conv.PauseGame)
            App.inst.SpawnController.PauseEnemiesForCinematic();
    }
开发者ID:clickerdefenseggj,项目名称:clicker-defense,代码行数:35,代码来源:CinematicSet.cs

示例3: testConversation

	// Testing Conversation class
	void testConversation () {

		Conversation conversation = new Conversation("Text/SampleDialogue");

		Debug.Log(conversation.GetCurrentDialogue());
	
	}
开发者ID:imann24,项目名称:cs327-bestmobilegameever,代码行数:8,代码来源:IsaiahTestingGround.cs

示例4: Start

    // Use this for initialization
    void Start()
    {
        mConver = transform.FindChild("Anchor_T/Conver");
        if (mConver == null) return;

        mUIConver = mConver.GetComponent<Conversation>();
    }
开发者ID:yabos,项目名称:BattleHit,代码行数:8,代码来源:FieldUI_Control.cs

示例5: RunConversationCoroutine

    private IEnumerator RunConversationCoroutine(Conversation conversation)
    {
        IsInProgress = true;

        Coroutine alignCoroutine = conversation.alignCharacters ? StartCoroutine(AlignCharactersCoroutine()) : null;

        if (conversation.controlCamera)
            camera.target = conversationTarget;
        
        foreach(DialogCard card in conversation.Cards())
        {
            dialog.SetDialogQueue(card);
            dialog.DisplayNextCard();
            while (dialog.IsDisplaying())
                yield return null;

            yield return null;
        }

        if (alignCoroutine != null)
            StopCoroutine(alignCoroutine);
        camera.target = teaganFollowTarget;

        IsInProgress = false;
    }
开发者ID:GlowLimeGames,项目名称:the-experiment,代码行数:25,代码来源:ConversationManager.cs

示例6: Post

        public IHttpActionResult Post(ConversationRequestModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return this.BadRequest(this.ModelState);
            }

            var topic = this.data.Conversations.Select(x => x.Topic).FirstOrDefault();
            var text = this.data.Conversations.Select(x => x.Text).FirstOrDefault();
            var startedOn = this.data.Conversations.Select(x => x.StartedOn).FirstOrDefault();
            var currentUserName = this.User.Identity.Name;
            var currentUser = this.data.Users.Where(u => u.UserName == currentUserName).FirstOrDefault();

            var conversationToAdd = new Conversation
            {
                Topic = model.Topic,
                Text = model.Text,
                StartedOn = model.StartedOn,
                Author = currentUser
            };

            this.data.Conversations.Add(conversationToAdd);
            this.data.SaveChanges();

            PubNubNotificationProvider.Notify(conversationToAdd.Topic);

            return this.Ok(conversationToAdd.Id);
        }
开发者ID:Team-Iris,项目名称:JustMeet,代码行数:28,代码来源:ConversationsController.cs

示例7: WhisperWindow

        public WhisperWindow(Conversation conversation, Participant participant, SeriousBusinessCat seriousBusiness, string info)
        {
            this.conversation = conversation;
            this.participant = participant;
            this.seriousBusiness = seriousBusiness;

            InitializeComponent();

            this.DataContext = this;

            InitCommands();

            this.Activated += (s,e) => { FlashWindow.Stop(this); };

            lbWhispers.ItemsSource = _whispers;

            string bob = "neighbor cat";

            if (participant != null)
            {
                bob = participant.Contact.GetContactInformation(ContactInformationType.DisplayName).ToString();
            }

            textBlock.Text = bob;

            if (!string.IsNullOrEmpty(info))
            {
                textBlock.ToolTip = info;
            }

            this.Title = $"Whispering with {bob}";

            FocusManager.SetFocusedElement(this, tbMessage);
        }
开发者ID:adzm,项目名称:BusinessCats,代码行数:34,代码来源:WhisperWindow.xaml.cs

示例8: CreateConference

 private async Task CreateConference()
 {
     _confConversation = new Conversation(_endpoint);
     var options = new ConferenceJoinOptions() { JoinMode = JoinMode.TrustedParticipant, AdHocConferenceAccessLevel = ConferenceAccessLevel.Everyone, AdHocConferenceAutomaticLeaderAssignment = AutomaticLeaderAssignment.Everyone };
     await _confConversation.ConferenceSession.JoinAsync(options);
     Console.WriteLine("New conference created");
 }
开发者ID:juancarlosbaezpozos,项目名称:UCMA-IVR-Demo,代码行数:7,代码来源:LyncServer.cs

示例9: Write_TwoMessagesOnDifferentDays_TwoDaysGenerated

        public void Write_TwoMessagesOnDifferentDays_TwoDaysGenerated()
        {
            var writer = new MoqWriter();
            var message1 = Factory.Create<Message>();
            var message2 = Factory.Create<Message>();
            message1.Date = message2.Date.AddDays( 1 );

            var conversation = new Conversation
            {
                ContactName = Factory.Create<string>(),
                PhoneNumber = Factory.Create<string>(),
                Messages = new List<Message> { message1, message2 }
            };

            ConversationFile file = new ConversationFile( conversation, Factory.Create<string>() );
            file.Write( writer );

            string expectedResult = string.Concat(
                    Common.GetExpectedHead( conversation.ContactName ),
                    GetExpectedPageHeader( conversation ),
                    "<div class='day'>",
                    GetExpectedDayTitle( message1.Date ),
                    GetExpectedMessageBody( message1 ),
                    "</div><div class='day'>",
                    GetExpectedDayTitle( message2.Date ),
                    GetExpectedMessageBody( message2 ),
                    "</div></body></html>" );

            Assert.AreEqual( expectedResult, writer.Data );
        }
开发者ID:Gupocca,项目名称:sms-reimaginer,代码行数:30,代码来源:ConversationFileTests.cs

示例10: Hyperlink_Click

        private void Hyperlink_Click(object sender, RoutedEventArgs e)
        {
            BusinessLayer.ConversationManager cm = new BusinessLayer.ConversationManager();

            EntityLayer.Conversation c;

            if(AddNum.Text.Length > 0)
            {
                c = cm.getConversationsFromContact(AddNum.Text);
                if (c == null)
                {
                    cm.AddConversation(new EntityLayer.Contact(AddNum.Text));
                    IList<EntityLayer.Conversation> convs = cm.getConversations();
                    ViewModel.Conversation.ConversationsModelView cmv = new ViewModel.Conversation.ConversationsModelView(convs);
                    parent.ListConversations.DataContext = cmv;

                }

                if (!parent.findConvos(AddNum.Text))
                {
                    Conversation cw = new Conversation(parent, AddNum.Text);
                    parent.addConv(cw);
                    cw.Show();
                }

                this.Close();
            }
        }
开发者ID:Ace-Nanter,项目名称:SMS_on_PC,代码行数:28,代码来源:Numéro.xaml.cs

示例11: EstablishCall

        private void EstablishCall()
        {
            // Create a new Conversation.
            Conversation conversation = new Conversation(_appEndpoint);

            // Create a new IM call.
            _imCall = new InstantMessagingCall(conversation);

            try
            {
                // Establish the IM call.
                _imCall.BeginEstablish(_destinationSipUri,
                    new CallEstablishOptions(),
                    result =>
                    {
                        try
                        {
                            // Finish the asynchronous operation.
                            _imCall.EndEstablish(result);
                        }
                        catch (RealTimeException ex)
                        {
                            // Catch and log exceptions.
                            _logger.Log("Failed establishing IM call", ex);
                        }
                    },
                    null
                );
            }
            catch (InvalidOperationException ioex)
            {
                _logger.Log("Failed establishing IM call", ioex);
            }
        }
开发者ID:hhqqnu,项目名称:MSLyncProjects,代码行数:34,代码来源:OutboundInstantMessagingCallSample.cs

示例12: StartConversation

    /// <summary>
    /// Starts the conversation with another game object.
    /// </summary>
    /// <param name="obj">Object.</param>
    public void StartConversation(GameObject obj, string reply = null)
    {
        // cannot start another conversation if we have an active one
        if (activeConversation != null) {
            return;
        }
        ConversationSet conversationSet = obj.GetComponent<ConversationSet>();
        if (conversationSet != null) {
            activeConversation = conversationSet.GetActiveConversation();
            if (reply != null && reply != "") {
                activeConversation.headerText = reply;
            }

            // disable rigidbody while in conversation
            if (_state != null) {
                _state.state = State.DISABLED;
            }

            obj.SendMessage(eventName, SendMessageOptions.DontRequireReceiver);

            if (uiPrefab != null) {
                // TODO: finish this
                _uiShown = Instantiate(uiPrefab) as GameObject;
                _buttons = _uiShown.GetComponentsInChildren<Button>();
                for (int i = 0; i < _buttons.Length; ++i) {
                    //				Button.ButtonClickedEvent ev = new Button.ButtonClickedEvent();
                    //				ev.AddListener(
                    //				_buttons[i].onClick += OnResponseClick;
                }
                Button button;
            }
        }
    }
开发者ID:kdoba,项目名称:Undoculife,代码行数:37,代码来源:ConversationStarter.cs

示例13: InterpretComparison

    private static BooleanOperand InterpretComparison(string code, string defaultNPCName, Conversation conversation)
    {
        string comparisonOperator;
        int operatorIndex;

        if (code.Contains(">=")){
            comparisonOperator = ">=";
        } else if (code.Contains("<=")){
            comparisonOperator = "<=";
        } else if (code.Contains("!=")){
            comparisonOperator = "!=";
        } else if (code.Contains("=")){
            comparisonOperator = "=";
        } else if (code.Contains(">")){
            comparisonOperator = ">";
        } else if (code.Contains("<")){
            comparisonOperator = "<";
        } else {
            comparisonOperator = null;
        }
        if (comparisonOperator == null){
            throw new InvalidScriptException("No comparison operator: " + code);
        } else {
            operatorIndex = code.IndexOf(comparisonOperator);
            string firstPart = code.Substring(0, operatorIndex);
            string lastPart = code.Substring(operatorIndex + comparisonOperator.Length);
            if (code.Contains("$")){
                return InterpretStringComparison(firstPart, lastPart, comparisonOperator, operatorIndex, defaultNPCName, conversation);
            } else {
                return InterpretNumericComparison(firstPart, lastPart, comparisonOperator, operatorIndex, defaultNPCName, conversation);
            }
        }
    }
开发者ID:kiichi7,项目名称:Lies_and_Seductions,代码行数:33,代码来源:PrerequisiteInterpreter.cs

示例14: GetSituation

 public GetSituation(Conversation conversation)
 {
     if (conversation == null){
         Debug.LogError("GetSituation.GetSituation(): NULL CONVERSATION!");
     }
     this.conversation = conversation;
 }
开发者ID:kiichi7,项目名称:Lies_and_Seductions,代码行数:7,代码来源:GetSituation.cs

示例15: StoreConversation

 private static void StoreConversation(Conversation conversation, string ConversationID)
 {
     ActiveConversations.Add(ConversationID, new ConversationContainer()
     {
         Conversation = conversation,
         ConversationCreated = DateTime.Now
     });
 }
开发者ID:NALSS,项目名称:LyncConversationTracker,代码行数:8,代码来源:Program.cs


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