本文整理汇总了C#中Conversation.Send方法的典型用法代码示例。如果您正苦于以下问题:C# Conversation.Send方法的具体用法?C# Conversation.Send怎么用?C# Conversation.Send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conversation
的用法示例。
在下文中一共展示了Conversation.Send方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(Conversation<ConversationDto> conversation, string suffix)
{
HandleLbl.Text += " " + conversation.Handle;
SuffixLbl.Text += " " + suffix;
_conversation = conversation;
_subscription = _conversation.SkipErrors().ObserveOn(SynchronizationContext.Current).Subscribe(OnNext);
_conversation.Send(new ConversationDto { MessageType = MessageTypes.Init, Data = suffix });
}
示例2: UpDateSsb
//.........这里部分代码省略.........
ts = TimeSpan.FromSeconds(double.Parse(cnv_txtLifetime.Text));
if (cnv_cboContract.Text != string.Empty)
convContract = cnv_cboContract.Text;
if (cnv_txtRelGrpHndl.Text != string.Empty)
grpHandle = new Guid(cnv_txtRelGrpHndl.Text);
//get a service object
Service smoserv = smo.GetSSBIService(bServ.Parent.Parent, bServ.Name);
if (smoserv.Connection.State == ConnectionState.Closed)
smoserv.Connection.Open();
smoserv.Connection.ChangeDatabase(bServ.Parent.Parent.Name);
updatedobj = smoserv.BeginDialog(toService, convContract, ts, cnv_chkEncryption.Checked, grpHandle);
break;
case SsbEnum.Message:
SSBIConversation msgConv = (SSBIConversation)msg_cboConv.SelectedItem;
string servName = msg_txtFrom.Text;
//we need a service object
Service msgSsbiServ = smo.GetSSBIService(dBase, msgConv.FromService);
if (msgSsbiServ.Connection.State== ConnectionState.Closed)
msgSsbiServ.Connection.Open();
msgSsbiServ.Connection.ChangeDatabase(dBase.Name);
Conversation msgCnv = new Conversation(msgSsbiServ, msgConv.Handle);
string msgType = msg_cboMsgType.SelectedText;
string msgString = msg_rchMsg.Text;
msgType = msg_cboMsgType.Text;
MemoryStream msgBody = new MemoryStream(Encoding.ASCII.GetBytes(msgString));
Microsoft.Samples.SqlServer.Message msg = new Microsoft.Samples.SqlServer.Message(msgType, msgBody);
msgCnv.Send(msg);
break;
case SsbEnum.Login :
string pwd = "";
Login lg = new Login();
lg.Parent = dbServ.SMOServer;
lg.Name = lgn_txtLoginName.Text;
if (lgn_rdSql.Checked) {
pwd = lgn_txtPwd.Text;
lg.PasswordPolicyEnforced = lgn_chkEnforcePolicy.Checked;
lg.LoginType = LoginType.SqlLogin;
lg.Create(pwd);
}
else {
lg.Create();
}
updatedobj = lg;
break;
case SsbEnum.Certificate:
string certOwner = "dbo";
int certSource = cert_cboSource.SelectedIndex;
Certificate cert = new Certificate();
if(!isEdit) {
cert.Name = txtName.Text;
if(cboUser.Text != "")
certOwner = cboUser.Text;
cert.Parent = dBase;
cert.Owner = certOwner;