From db2ca04e7a888289ac0f59537dcb6833cb7341da Mon Sep 17 00:00:00 2001 From: Arnaud Simon Date: Wed, 12 Nov 2008 14:25:03 +0000 Subject: Qpid-1146: Added doc + samples git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@713378 13f79535-47bb-0310-9956-ffa450edef68 --- .../ExcelAddInMessageProcessor.csproj | 57 ++++++++++++++++++++++ .../addins/ExcelAddInMessageProcessor/Processor.cs | 44 +++++++++++++++++ .../Properties/AssemblyInfo.cs | 35 +++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj create mode 100644 dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs create mode 100644 dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs (limited to 'dotnet/client-010/addins/ExcelAddInMessageProcessor') diff --git a/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj b/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj new file mode 100644 index 0000000000..c9f8ac71ef --- /dev/null +++ b/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj @@ -0,0 +1,57 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {C2AE83A3-D5D1-469D-8611-A4738B9997CF} + Library + Properties + ExcelAddInMessageProcessor + ExcelAddInMessageProcessor + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + {B911FFD7-754F-4735-A188-218D5065BE79} + Client + + + {85EFD719-39F6-4471-90FF-9E621430344B} + ExcelAddIn + + + + + \ No newline at end of file diff --git a/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs b/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs new file mode 100644 index 0000000000..0b2d27519f --- /dev/null +++ b/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs @@ -0,0 +1,44 @@ +/* +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +* +*/ + +using System.IO; +using System.Text; +using org.apache.qpid.client; + +namespace ExcelAddInMessageProcessor +{ + class Processor : ExcelAddIn.MessageProcessor + { + public string ProcessMessage(IMessage m) + { + BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8); + byte[] body = new byte[m.Body.Length - m.Body.Position]; + reader.Read(body, 0, body.Length); + ASCIIEncoding enc = new ASCIIEncoding(); + string res = enc.GetString(body); + if (m.ApplicationHeaders.ContainsKey("price")) + { + res = res + ": price: " + m.ApplicationHeaders["price"]; + } + return res; + } + } +} \ No newline at end of file diff --git a/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs b/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..1279348645 --- /dev/null +++ b/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ExcelAddInMessageProcessor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Apache Software Foundation")] +[assembly: AssemblyProduct("ExcelAddInMessageProcessor")] +[assembly: AssemblyCopyright("Copyright Apache Software Foundation 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d20b2d75-7b8b-4f7d-8a81-40a4cce94195")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] -- cgit v1.2.1