Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/ProgrammableNetworkItemView.Designer.cs
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/ProgrammableNetworkItemView.Designer.cs	(revision 11563)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/ProgrammableNetworkItemView.Designer.cs	(revision 11563)
@@ -0,0 +1,249 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Core.Networks.Views {
+  partial class ProgrammableNetworkItemView {
+    /// <summary>
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form Designer generated code
+
+    /// <summary>
+    /// Required method for Designer support - do not modify
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
+      this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.codeGroupBox = new System.Windows.Forms.GroupBox();
+      this.codeEditor = new HeuristicLab.CodeEditor.CodeEditor();
+      this.errorsGroupBox = new System.Windows.Forms.GroupBox();
+      this.errorsListView = new System.Windows.Forms.ListView();
+      this.iconColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+      this.categoryColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+      this.errorNumberColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+      this.lineColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+      this.columnColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+      this.descriptionColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+      this.imageList = new System.Windows.Forms.ImageList(this.components);
+      this.compileButton = new System.Windows.Forms.Button();
+      this.compilationLabel = new System.Windows.Forms.Label();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.codeGroupBox.SuspendLayout();
+      this.errorsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      // 
+      // splitContainer
+      // 
+      this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.splitContainer.Location = new System.Drawing.Point(0, 56);
+      this.splitContainer.Name = "splitContainer";
+      this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.codeGroupBox);
+      // 
+      // splitContainer.Panel2
+      // 
+      this.splitContainer.Panel2.Controls.Add(this.errorsGroupBox);
+      this.splitContainer.Size = new System.Drawing.Size(645, 461);
+      this.splitContainer.SplitterDistance = 352;
+      this.splitContainer.TabIndex = 3;
+      // 
+      // codeGroupBox
+      // 
+      this.codeGroupBox.Controls.Add(this.codeEditor);
+      this.codeGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.codeGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.codeGroupBox.Name = "codeGroupBox";
+      this.codeGroupBox.Size = new System.Drawing.Size(645, 352);
+      this.codeGroupBox.TabIndex = 1;
+      this.codeGroupBox.TabStop = false;
+      this.codeGroupBox.Text = "Code";
+      // 
+      // codeEditor
+      // 
+      this.codeEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.codeEditor.Location = new System.Drawing.Point(6, 19);
+      this.codeEditor.Name = "codeEditor";
+      this.codeEditor.Prefix = "";
+      this.codeEditor.Size = new System.Drawing.Size(633, 327);
+      this.codeEditor.Suffix = "";
+      this.codeEditor.TabIndex = 0;
+      this.codeEditor.UserCode = "";
+      this.codeEditor.Validated += new System.EventHandler(this.codeEditor_Validated);
+      // 
+      // errorsGroupBox
+      // 
+      this.errorsGroupBox.Controls.Add(this.errorsListView);
+      this.errorsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.errorsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.errorsGroupBox.Name = "errorsGroupBox";
+      this.errorsGroupBox.Size = new System.Drawing.Size(645, 105);
+      this.errorsGroupBox.TabIndex = 0;
+      this.errorsGroupBox.TabStop = false;
+      this.errorsGroupBox.Text = "Errors";
+      // 
+      // errorsListView
+      // 
+      this.errorsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.iconColumnHeader,
+            this.categoryColumnHeader,
+            this.errorNumberColumnHeader,
+            this.lineColumnHeader,
+            this.columnColumnHeader,
+            this.descriptionColumnHeader});
+      this.errorsListView.FullRowSelect = true;
+      this.errorsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
+      this.errorsListView.HideSelection = false;
+      this.errorsListView.Location = new System.Drawing.Point(6, 19);
+      this.errorsListView.Name = "errorsListView";
+      this.errorsListView.Size = new System.Drawing.Size(633, 80);
+      this.errorsListView.SmallImageList = this.imageList;
+      this.errorsListView.TabIndex = 0;
+      this.errorsListView.UseCompatibleStateImageBehavior = false;
+      this.errorsListView.View = System.Windows.Forms.View.Details;
+      this.errorsListView.DoubleClick += new System.EventHandler(this.errorsListView_DoubleClick);
+      // 
+      // iconColumnHeader
+      // 
+      this.iconColumnHeader.Text = "";
+      // 
+      // categoryColumnHeader
+      // 
+      this.categoryColumnHeader.Text = "Category";
+      // 
+      // errorNumberColumnHeader
+      // 
+      this.errorNumberColumnHeader.Text = "Error Number";
+      // 
+      // lineColumnHeader
+      // 
+      this.lineColumnHeader.Text = "Line";
+      // 
+      // columnColumnHeader
+      // 
+      this.columnColumnHeader.Text = "Column";
+      // 
+      // descriptionColumnHeader
+      // 
+      this.descriptionColumnHeader.Text = "Description";
+      // 
+      // imageList
+      // 
+      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+      // 
+      // compileButton
+      // 
+      this.compileButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Script;
+      this.compileButton.Location = new System.Drawing.Point(6, 26);
+      this.compileButton.Name = "compileButton";
+      this.compileButton.Size = new System.Drawing.Size(24, 24);
+      this.compileButton.TabIndex = 3;
+      this.toolTip.SetToolTip(this.compileButton, "Compile (F6)");
+      this.compileButton.UseVisualStyleBackColor = true;
+      this.compileButton.Click += new System.EventHandler(this.compileButton_Click);
+      // 
+      // compilationLabel
+      // 
+      this.compilationLabel.AutoSize = true;
+      this.compilationLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
+      this.compilationLabel.Location = new System.Drawing.Point(66, 32);
+      this.compilationLabel.Name = "compilationLabel";
+      this.compilationLabel.Size = new System.Drawing.Size(69, 13);
+      this.compilationLabel.TabIndex = 4;
+      this.compilationLabel.Text = "Not compiled";
+      // 
+      // ProgrammableNetworkItemView
+      // 
+      this.Controls.Add(this.compilationLabel);
+      this.Controls.Add(this.compileButton);
+      this.Controls.Add(this.splitContainer);
+      this.Name = "ProgrammableNetworkItemView";
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.splitContainer, 0);
+      this.Controls.SetChildIndex(this.compileButton, 0);
+      this.Controls.SetChildIndex(this.compilationLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.codeGroupBox.ResumeLayout(false);
+      this.errorsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.SplitContainer splitContainer;
+    protected System.Windows.Forms.GroupBox errorsGroupBox;
+    protected System.Windows.Forms.Button compileButton;
+    protected CodeEditor.CodeEditor codeEditor;
+    protected System.Windows.Forms.ListView errorsListView;
+    protected System.Windows.Forms.ColumnHeader iconColumnHeader;
+    protected System.Windows.Forms.ColumnHeader categoryColumnHeader;
+    protected System.Windows.Forms.ColumnHeader errorNumberColumnHeader;
+    protected System.Windows.Forms.ColumnHeader lineColumnHeader;
+    protected System.Windows.Forms.ColumnHeader columnColumnHeader;
+    protected System.Windows.Forms.ColumnHeader descriptionColumnHeader;
+    protected System.Windows.Forms.Label compilationLabel;
+    protected System.Windows.Forms.ImageList imageList;
+    protected System.Windows.Forms.GroupBox codeGroupBox;
+
+  }
+}
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/ProgrammableNetworkItemView.cs
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/ProgrammableNetworkItemView.cs	(revision 11563)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/ProgrammableNetworkItemView.cs	(revision 11563)
@@ -0,0 +1,165 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common.Resources;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+using System;
+using System.CodeDom.Compiler;
+using System.Drawing;
+using System.Globalization;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Core.Networks.Views {
+  [View("ProgrammableNetworkItem View")]
+  [Content(typeof(IProgrammableNetworkItem), false)]
+  public partial class ProgrammableNetworkItemView : NetworkItemView {
+    public new IProgrammableNetworkItem Content {
+      get { return (IProgrammableNetworkItem)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public ProgrammableNetworkItemView() {
+      InitializeComponent();
+      errorsListView.SmallImageList.Images.AddRange(new Image[] { VSImageLibrary.Warning, VSImageLibrary.Error });
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.CodeChanged -= Content_CodeChanged;
+      base.DeregisterContentEvents();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.CodeChanged += Content_CodeChanged;
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      errorsListView.Items.Clear();
+      if (Content == null) {
+        codeEditor.UserCode = string.Empty;
+      } else {
+        codeEditor.UserCode = Content.Code;
+        foreach (var asm in Content.GetAssemblies())
+          codeEditor.AddAssembly(asm);
+      }
+      ShowCompilationResults();
+      UpdateCompilationLabel();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      compileButton.Enabled = Content != null && !Locked && !ReadOnly;
+      codeEditor.Enabled = Content != null;
+    }
+
+    protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, Keys keyData) {
+      switch (keyData) {
+        case Keys.F6:
+          if (Content != null && !Locked)
+            Compile();
+          return true;
+      }
+      return base.ProcessCmdKey(ref msg, keyData);
+    }
+
+    protected virtual void Content_CodeChanged(object sender, EventArgs e) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Content_CodeChanged), sender, e);
+      else {
+        codeEditor.UserCode = Content.Code;
+      }
+    }
+
+    private void compileButton_Click(object sender, EventArgs e) {
+      Compile();
+    }
+    private void codeEditor_Validated(object sender, EventArgs e) {
+      if (Content != null) Content.Code = codeEditor.UserCode;
+    }
+    private void errorsListView_DoubleClick(object sender, EventArgs e) {
+      if ((Content != null) && (Content.CompileErrors != null)) {
+        codeEditor.ShowCompileErrors(Content.CompileErrors, ".cs");
+      }
+    }
+
+    #region Helpers
+    protected virtual void Compile() {
+      ReadOnly = true;
+      Locked = true;
+      errorsListView.Items.Clear();
+      try {
+        Content.Compile();
+      }
+      catch (Exception ex) {
+        if (!(ex is InvalidOperationException) || (Content.CompileErrors == null))
+          ErrorHandling.ShowErrorDialog(this, ex);
+      }
+      ShowCompilationResults();
+      UpdateCompilationLabel();
+      ReadOnly = false;
+      Locked = false;
+    }
+
+    protected virtual void ShowCompilationResults() {
+      if ((Content == null) || (Content.CompileErrors == null) || (Content.CompileErrors.Count == 0)) return;
+      var errors = Content.CompileErrors.OfType<CompilerError>()
+                                      .OrderBy(x => x.IsWarning)
+                                      .ThenBy(x => x.Line)
+                                      .ThenBy(x => x.Column);
+      foreach (var e in errors) {
+        var item = new ListViewItem();
+        item.SubItems.AddRange(new[] {
+          e.IsWarning ? "Warning" : "Error",
+          e.ErrorNumber,
+          e.Line.ToString(CultureInfo.InvariantCulture),
+          e.Column.ToString(CultureInfo.InvariantCulture),
+          e.ErrorText
+        });
+        item.ImageIndex = e.IsWarning ? 0 : 1;
+        errorsListView.Items.Add(item);
+      }
+
+      foreach (ColumnHeader ch in errorsListView.Columns) {
+        // adjusts column width to width of column header
+        ch.Width = -2;
+      }
+
+      codeEditor.ShowCompileErrors(Content.CompileErrors, ".cs");
+    }
+
+    protected virtual void UpdateCompilationLabel() {
+      if ((Content == null) || (Content.CompileErrors == null)) {
+        compilationLabel.ForeColor = SystemColors.ControlDarkDark;
+        compilationLabel.Text = "Not compiled";
+      } else if (Content.CompileErrors.HasErrors) {
+        compilationLabel.ForeColor = Color.DarkRed;
+        compilationLabel.Text = "Compilation failed";
+      } else {
+        compilationLabel.ForeColor = Color.DarkGreen;
+        compilationLabel.Text = "Compilation successful";
+      }
+    }
+    #endregion
+  }
+}
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj	(revision 11562)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj	(revision 11563)
@@ -187,4 +187,10 @@
       <DependentUpon>PortView.cs</DependentUpon>
     </Compile>
