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


C# MessageType.Alter方法代码示例

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


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

示例1: DeploySsbObj

        internal static void DeploySsbObj(object obj, string svrName, string dbName, SsbEnum ssbType, bool isEdit)
        {
            Server svr = CreateServer(svrName, null, null);
              Database db = svr.Databases[dbName];
              ServiceBroker sb = db.ServiceBroker;
              MessageType mt = null;
              ServiceContract sc = null;
              ServiceQueue q = null;
              BrokerService serv = null;
              ServiceRoute rt = null;
              RemoteServiceBinding bind = null;

              try {
            switch (ssbType) {
              case SsbEnum.MessageType:
            MessageType mtNew = new MessageType();
            mtNew.Parent = sb;
            mt = (MessageType)obj;
            mtNew.Name = mt.Name;
            mtNew.MessageTypeValidation = mt.MessageTypeValidation;
            if (mt.MessageTypeValidation == MessageTypeValidation.XmlSchemaCollection)
              mtNew.ValidationXmlSchemaCollection = mt.ValidationXmlSchemaCollection;

            if (isEdit)
              mtNew.Alter();
            else
              mtNew.Create();

            break;

              case SsbEnum.Contract:
            ServiceContract scNew = new ServiceContract();
            sc = (ServiceContract)obj;
            scNew.Parent = sb;
            scNew.Name = sc.Name;
            foreach (MessageTypeMapping mtm in sc.MessageTypeMappings) {
              if (!sb.MessageTypes.Contains(mtm.Name)) {
                ServiceBroker sbParent = sc.Parent;
                MessageType mtp = sbParent.MessageTypes[mtm.Name];
                DeploySsbObj(mtp, svrName, dbName, SsbEnum.MessageType, false);
              }

              MessageTypeMapping mtmNew = new MessageTypeMapping();
              mtmNew.Name = mtm.Name;
              mtmNew.Parent = scNew;
              mtmNew.MessageSource = mtm.MessageSource;
              scNew.MessageTypeMappings.Add(mtmNew);

            }

            if (isEdit)
              scNew.Alter();
            else
              scNew.Create();

            break;

              case SsbEnum.Queu:
            q = (ServiceQueue)obj;
            q.Parent = sb;

            if (isEdit)
              q.Alter();
            else
              q.Create();

            break;

              case SsbEnum.Service:
            serv = (BrokerService)obj;
            serv.Parent = sb;

            if (isEdit)
              serv.Alter();
            else
              serv.Create();

            break;

              case SsbEnum.Route:
            rt = (ServiceRoute)obj;
            rt.Parent = sb;

            if (isEdit)
              rt.Alter();
            else
              rt.Create();

            break;

              case SsbEnum.RemoteBinding:
            bind = (RemoteServiceBinding)obj;
            bind.Parent = sb;

            if (isEdit)
              bind.Alter();
            else
              bind.Create();

            break;
//.........这里部分代码省略.........
开发者ID:nberglund,项目名称:ssbadmin,代码行数:101,代码来源:smo.cs


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