Commerce Server General - C# Pipeline Component

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > May 2005 > C# Pipeline Component





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author C# Pipeline Component
Geoff

2005-05-17, 5:50 pm

I am just starting at Commerce Server 2002 and I need to write a pipeline
component.
(I am a good C# developer, but I am not a COM developer or VB Developer).

I am trying to flesh out the C# example template from MSDN but since I am
new I don't know what to do.
For example, I made this pipeline component, compiled it, used PipeReg
successfully, and added my component with the pipeline editor.
When I double click on my component in the pipleline editor and click on the
tab "Values Read and Written" I don't get anything.

I suppose it is because I don't know what a SAFEARRAY is or how to create
one in C# or how to return it.

Any Ideas?

BTW: I called my pipeline component OldTobey because I figured a Hobbit
would put it in his "pipe" and smoke it. Pipe -> PipeLine.

using System;

using System.Text;

using System.Collections;

using System.Runtime.InteropServices;

using Microsoft.CommerceServer.Runtime;

using Microsoft.CommerceServer.Interop;

using Microsoft.CommerceServer.Interop.Orders;





namespace PipeLineTestOne

{

[GuidAttribute("CA747D26-6F93-4589-8301-B1DDDBC67D2D")]

/// <summary>

/// Summary description for Class1.

/// </summary>

public class OldTobey : IPipelineComponentAdmin,

IPipelineComponent,

IPipelineComponentDescription,

IPersistDictionary

{

public OldTobey()

{

//

// TODO: Add constructor logic here

//

}

#region IPipelineComponentAdmin Members

/// <summary>

/// Get some date from the local variables and set it in a dictionary

/// </summary>

/// <returns></returns>

public object GetConfigData()

{

// IDictionary dict = new DictionaryClass();

//

// dict["File_Location"] = "Some Data";

// dict["To"]= "Some Data";

// dict["From"]= "Some Data";

// dict["Subject"]= "Some Data";

// dict["SMTP_Server"]= "Some Data";

//

// return dict;

return null;

}

/// <summary>

/// Take the values from the dictionary and place them in the local vars

/// or wherever you like.

/// </summary>

/// <param name="pDict"></param>

public void SetConfigData(object pDict)

{

Microsoft.CommerceServer.Runtime.IDictionary dict =
(Microsoft.CommerceServer.Runtime.IDictionary)pDict;

}

#endregion

#region IPipelineComponent Members

public int Execute(object pdispOrder, object pdispContext, int lFlags)

{

Microsoft.CommerceServer.Runtime.IDictionary orderDict =
(Microsoft.CommerceServer.Runtime.IDictionary)pdispOrder;

Microsoft.CommerceServer.Runtime.IDictionary contextDict =
(Microsoft.CommerceServer.Runtime.IDictionary)pdispContext;

return 0;

}

public void EnableDesign(int fEnable)

{

// TODO: Add OldTobey.EnableDesign implementation

}

#endregion

#region IPipelineComponentDescription Members

public object ContextValuesRead()

{

ArrayList al = new ArrayList();

al.Add("One");

al.Add("Two");

al.Add("Three");

return al.ToArray(typeof(string));

}

public object ValuesWritten()

{

ArrayList al = new ArrayList();

al.Add("One");

al.Add("Two");

al.Add("Three");

return al.ToArray(typeof(string));

}

public object ValuesRead()

{

ArrayList al = new ArrayList();

al.Add("One");

al.Add("Two");

al.Add("Three");

return al.ToArray(typeof(string));

}

#endregion

#region IPersistDictionary Members

public void InitNew()

{

// TODO: Add OldTobey.InitNew implementation

}

public string GetProgID()

{

// TODO: Add OldTobey.GetProgID implementation

return null;

}

public void Load(object pdispDict)

{

// TODO: Add OldTobey.Load implementation

}

public int IsDirty()

{

// TODO: Add OldTobey.IsDirty implementation

return 0;

}

public void Save(object pdispDict, int fSameAsLoad)

{

// TODO: Add OldTobey.Save implementation

}

#endregion

}

}



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com