Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/10/09 16:50:26 (15 years ago)
Author:
swagner
Message:

Implemented generic EventArgs (#796)

Location:
trunk/sources/HeuristicLab.Logging
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Logging/3.2/HeuristicLab.Logging-3.2.csproj

    r2328 r2474  
    1717    <UpgradeBackupLocation>
    1818    </UpgradeBackupLocation>
     19    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1920  </PropertyGroup>
    2021  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    7374  <ItemGroup>
    7475    <Reference Include="System" />
     76    <Reference Include="System.Core">
     77      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     78    </Reference>
    7579    <Reference Include="System.Data" />
    7680    <Reference Include="System.Drawing" />
     
    122126      <Name>HeuristicLab.Charting-3.2</Name>
    123127    </ProjectReference>
     128    <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj">
     129      <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project>
     130      <Name>HeuristicLab.Common-3.2</Name>
     131    </ProjectReference>
    124132    <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
    125133      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
  • trunk/sources/HeuristicLab.Logging/3.2/HeuristicLabLoggingPlugin.cs

    r1927 r2474  
    3333  [Dependency(Dependency = "HeuristicLab.Charting-3.2")]
    3434  [Dependency(Dependency = "HeuristicLab.Charting.Data-3.2")]
     35  [Dependency(Dependency = "HeuristicLab.Common-3.2")]
    3536  [Dependency(Dependency = "HeuristicLab.Core-3.2")]
    3637  [Dependency(Dependency = "HeuristicLab.Data-3.2")]
  • trunk/sources/HeuristicLab.Logging/3.2/LinechartView.cs

    r1530 r2474  
    2727using System.Text;
    2828using System.Windows.Forms;
     29using HeuristicLab.Common;
    2930using HeuristicLab.Core;
    3031using HeuristicLab.Data;
     
    8586    protected override void RemoveItemEvents() {
    8687      if(Linechart != null) {
    87         Linechart.Values.ItemAdded -= new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    88         Linechart.Values.ItemRemoved -= new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     88        Linechart.Values.ItemAdded -= new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     89        Linechart.Values.ItemRemoved -= new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    8990      }
    9091      base.RemoveItemEvents();
     
    9798      base.AddItemEvents();
    9899      if(Linechart != null) {
    99         Linechart.Values.ItemAdded += new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    100         Linechart.Values.ItemRemoved += new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     100        Linechart.Values.ItemAdded += new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     101        Linechart.Values.ItemRemoved += new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    101102      }
    102103    }
     
    144145
    145146    #region Values Events
    146     private delegate void ItemIndexDelegate(object sender, ItemIndexEventArgs e);
    147     private void Values_ItemRemoved(object sender, ItemIndexEventArgs e) {
     147    private delegate void ItemIndexDelegate(object sender, EventArgs<IItem, int> e);
     148    private void Values_ItemRemoved(object sender, EventArgs<IItem, int> e) {
    148149      if(InvokeRequired) {
    149150        Invoke(new ItemIndexDelegate(Values_ItemRemoved), sender, e);
     
    152153      }
    153154    }
    154     private void Values_ItemAdded(object sender, ItemIndexEventArgs e) {
     155    private void Values_ItemAdded(object sender, EventArgs<IItem, int> e) {
    155156      if(InvokeRequired) {
    156157        Invoke(new ItemIndexDelegate(Values_ItemAdded), sender, e);
    157158      } else {
    158159        Datachart datachart = dataChartControl.Chart;
    159         ItemList list = (ItemList)e.Item;
     160        ItemList list = (ItemList)e.Value;
    160161        datachart.UpdateEnabled = false;
    161162        for (int i = 0; i < list.Count; i++) {
     
    163164          if (list[i] is IntData) value = (double)((IntData)list[i]).Data;
    164165          else value = ((DoubleData)list[i]).Data;
    165           datachart.AddDataPoint(i, e.Index, value);
     166          datachart.AddDataPoint(i, e.Value2, value);
    166167          if (value < minY) minY = value;
    167168          if (value > maxY) maxY = value;
  • trunk/sources/HeuristicLab.Logging/3.2/LogView.cs

    r1530 r2474  
    2727using System.Text;
    2828using System.Windows.Forms;
     29using HeuristicLab.Common;
    2930using HeuristicLab.Core;
    3031using HeuristicLab.Data;
     
    6768    protected override void RemoveItemEvents() {
    6869      if (Log != null) {
    69         Log.Items.ItemAdded -= new EventHandler<ItemIndexEventArgs>(Items_ItemAdded);
    70         Log.Items.ItemRemoved -= new EventHandler<ItemIndexEventArgs>(Items_ItemRemoved);
     70        Log.Items.ItemAdded -= new EventHandler<EventArgs<IItem, int>>(Items_ItemAdded);
     71        Log.Items.ItemRemoved -= new EventHandler<EventArgs<IItem, int>>(Items_ItemRemoved);
    7172      }
    7273      base.RemoveItemEvents();
     
    7980      base.AddItemEvents();
    8081      if (Log != null) {
    81         Log.Items.ItemAdded += new EventHandler<ItemIndexEventArgs>(Items_ItemAdded);
    82         Log.Items.ItemRemoved += new EventHandler<ItemIndexEventArgs>(Items_ItemRemoved);
     82        Log.Items.ItemAdded += new EventHandler<EventArgs<IItem, int>>(Items_ItemAdded);
     83        Log.Items.ItemRemoved += new EventHandler<EventArgs<IItem, int>>(Items_ItemRemoved);
    8384      }
    8485    }
     
    106107    #region ItemList Events
    107108    private delegate void IndexDelegate(int index);
    108     private void Items_ItemRemoved(object sender, ItemIndexEventArgs e) {
    109       RemoveItem(e.Index);
     109    private void Items_ItemRemoved(object sender, EventArgs<IItem, int> e) {
     110      RemoveItem(e.Value2);
    110111    }
    111112    private void RemoveItem(int index) {
     
    119120      }
    120121    }
    121     private void Items_ItemAdded(object sender, ItemIndexEventArgs e) {
    122       AddItem(e.Index);
     122    private void Items_ItemAdded(object sender, EventArgs<IItem, int> e) {
     123      AddItem(e.Value2);
    123124    }
    124125    private void AddItem(int index) {
  • trunk/sources/HeuristicLab.Logging/3.2/PointXYChartView.cs

    r1530 r2474  
    2727using System.Text;
    2828using System.Windows.Forms;
     29using HeuristicLab.Common;
    2930using HeuristicLab.Core;
    3031using HeuristicLab.Data;
     
    8586    protected override void RemoveItemEvents() {
    8687      if (PointXYChart != null) {
    87         PointXYChart.Values.ItemAdded -= new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    88         PointXYChart.Values.ItemRemoved -= new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     88        PointXYChart.Values.ItemAdded -= new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     89        PointXYChart.Values.ItemRemoved -= new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    8990      }
    9091      base.RemoveItemEvents();
     
    9798      base.AddItemEvents();
    9899      if (PointXYChart != null) {
    99         PointXYChart.Values.ItemAdded += new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    100         PointXYChart.Values.ItemRemoved += new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     100        PointXYChart.Values.ItemAdded += new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     101        PointXYChart.Values.ItemRemoved += new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    101102      }
    102103    }
     
    149150
    150151    #region Values Events
    151     private delegate void ItemIndexDelegate(object sender, ItemIndexEventArgs e);
    152     private void Values_ItemRemoved(object sender, ItemIndexEventArgs e) {
     152    private delegate void ItemIndexDelegate(object sender, EventArgs<IItem, int> e);
     153    private void Values_ItemRemoved(object sender, EventArgs<IItem, int> e) {
    153154      if (InvokeRequired) {
    154155        Invoke(new ItemIndexDelegate(Values_ItemRemoved), sender, e);
     
    157158      }
    158159    }
    159     private void Values_ItemAdded(object sender, ItemIndexEventArgs e) {
     160    private void Values_ItemAdded(object sender, EventArgs<IItem, int> e) {
    160161      if (InvokeRequired) {
    161162        Invoke(new ItemIndexDelegate(Values_ItemAdded), sender, e);
  • trunk/sources/HeuristicLab.Logging/3.3/HeuristicLab.Logging-3.3.csproj

    r1872 r2474  
    127127      <Name>HeuristicLab.Charting-3.2</Name>
    128128    </ProjectReference>
     129    <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj">
     130      <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project>
     131      <Name>HeuristicLab.Common-3.2</Name>
     132    </ProjectReference>
    129133    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    130134      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
  • trunk/sources/HeuristicLab.Logging/3.3/HeuristicLabLoggingPlugin.cs

    r1872 r2474  
    3131  [ClassInfo(Name = "HeuristicLab.Logging-3.3")]
    3232  [PluginFile(Filename = "HeuristicLab.Logging-3.3.dll", Filetype = PluginFileType.Assembly)]
     33  [Dependency(Dependency = "HeuristicLab.Common-3.2")]
    3334  [Dependency(Dependency = "HeuristicLab.Core-3.3")]
    3435  [Dependency(Dependency = "HeuristicLab.Data-3.3")]
  • trunk/sources/HeuristicLab.Logging/3.3/LinechartView.cs

    r1530 r2474  
    3131using HeuristicLab.Charting;
    3232using HeuristicLab.Charting.Data;
     33using HeuristicLab.Common;
    3334
    3435namespace HeuristicLab.Logging {
     
    8586    protected override void RemoveItemEvents() {
    8687      if(Linechart != null) {
    87         Linechart.Values.ItemAdded -= new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    88         Linechart.Values.ItemRemoved -= new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     88        Linechart.Values.ItemAdded -= new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     89        Linechart.Values.ItemRemoved -= new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    8990      }
    9091      base.RemoveItemEvents();
     
    9798      base.AddItemEvents();
    9899      if(Linechart != null) {
    99         Linechart.Values.ItemAdded += new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    100         Linechart.Values.ItemRemoved += new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     100        Linechart.Values.ItemAdded += new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     101        Linechart.Values.ItemRemoved += new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    101102      }
    102103    }
     
    144145
    145146    #region Values Events
    146     private delegate void ItemIndexDelegate(object sender, ItemIndexEventArgs e);
    147     private void Values_ItemRemoved(object sender, ItemIndexEventArgs e) {
     147    private delegate void ItemIndexDelegate(object sender, EventArgs<IItem, int> e);
     148    private void Values_ItemRemoved(object sender, EventArgs<IItem, int> e) {
    148149      if(InvokeRequired) {
    149150        Invoke(new ItemIndexDelegate(Values_ItemRemoved), sender, e);
     
    152153      }
    153154    }
    154     private void Values_ItemAdded(object sender, ItemIndexEventArgs e) {
     155    private void Values_ItemAdded(object sender, EventArgs<IItem, int> e) {
    155156      if(InvokeRequired) {
    156157        Invoke(new ItemIndexDelegate(Values_ItemAdded), sender, e);
    157158      } else {
    158159        Datachart datachart = dataChartControl.Chart;
    159         ItemList list = (ItemList)e.Item;
     160        ItemList list = (ItemList)e.Value;
    160161        datachart.UpdateEnabled = false;
    161162        for (int i = 0; i < list.Count; i++) {
     
    163164          if (list[i] is IntData) value = (double)((IntData)list[i]).Data;
    164165          else value = ((DoubleData)list[i]).Data;
    165           datachart.AddDataPoint(i, e.Index, value);
     166          datachart.AddDataPoint(i, e.Value2, value);
    166167          if (value < minY) minY = value;
    167168          if (value > maxY) maxY = value;
  • trunk/sources/HeuristicLab.Logging/3.3/LogView.cs

    r1530 r2474  
    2929using HeuristicLab.Core;
    3030using HeuristicLab.Data;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Logging {
     
    6768    protected override void RemoveItemEvents() {
    6869      if (Log != null) {
    69         Log.Items.ItemAdded -= new EventHandler<ItemIndexEventArgs>(Items_ItemAdded);
    70         Log.Items.ItemRemoved -= new EventHandler<ItemIndexEventArgs>(Items_ItemRemoved);
     70        Log.Items.ItemAdded -= new EventHandler<EventArgs<IItem, int>>(Items_ItemAdded);
     71        Log.Items.ItemRemoved -= new EventHandler<EventArgs<IItem, int>>(Items_ItemRemoved);
    7172      }
    7273      base.RemoveItemEvents();
     
    7980      base.AddItemEvents();
    8081      if (Log != null) {
    81         Log.Items.ItemAdded += new EventHandler<ItemIndexEventArgs>(Items_ItemAdded);
    82         Log.Items.ItemRemoved += new EventHandler<ItemIndexEventArgs>(Items_ItemRemoved);
     82        Log.Items.ItemAdded += new EventHandler<EventArgs<IItem, int>>(Items_ItemAdded);
     83        Log.Items.ItemRemoved += new EventHandler<EventArgs<IItem, int>>(Items_ItemRemoved);
    8384      }
    8485    }
     
    106107    #region ItemList Events
    107108    private delegate void IndexDelegate(int index);
    108     private void Items_ItemRemoved(object sender, ItemIndexEventArgs e) {
    109       RemoveItem(e.Index);
     109    private void Items_ItemRemoved(object sender, EventArgs<IItem, int> e) {
     110      RemoveItem(e.Value2);
    110111    }
    111112    private void RemoveItem(int index) {
     
    119120      }
    120121    }
    121     private void Items_ItemAdded(object sender, ItemIndexEventArgs e) {
    122       AddItem(e.Index);
     122    private void Items_ItemAdded(object sender, EventArgs<IItem, int> e) {
     123      AddItem(e.Value2);
    123124    }
    124125    private void AddItem(int index) {
  • trunk/sources/HeuristicLab.Logging/3.3/PointXYChartView.cs

    r1530 r2474  
    3131using HeuristicLab.Charting;
    3232using HeuristicLab.Charting.Data;
     33using HeuristicLab.Common;
    3334
    3435namespace HeuristicLab.Logging {
     
    8586    protected override void RemoveItemEvents() {
    8687      if (PointXYChart != null) {
    87         PointXYChart.Values.ItemAdded -= new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    88         PointXYChart.Values.ItemRemoved -= new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     88        PointXYChart.Values.ItemAdded -= new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     89        PointXYChart.Values.ItemRemoved -= new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    8990      }
    9091      base.RemoveItemEvents();
     
    9798      base.AddItemEvents();
    9899      if (PointXYChart != null) {
    99         PointXYChart.Values.ItemAdded += new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    100         PointXYChart.Values.ItemRemoved += new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     100        PointXYChart.Values.ItemAdded += new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     101        PointXYChart.Values.ItemRemoved += new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    101102      }
    102103    }
     
    149150
    150151    #region Values Events
    151     private delegate void ItemIndexDelegate(object sender, ItemIndexEventArgs e);
    152     private void Values_ItemRemoved(object sender, ItemIndexEventArgs e) {
     152    private delegate void ItemIndexDelegate(object sender, EventArgs<IItem, int> e);
     153    private void Values_ItemRemoved(object sender, EventArgs<IItem, int> e) {
    153154      if (InvokeRequired) {
    154155        Invoke(new ItemIndexDelegate(Values_ItemRemoved), sender, e);
     
    157158      }
    158159    }
    159     private void Values_ItemAdded(object sender, ItemIndexEventArgs e) {
     160    private void Values_ItemAdded(object sender, EventArgs<IItem, int> e) {
    160161      if (InvokeRequired) {
    161162        Invoke(new ItemIndexDelegate(Values_ItemAdded), sender, e);
Note: See TracChangeset for help on using the changeset viewer.