+    <Compile Include="Core.Networks.Views\ProgrammableNetworkItemView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Core.Networks.Views\ProgrammableNetworkItemView.Designer.cs">
+      <DependentUpon>ProgrammableNetworkItemView.cs</DependentUpon>
+    </Compile>
     <Compile Include="Core.Networks.Views\UserDefinedNetworkView.cs">
       <SubType>UserControl</SubType>
@@ -226,55 +232,73 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.CodeEditor\3.3\HeuristicLab.CodeEditor-3.3.csproj">
+      <Project>{489cfe09-fdf7-4c89-bab5-bd09cadd61ad}</Project>
+      <Name>HeuristicLab.CodeEditor-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
       <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
       <Name>HeuristicLab.Collections-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
       <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>
       <Name>HeuristicLab.Common.Resources-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
       <Project>{a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project>
       <Name>HeuristicLab.Common-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
       <Project>{e226881d-315f-423d-b419-a766fe0d8685}</Project>
       <Name>HeuristicLab.Core.Views-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
       <Project>{c36bd924-a541-4a00-afa8-41701378ddc5}</Project>
       <Name>HeuristicLab.Core-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
       <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
       <Name>HeuristicLab.Data-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
       <Project>{ab687bbe-1bfe-476b-906d-44237135431d}</Project>
       <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj">
       <Project>{3bd61258-31da-4b09-89c0-4f71fef5f05a}</Project>
       <Name>HeuristicLab.MainForm-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Operators.Views\3.3\HeuristicLab.Operators.Views-3.3.csproj">
       <Project>{c49cb749-8b24-4628-8003-e86475749410}</Project>
       <Name>HeuristicLab.Operators.Views-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
       <Project>{23da7ff4-d5b8-41b6-aa96-f0561d24f3ee}</Project>
       <Name>HeuristicLab.Operators-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Optimization.Networks\3.3\HeuristicLab.Optimization.Networks-3.3.csproj">
       <Project>{7cf51332-0e37-447c-8017-82a258c59ef2}</Project>
       <Name>HeuristicLab.Optimization.Networks-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj">
       <Project>{662b4b15-8f4d-4ae5-b3eb-d91c215f5af2}</Project>
       <Name>HeuristicLab.Optimization.Views-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
       <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project>
       <Name>HeuristicLab.Optimization-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Plugin.cs.frame
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Plugin.cs.frame	(revision 11562)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Plugin.cs.frame	(revision 11563)
@@ -28,4 +28,5 @@
   [Plugin("HeuristicLab.Optimization.Networks.Views", "3.3.11.$WCREV$")]
   [PluginFile("HeuristicLab.Optimization.Networks.Views-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.CodeEditor", "3.3")]
   [PluginDependency("HeuristicLab.Collections", "3.3")]
   [PluginDependency("HeuristicLab.Common", "3.3")]
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IProgrammableNetworkItem.cs
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IProgrammableNetworkItem.cs	(revision 11563)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IProgrammableNetworkItem.cs	(revision 11563)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.Reflection;
+
+namespace HeuristicLab.Core.Networks {
+  public interface IProgrammableNetworkItem : INetworkItem {
+    string Code { get; set; }
+    CompilerErrorCollection CompileErrors { get; }
+
+    void Compile();
+    IEnumerable<Assembly> GetAssemblies();
+
+    event EventHandler CodeChanged;
+    event EventHandler CompileErrorsChanged;
+  }
+}
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItem.cs
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItem.cs	(revision 11562)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItem.cs	(revision 11563)
@@ -24,5 +24,4 @@
 using Microsoft.CSharp;
 using System;
-using System.CodeDom;
 using System.CodeDom.Compiler;
 using System.Collections.Generic;
@@ -36,5 +35,5 @@
   [Item("ProgrammableNetworkItem", "Abstract base class for programmable items of a network.")]
   [StorableClass]
-  public abstract class ProgrammableNetworkItem : NetworkItem {
+  public abstract class ProgrammableNetworkItem : NetworkItem, IProgrammableNetworkItem {
     #region Item Properties
     public static new Image StaticItemImage {
@@ -62,5 +61,5 @@
 
     protected virtual string CodeTemplate {
-      get { return ReadCodeTemplate("ProgrammableNetworkItemTemplate.cs"); }
+      get { return ReadCodeTemplate("HeuristicLab.Optimization.Networks.Core.Networks.ProgrammableNetworkItemTemplate.cs"); }
     }
 
@@ -88,5 +87,10 @@
     private INetworkItem compiledNetworkItem;
     protected INetworkItem CompiledNetworkItem {
-      get { return compiledNetworkItem; }
+      get {
+        if (compiledNetworkItem == null) {
+          Compile();
+        }
+        return compiledNetworkItem;
+      }
       set {
         if (compiledNetworkItem != value) {
@@ -152,9 +156,15 @@
             .AppendLine(error.ErrorText);
         }
-        throw new Exception(string.Format("Compilation of \"{0}\" failed:{1}{2}",
+        throw new InvalidOperationException(string.Format("Compilation of \"{0}\" failed:{1}{2}",
           Name, Environment.NewLine, sb.ToString()));
       }
-      var assembly = results.CompiledAssembly;
-      compiledNetworkItem = (INetworkItem)Activator.CreateInstance(assembly.GetTypes().Single(x => typeof(CompiledProgrammableNetworkItem).IsAssignableFrom(x)), this);
+      CompiledNetworkItem = (INetworkItem)Activator.CreateInstance(
+        results.CompiledAssembly.GetTypes()
+          .Single(x => typeof(CompiledProgrammableNetworkItem)
+          .IsAssignableFrom(x)),
+        this);
+    }
+    public virtual IEnumerable<Assembly> GetAssemblies() {
+      return AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location));
     }
     #endregion
@@ -293,19 +303,4 @@
 
     #region Helpers
-    protected virtual IEnumerable<Assembly> GetAssemblies() {
-      foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) {
-        bool valid = false;
-        try {
-          valid = File.Exists(a.Location);
-        }
-        catch (NotSupportedException) {
-          // NotSupportedException is thrown while accessing 
-          // the Location property of the anonymously hosted
-          // dynamic methods assembly, which is related to
-          // LINQ queries
-        }
-        if (valid) yield return a;
-      }
-    }
     protected string ReadCodeTemplate(string templateName) {
       using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(templateName))
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItemTemplate.cs
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItemTemplate.cs	(revision 11562)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItemTemplate.cs	(revision 11563)
@@ -1,23 +1,2 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
 using HeuristicLab.Common;
 using System;
@@ -27,5 +6,5 @@
   public class MyProgrammableNetworkItem : ProgrammableNetworkItem.CompiledProgrammableNetworkItem {
     protected MyProgrammableNetworkItem(MyProgrammableNetworkItem original, Cloner cloner) : base(original, cloner) { }
-    protected MyProgrammableNetworkItem(ProgrammableNetworkItem context) : base(context) { }
+    public MyProgrammableNetworkItem(ProgrammableNetworkItem context) : base(context) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNode.cs
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNode.cs	(revision 11562)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNode.cs	(revision 11563)
@@ -31,5 +31,5 @@
   public class ProgrammableNode : ProgrammableNetworkItem, INode {
     protected override string CodeTemplate {
-      get { return ReadCodeTemplate("ProgrammableNodeTemplate.cs"); }
+      get { return ReadCodeTemplate("HeuristicLab.Optimization.Networks.Core.Networks.ProgrammableNodeTemplate.cs"); }
     }
 
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNodeTemplate.cs
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNodeTemplate.cs	(revision 11562)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNodeTemplate.cs	(revision 11563)
@@ -1,23 +1,2 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
 using HeuristicLab.Common;
 using System;
@@ -28,5 +7,5 @@
   public class MyProgrammableNode : ProgrammableNode.CompiledProgrammableNode {
     protected MyProgrammableNode(MyProgrammableNode original, Cloner cloner) : base(original, cloner) { }
-    protected MyProgrammableNode(ProgrammableNode context) : base(context) { }
+    public MyProgrammableNode(ProgrammableNode context) : base(context) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
Index: branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj
===================================================================
--- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj	(revision 11562)
+++ branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj	(revision 11563)
@@ -91,4 +91,5 @@
   <ItemGroup>
     <Compile Include="Core.Networks\IConnectablePort.cs" />
+    <Compile Include="Core.Networks\IProgrammableNetworkItem.cs" />
     <Compile Include="Core.Networks\IUserDefinedMessagePort.cs" />
     <Compile Include="Core.Networks\IMessagePort.cs" />
@@ -148,48 +149,60 @@
       <Project>{a51da44f-cb35-4f6f-99f5-2a2e904ab93b}</Project>
       <Name>HeuristicLab.Algorithms.GeneticAlgorithm-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
       <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
       <Name>HeuristicLab.Collections-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
       <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>
       <Name>HeuristicLab.Common.Resources-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
       <Project>{a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project>
       <Name>HeuristicLab.Common-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
       <Project>{c36bd924-a541-4a00-afa8-41701378ddc5}</Project>
       <Name>HeuristicLab.Core-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
       <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
       <Name>HeuristicLab.Data-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Encodings.BinaryVectorEncoding\3.3\HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj">
       <Project>{66d249c3-a01d-42a8-82a2-919bc8ec3d83}</Project>
       <Name>HeuristicLab.Encodings.BinaryVectorEncoding-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj">
       <Project>{dbecb8b0-b166-4133-baf1-ed67c3fd7fca}</Project>
       <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
       <Project>{23da7ff4-d5b8-41b6-aa96-f0561d24f3ee}</Project>
       <Name>HeuristicLab.Operators-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
       <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project>
       <Name>HeuristicLab.Optimization-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
       <Project>{56f9106a-079f-4c61-92f6-86a84c2d84b7}</Project>
       <Name>HeuristicLab.Parameters-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
       <Project>{102bc7d3-0ef9-439c-8f6d-96ff0fdb8e1b}</Project>
       <Name>HeuristicLab.Persistence-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
@@ -201,12 +214,15 @@
       <Project>{3540e29e-4793-49e7-8ee2-fea7f61c3994}</Project>
       <Name>HeuristicLab.Problems.Instances-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Problems.Knapsack\3.3\HeuristicLab.Problems.Knapsack-3.3.csproj">
       <Project>{e10f395f-c8a6-48ad-b470-9aa7a1f43809}</Project>
       <Name>HeuristicLab.Problems.Knapsack-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj">
       <Project>{d767c38d-8014-46b0-9a32-03a3aecce34a}</Project>
       <Name>HeuristicLab.Problems.TravelingSalesman-3.3</Name>
+      <Private>False</Private>
     </ProjectReference>
   </ItemGroup>
