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


C# MessageCollection类代码示例

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


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

示例1: CanCreateTransaction

        public void CanCreateTransaction()
        {
            SendPipelineWrapper pipeline =
            PipelineFactory.CreateSendPipeline(typeof(XMLTransmit));

             using ( TransactionControl control = pipeline.EnableTransactions() )
             {
            // Create the input message to pass through the pipeline
            Stream stream = DocLoader.LoadStream("SampleDocument.xml");
            IBaseMessage inputMessage = MessageHelper.CreateFromStream(stream);

            // Add the necessary schemas to the pipeline, so that
            // disassembling works
            pipeline.AddDocSpec(typeof(Schema1_NPP));
            pipeline.AddDocSpec(typeof(Schema2_WPP));

            MessageCollection inputMessages = new MessageCollection();
            inputMessages.Add(inputMessage);

            // Execute the pipeline, and check the output
            IBaseMessage outputMessage = pipeline.Execute(inputMessages);

            Assert.IsNotNull(outputMessage);
            control.SetComplete();
             }
        }
开发者ID:vintem,项目名称:pipelinetesting,代码行数:26,代码来源:SendPipelineTests.cs

示例2: ObterClientesIncompleto

        public MessageCollection<Dominio.Models.Cliente> ObterClientesIncompleto()
        {
            MessageCollection<Dominio.Models.Cliente> msg = new MessageCollection<Dominio.Models.Cliente>();

            try
            {
                var clientes = Integracao.XYZ.XYZClientes.ClientesIncompletos();

                if (clientes.Resultado != TipoResultado.Sucesso)
                    throw clientes.Exception;

                msg.Instances = clientes.Instances.Select(s => new Dominio.Models.Cliente()
                {
                    Id = s.Idk__BackingField,
                    Nome = s.Nomek__BackingField,
                    Endereco = s.Enderecok__BackingField,
                    TelefoneResidencial = s.TelefoneResidencialk__BackingField,
                    TelefoneCelular = s.TelefoneCelulark__BackingField,
                    DataNascimento = s.DataNascimentok__BackingField
                }).ToList();
            }
            catch (Exception ex)
            {
                msg.Exception = ex;
            }

            return msg;
        }
开发者ID:pedromotta,项目名称:Minutrade.XYZ,代码行数:28,代码来源:Cliente.cs

示例3: _ProcessMessages

 void _ProcessMessages (MessageCollection messages, IRule rule, object target)                                                                 
          {                                                                                                                                            
                  if (messages == RuleSuccess)                                                                                                         
                          return;                                                                                                                      
                                                                                                                                                       
                  Violations.Add (rule, target, messages);                                                                                             
          }              
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:GendarmeRunner.cs

示例4: CheckType

		public MessageCollection CheckType(TypeDefinition type, Runner runner)
		{
			MessageCollection messageCollection = new MessageCollection();

			foreach (MethodDefinition method in type.Methods)
			{
				if (!method.IsStatic)
				{
					return null;
				}
			}

			foreach (FieldDefinition field in type.Fields)
			{
				if (!field.IsStatic)
				{
					return null;
				}
			}
			
			foreach (MethodDefinition ctor in type.Constructors)
			{
				if (!ctor.IsStatic && (ctor.Attributes & MethodAttributes.Public) == MethodAttributes.Public)
				{
					Location location = new Location(type.Name, ctor.Name, 0);
					Message message = new Message(MessageString, location, MessageType.Error);
					messageCollection.Add(message);
				}
			}

			return messageCollection.Count > 0 ? messageCollection : null;
			
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:33,代码来源:AvoidConstructorsInStaticTypesRule.cs

示例5: ConcatMessagesAsPart

		internal MimePartCollection ConcatMessagesAsPart(MessageCollection input)
		{
			MimePartCollection output = new MimePartCollection();
			foreach(MimePart part in this) output.Add(part);
			foreach(Message message in input) output.Add(message.ToMimePart());
            return output;			
		}
开发者ID:JBTech,项目名称:MailSystem.NET,代码行数:7,代码来源:MimePartCollection.cs

示例6: AddMessages

		public void AddMessages(MessageCollection messageCollection)
		{
			foreach (var message in messageCollection)
			{
				this.AddMessage(message);
			}
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:ErrorControl.cs

示例7: ChatWindow

        public ChatWindow(Chat parrent, RoomLink link)
        {
            InitializeComponent();

            DataContext = this;  //aby šel bindovat title okna
            Parrent = parrent;
            Link = link;
            RefreshTime = 20;
            refresher = new System.Timers.Timer(RefreshTime * 1000);
            refresher.Elapsed += (object sender, ElapsedEventArgs ea) => {
                Logger.dbgOut("Refresh");

                //tohle tu je, protoze potrebuju kolekci updatovat z jinýho vlákna
                Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate() {
                        List<Message> ms = parrent.getMessages();
                        Messages.Clear();
                        foreach(Message m in ms)
                        {
                            Messages.Add(m);
                        }
                    }
                );
            };

            Messages = new MessageCollection(parrent.getMessages());
            lbChatView.ItemsSource = Messages;

            //zapnutí obnovování zpráv
            refresher.Start();
        }
开发者ID:Cajova-Houba,项目名称:XChatCommunicator,代码行数:30,代码来源:ChatWindow.xaml.cs

示例8: ValidateBinaryParsing

        public void ValidateBinaryParsing()
        {
            string [] code = new [] {
                "      B'1010101111'",
                "      b\"111\"",
                "      B'121'"
            };
            FortranOptions opts = new FortranOptions();
            MessageCollection messages = new MessageCollection(opts);
            Lexer ls = new Lexer(code, opts, messages);

            SimpleToken token = ls.GetToken();
            Assert.IsTrue(token.ID == TokenID.INTEGER);
            IntegerToken intToken = (IntegerToken)token;
            Assert.AreEqual(intToken.Value, 687);

            Assert.IsTrue(ls.GetToken().ID == TokenID.EOL);

            token = ls.GetToken();
            Assert.IsTrue(token.ID == TokenID.INTEGER);
            intToken = (IntegerToken)token;
            Assert.AreEqual(intToken.Value, 7);

            Assert.IsTrue(ls.GetToken().ID == TokenID.EOL);

            ls.GetToken();
            Assert.IsTrue(messages.ErrorCount > 0);
            Assert.IsTrue(messages[0].Line == 3);
            Assert.IsTrue(messages[0].Code == MessageCode.BADNUMBERFORMAT);
        }
开发者ID:stevewpalmer,项目名称:jcom,代码行数:30,代码来源:lexer.cs

示例9: CheckMethod

		public MessageCollection CheckMethod(MethodDefinition method, Runner runner)
		{
			MessageCollection messageCollection = new MessageCollection();

			if (method.Body == null || method.Body.Instructions == null)
			{
				return null;
			}

			foreach (Instruction instruction in method.Body.Instructions)
			{
				if (instruction.OpCode.Code == Code.Pop)
				{
					Message message = CheckForViolation(instruction.Previous);

					if (message != null)
					{
						messageCollection.Add(message);
					}
				}
			}
			

			return messageCollection.Count == 0 ? runner.RuleSuccess : messageCollection;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:25,代码来源:DontIgnoreMethodResultRule.cs

示例10: Main

        static void Main(string[] args)
        {
            FortranOptions opts = new FortranOptions();
            MessageCollection messages = new MessageCollection(opts);

            opts.Messages = messages;
            if (opts.Parse(args)) {
                Compiler comp = new Compiler(opts);
                comp.Messages = messages;

                foreach (string srcfile in opts.SourceFiles) {
                    if (!File.Exists(srcfile)) {
                        messages.Error(MessageCode.SOURCEFILENOTFOUND, String.Format("File '{0}' not found", srcfile));
                        break;
                    }
                    comp.Compile(srcfile);
                }
                if (messages.ErrorCount == 0) {
                    comp.Save();
                    if (opts.Run && messages.ErrorCount == 0) {
                        comp.Execute();
                    }
                }
            }
            foreach (Message msg in messages) {
                if (msg.Level == MessageLevel.Error) {
                    Console.ForegroundColor = ConsoleColor.Red;
                }
                Console.WriteLine(msg);
                Console.ResetColor();
            }
            if (messages.ErrorCount > 0) {
                Console.WriteLine(String.Format("*** {0} errors found. Compilation stopped.", messages.ErrorCount));
            }
        }
开发者ID:stevewpalmer,项目名称:jcom,代码行数:35,代码来源:main.cs

示例11: CheckMessageType

		private void CheckMessageType (MessageCollection messageCollection, MessageType messageType) 
		{
			IEnumerator enumerator = messageCollection.GetEnumerator ();
			if (enumerator.MoveNext ()) {
				Message message = (Message) enumerator.Current;
				Assert.AreEqual (message.Type, messageType);
			}
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:8,代码来源:UsePluralNameInFlagEnumsTest.cs

示例12: Account

        public Account(dynamic oAccount)
        {
            _account = oAccount;

            dynamic oMessages = _account.Messages;

            _messageCollection = new MessageCollection(oMessages);
        }
开发者ID:Knight1988,项目名称:hMailServer-API,代码行数:8,代码来源:Account.cs

示例13: TraceScan

 /// <summary>
 /// This constructor will create an empty class, normally
 /// used when the Node property is assigned
 /// </summary>
 public TraceScan()
 {
     m_id = Guid.NewGuid();
     m_messages = new MessageCollection();
     m_machine = Environment.MachineName;
     m_messages.MachineName = m_machine;
     m_user = Environment.UserName;
     m_mailBox = Environment.UserName;
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:13,代码来源:TraceScan.cs

示例14: AddExistingMessages

		private void AddExistingMessages (MessageCollection existingMessages) {
			if (existingMessages == null)
				return;

			foreach (Message violation in existingMessages) {
				Message message = new Message ("This method contains unused parameters.  This is a sign for the Speculative Generality smell.",violation.Location, MessageType.Error);
				messageCollection.Add (message);
			}
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:9,代码来源:AvoidSpeculativeGeneralityRule.cs

示例15: FixtureSetUp

		public void FixtureSetUp ()
		{
			string unit = Assembly.GetExecutingAssembly ().Location;
			assembly = AssemblyFactory.GetAssembly (unit);
			rule = new UsePluralNameInEnumFlagsRule ();
			messageCollection = null;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:UsePluralNameInFlagEnumsTest.cs


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