本文整理汇总了C#中Certificate.Alter方法的典型用法代码示例。如果您正苦于以下问题:C# Certificate.Alter方法的具体用法?C# Certificate.Alter怎么用?C# Certificate.Alter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Certificate
的用法示例。
在下文中一共展示了Certificate.Alter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpDateSsb
int UpDateSsb()
{
updatedobj = null;
//if (!isDirty)
//return 0;
if (!ValidateData()) {
Cursor crs = Cursor.Current;
Cursor.Current = Cursors.WaitCursor;
try {
Database db = null;
ServiceBroker sb = null;
if (ssbType != SsbEnum.Database && ssbType != SsbEnum.Login && ssbType != SsbEnum.EndPoint) {
sb = dBase.ServiceBroker;
}
switch (ssbType) {
case SsbEnum.Database:
MasterKey mk = null;
SSBIDatabase sbd = null;
if (isEdit) {
sbd = (SSBIDatabase)objToUpdate;
db = sbd.DataBase;
}
else {
db = new Database();
db.Name = txtName.Text;
db.Parent = dbServ.SMOServer;
}
if (isEdit) {
if(db.MasterKey != null && db_chkMasterKey.Checked == false) {
mk = db.MasterKey;
mk.Drop();
}
else if (db.MasterKey == null && db_chkMasterKey.Checked) {
mk = new MasterKey();
mk.Parent = db;
mk.Create(db_txtMkPwd.Text);
}
db.Alter();
if (sbd.IsTrustworthy != db_chkTrustWorthy.Checked)
sbd.IsTrustworthy = db_chkTrustWorthy.Checked;
}
else {
db.Create();
sbd = new SSBIDatabase(db);
if (db_chkMasterKey.Checked) {
mk = new MasterKey();
mk.Parent = db;
mk.Create(db_txtMkPwd.Text);
}
if (db_chkTrustWorthy.Checked) {
sbd.IsTrustworthy = true;
}
}
if (dBase == null)
dBase = db;
//Server serv = db.Parent;
updatedobj = db;
break;
case SsbEnum.MessageType:
MessageType mt = null;
if (isEdit)
mt = (MessageType)objToUpdate;
else {
mt = new MessageType();
mt.Parent = sb;
mt.Name = txtName.Text;
}
if (cboUser.Text != string.Empty)
mt.Owner = cboUser.Text;
mt.MessageTypeValidation = (MessageTypeValidation)Enum.Parse(typeof(MessageTypeValidation), cboVal.Text);
if (cboValSchema.Enabled)
mt.ValidationXmlSchemaCollection = cboValSchema.Text;
if (isEdit)
mt.Alter();
else
mt.Create();
updatedobj = mt;
break;
case SsbEnum.Contract:
ServiceContract sc = new ServiceContract();
sc.Parent = sb;
sc.Name = txtName.Text;
if (cboUser.Text != string.Empty)
sc.Owner = cboUser.Text;
//get the message types
foreach (DataGridViewRow row in dvMsgTypes.Rows) {
//.........这里部分代码省略.........