Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Observer Design Pattern (Delegates/Events)

, 9 Aug 2009 CPOL
This article uses Delegates/Events to implement an Observer Design Pattern.
ObserverDP_src.zip
www.askbargains.com
www.askbargains.com.ObserverDesignPartternClient
bin
Debug
www.askbargains.com.ObserverDesignPartternClient.exe
www.askbargains.com.ObserverDesignPartternClient.pdb
www.askbargains.com.ObserverDesignPartternClient.vshost.exe
www.askbargains.com.ObserverDesignPartternClient.vshost.exe.manifest
www.askbargains.com.ObserverDesignPartternLib.dll
www.askbargains.com.ObserverDesignPartternLib.pdb
obj
Debug
ResolveAssemblyReference.cache
TempPE
www.askbargains.com.ObserverDesignPartternClient.exe
www.askbargains.com.ObserverDesignPartternClient.pdb
Properties
www.askbargains.com.ObserverDesignPartternLib
bin
Debug
www.askbargains.com.ObserverDesignPartternLib.dll
www.askbargains.com.ObserverDesignPartternLib.pdb
obj
Debug
TempPE
www.askbargains.com.ObserverDesignPartternLib.dll
www.askbargains.com.ObserverDesignPartternLib.pdb
ObserverClassDiagram.cd
Properties
www.askbargains.com.suo
Observer_src.zip
www.askbargains.com.ObserverDesignPartternClient.exe
www.askbargains.com.ObserverDesignPartternClient.vshost.exe
www.askbargains.com.ObserverDesignPartternClient.vshost.exe.manifest
www.askbargains.com.ObserverDesignPartternLib.dll
www.askbargains.com.ObserverDesignPartternLib.dll
www.askbargains.com.ObserverDesignPartternLib.pdb
Refactor
www.askbargains.com.ObserverDesignPartternLib.dll
www.askbargains.com.ObserverDesignPartternLib.dll
www.askbargains.com.ObserverDesignPartternLib.pdb
ObserverClassDiagram.cd
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{71D6FFAD-9C83-4D3A-8BBA-803B397CAA12}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>www.askbargains.com.ObserverDesignPartternClient</RootNamespace>
    <AssemblyName>www.askbargains.com.ObserverDesignPartternClient</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\www.askbargains.com.ObserverDesignPartternLib\www.askbargains.com.ObserverDesignPartternLib.csproj">
      <Project>{119D9957-A6FF-4D4C-8937-68D09F34B6C5}</Project>
      <Name>www.askbargains.com.ObserverDesignPartternLib</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Allen _ Wang
Architect
United States United States
Sr Software Architect.Microsoft Certified Solutions Developer (MCSD).

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 9 Aug 2009
Article Copyright 2009 by Allen _ Wang
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid