SlideShare a Scribd company logo
1 of 32
Simulation Tool Plug-in Development Frank T. Bergmann Bloomington, 2010
C# Intro
C#  Managed Language Designed by: Microsoft, appeared in 2001 Influenced by: Java, C++, Object Pascal
.NET Framework
Hello World using System; class Hello {    static void Main() { Console.WriteLine 	("Hello world");    } }
Program Structure Namespaces Contain types and other namespaces Type declarations Classes, structs, interfaces, enums, and delegates Members Constants, fields, methods, properties, indexers, events, operators, constructors, destructors Organization No header files, code written “in-line” No declaration order dependence
Type System Value types Primitives	 	int i; EnumsenumState { Off, On } StructsstructPoint { int x, y; } Reference types Classes		class Foo: Bar, IFoo {...} Interfaces	 	interface IFoo: IBar {...} Arrays		string[] a = new string[10]; Delegates		delegate void Empty();
Classes Single inheritance Multiple interface implementation Class members Constants, fields, methods, properties, indexers, events, operators, constructors, destructors Static and instance members Nested types Member access public, protected, internal, private
Properties public class Button: Control {    private string caption;    public string Caption {       get {          return caption;       }       set {          caption = value;          Repaint();       }    } } Button b = new Button(); b.Caption = "OK"; String s = b.Caption;
Events (sourcing) public class Button{   public event EventHandler Click;    protected void OnClick(EventArgs e) {      if (Click != null) Click(this, e);   } }
Events (handling) public class MyForm: Form {    Button okButton;    public MyForm() { okButton = new Button(...); okButton.Caption = "OK"; okButton.Click += new EventHandler(OkButtonClick);    }    void OkButtonClick(object sender, EventArgs e) { ShowMessage("You pressed the OK button");    } }
More Information Wikibooks:  http://en.wikibooks.org/wiki/C_Sharp_Programming
Overview SIMULATION TOOL API
Setting UP VISUAL STUDIO
The Template http://sourceforge.net/projects/sbwsimtool/files/visual-studio-templates/v1
Save in My Documents The template needs to be saved in:  %USERPROFILE%y Documentsisual Studio 2010emplatesrojectTemplatesisual C# Or  %USERPROFILE%y Documentsisual Studio 2008emplatesrojectTemplatesisual C#
Open Visual Studio
Projectimula… Properties
Projectimula… Properties
Visual Studio Express <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">     <StartAction>Program</StartAction>     <StartProgram>C:rogram Files (x86)GIBWoadrunnerimDriverNET.exe</StartProgram>     <StartWorkingDirectory>C:rogram Files (x86)GIBWoadrunner</StartWorkingDirectory>   </PropertyGroup> </Project>
Debugun
Debugun
C O D E
RECAP
Hello World
SBML Viewer
Jarnac Editor
Access to the BioModels Database
Basic Stochastic Simulation
Source / Binaries The Visual Studio Projects + source code & binaries are available from:  http://sourceforge.net/projects/sbwsimtool/files/tutorials/bloomington2010
Acknowledgements Funded through the generous support of ERATO, DARPA (contract number MIPR 03-M296-01) and the DOE (under Grand No. DE-FG02-04ER63804, “Computational Resources for GTL”).

More Related Content

Similar to Simulation Tool - Plugin Development

Similar to Simulation Tool - Plugin Development (20)

Introduction To Csharp
Introduction To CsharpIntroduction To Csharp
Introduction To Csharp
 
Introduction to-csharp-1229579367461426-1
Introduction to-csharp-1229579367461426-1Introduction to-csharp-1229579367461426-1
Introduction to-csharp-1229579367461426-1
 
Introduction to CSharp
Introduction to CSharpIntroduction to CSharp
Introduction to CSharp
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
IntroToCSharpcode.ppt
IntroToCSharpcode.pptIntroToCSharpcode.ppt
IntroToCSharpcode.ppt
 
Introduction-to-Csharp.ppt
Introduction-to-Csharp.pptIntroduction-to-Csharp.ppt
Introduction-to-Csharp.ppt
 
Introduction-to-Csharp.ppt
Introduction-to-Csharp.pptIntroduction-to-Csharp.ppt
Introduction-to-Csharp.ppt
 
Introduction to-csharp
Introduction to-csharpIntroduction to-csharp
Introduction to-csharp
 
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
Introduction To Csharp
Introduction To CsharpIntroduction To Csharp
Introduction To Csharp
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
1204csharp
1204csharp1204csharp
1204csharp
 
03 oo with-c-sharp
03 oo with-c-sharp03 oo with-c-sharp
03 oo with-c-sharp
 
OOC MODULE1.pptx
OOC MODULE1.pptxOOC MODULE1.pptx
OOC MODULE1.pptx
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Java
 

Simulation Tool - Plugin Development

  • 1. Simulation Tool Plug-in Development Frank T. Bergmann Bloomington, 2010
  • 3. C# Managed Language Designed by: Microsoft, appeared in 2001 Influenced by: Java, C++, Object Pascal
  • 5. Hello World using System; class Hello { static void Main() { Console.WriteLine ("Hello world"); } }
  • 6. Program Structure Namespaces Contain types and other namespaces Type declarations Classes, structs, interfaces, enums, and delegates Members Constants, fields, methods, properties, indexers, events, operators, constructors, destructors Organization No header files, code written “in-line” No declaration order dependence
  • 7. Type System Value types Primitives int i; EnumsenumState { Off, On } StructsstructPoint { int x, y; } Reference types Classes class Foo: Bar, IFoo {...} Interfaces interface IFoo: IBar {...} Arrays string[] a = new string[10]; Delegates delegate void Empty();
  • 8. Classes Single inheritance Multiple interface implementation Class members Constants, fields, methods, properties, indexers, events, operators, constructors, destructors Static and instance members Nested types Member access public, protected, internal, private
  • 9. Properties public class Button: Control { private string caption; public string Caption { get { return caption; } set { caption = value; Repaint(); } } } Button b = new Button(); b.Caption = "OK"; String s = b.Caption;
  • 10. Events (sourcing) public class Button{ public event EventHandler Click; protected void OnClick(EventArgs e) { if (Click != null) Click(this, e); } }
  • 11. Events (handling) public class MyForm: Form { Button okButton; public MyForm() { okButton = new Button(...); okButton.Caption = "OK"; okButton.Click += new EventHandler(OkButtonClick); } void OkButtonClick(object sender, EventArgs e) { ShowMessage("You pressed the OK button"); } }
  • 12. More Information Wikibooks: http://en.wikibooks.org/wiki/C_Sharp_Programming
  • 14.
  • 17. Save in My Documents The template needs to be saved in: %USERPROFILE%y Documentsisual Studio 2010emplatesrojectTemplatesisual C# Or %USERPROFILE%y Documentsisual Studio 2008emplatesrojectTemplatesisual C#
  • 21. Visual Studio Express <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <StartAction>Program</StartAction> <StartProgram>C:rogram Files (x86)GIBWoadrunnerimDriverNET.exe</StartProgram> <StartWorkingDirectory>C:rogram Files (x86)GIBWoadrunner</StartWorkingDirectory> </PropertyGroup> </Project>
  • 24. C O D E
  • 25. RECAP
  • 29. Access to the BioModels Database
  • 31. Source / Binaries The Visual Studio Projects + source code & binaries are available from: http://sourceforge.net/projects/sbwsimtool/files/tutorials/bloomington2010
  • 32. Acknowledgements Funded through the generous support of ERATO, DARPA (contract number MIPR 03-M296-01) and the DOE (under Grand No. DE-FG02-04ER63804, “Computational Resources for GTL”).