Source code template / example (c# .net), Customlibfunction.cs – Wavecom W-BitView V2.5.00 User Manual

Page 72

Advertising
background image

66

Custom Library

BitView Manual V2.5.00 WAVECOM W-BV

Source Code Template / Example (C# .NET)

CustomLibFunction.cs


//---------------------------------------------------------------------------
// File : CustomLibFunction.cs
// Author : WAVECOM Elektronik AG
// Date : February 2008
// Description : Template/example for a custom defined library function.
//
// Important note:
// In the project settings the "Assembly Name" must be
// equal to the "Default Namespace".
//
//---------------------------------------------------------------------------

#region using references

using System;
using System.Collections;
using System.Text;
using System.ComponentModel;
using CustomLibFunction.Properties;

#endregion

namespace CustomLib // Mandatory! Do not change this name.
{
/// <summary>
/// </summary>
[Serializable]
[DefaultProperty("FunctionName")] // adjust string if necessary, it points to a property
below
public class CustomLibFunction
{
#region Constant fields

private class PropertyCategory
{
// these are the categories in the BitViewTool property grid (Parameter Window)
public const string Information = "Information";
public const string Counter = "Counter";
public const string Configuration = "Configuration";
public const string Calculation = "Calculation";

// do not change these names, they are used to distinguish the different
categories
// when any change in the parameters happens
}

private const int MAX_SIZE = 500000; // do not modify this value

#endregion

#region Fields

// generate a new BitArray for calculation, it will be returned to the calling
function
private BitArray outbox = new BitArray(MAX_SIZE);

#endregion

#region Mandatory Properties

private string functionName = "CustomLibFunction";
/// <summary>
/// Mandatory! Do not delete this property! The string "CustomLibFunction" may be
modified.
/// This will be the name of the Function in the BitViewTool History explorer and
ToolBox
/// </summary>
[Category(PropertyCategory.Information)]
[Description("Description of CustomLibFunction goes here.\n" +

Advertising
This manual is related to the following products: