0
Simulation Tool Plug-in Development<br />Frank T. Bergmann<br />Bloomington, 2010<br />
C# Intro<br />
C# <br />Managed Language<br />Designed by: Microsoft, appeared in 2001<br />Influenced by: Java, C++, Object Pascal<br />
.NET Framework<br />
Hello World<br />using System;<br />class Hello<br />{<br />   static void Main() {<br />Console.WriteLine<br />	("Hello w...
Program Structure<br />Namespaces<br />Contain types and other namespaces<br />Type declarations<br />Classes, structs, in...
Type System<br />Value types<br />Primitives	 	int i;<br />EnumsenumState { Off, On }<br />StructsstructPoint { int x, y; ...
Classes<br />Single inheritance<br />Multiple interface implementation<br />Class members<br />Constants, fields, methods,...
Properties<br />public class Button: Control<br />{<br />   private string caption;<br />   public string Caption {<br /> ...
Events (sourcing)<br />public class Button{   public event EventHandler Click;<br />   protected void OnClick(EventArgs e)...
Events (handling)<br />public class MyForm: Form<br />{<br />   Button okButton;<br />   public MyForm() {<br />okButton =...
More Information<br />Wikibooks: <br />http://en.wikibooks.org/wiki/C_Sharp_Programming<br />
Overview SIMULATION TOOL API<br />
Setting UP VISUAL STUDIO<br />
The Template<br />http://sourceforge.net/projects/sbwsimtool/files/visual-studio-templates/v1<br />
Save in My Documents<br />The template needs to be saved in: <br />%USERPROFILE%My DocumentsVisual Studio 2010TemplatesPro...
Open Visual Studio<br />
ProjectSimula… Properties<br />
ProjectSimula… Properties<br />
Visual Studio Express<br /><?xml version="1.0" encoding="utf-8"?><br /><Project ToolsVersion="4.0" xmlns="http://schemas.m...
DebugRun<br />
DebugRun<br />
C O D E <br />
RECAP<br />
Hello World <br />
SBML Viewer<br />
Jarnac Editor<br />
Access to the BioModels Database<br />
Basic Stochastic Simulation<br />
Source / Binaries<br />The Visual Studio Projects + source code & binaries are available from: <br />http://sourceforge.ne...
Acknowledgements<br />Funded through the generous support of ERATO, DARPA (contract number MIPR 03-M296-01) and the DOE (u...
Upcoming SlideShare
Loading in...5
×

Simulation Tool - Plugin Development

371

Published on

In this presentation I give a brief overview of C# and introduce plugin development for the SBW Simulation Tool.

Published in: Self Improvement
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
371
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Simulation Tool - Plugin Development"

  1. 1. Simulation Tool Plug-in Development<br />Frank T. Bergmann<br />Bloomington, 2010<br />
  2. 2. C# Intro<br />
  3. 3. C# <br />Managed Language<br />Designed by: Microsoft, appeared in 2001<br />Influenced by: Java, C++, Object Pascal<br />
  4. 4. .NET Framework<br />
  5. 5. Hello World<br />using System;<br />class Hello<br />{<br /> static void Main() {<br />Console.WriteLine<br /> ("Hello world");<br /> }<br />}<br />
  6. 6. Program Structure<br />Namespaces<br />Contain types and other namespaces<br />Type declarations<br />Classes, structs, interfaces, enums, and delegates<br />Members<br />Constants, fields, methods, properties, indexers, events, operators, constructors, destructors<br />Organization<br />No header files, code written “in-line”<br />No declaration order dependence<br />
  7. 7. Type System<br />Value types<br />Primitives int i;<br />EnumsenumState { Off, On }<br />StructsstructPoint { int x, y; }<br />Reference types<br />Classes class Foo: Bar, IFoo {...}<br />Interfaces interface IFoo: IBar {...}<br />Arrays string[] a = new string[10];<br />Delegates delegate void Empty();<br />
  8. 8. Classes<br />Single inheritance<br />Multiple interface implementation<br />Class members<br />Constants, fields, methods, properties, indexers, events, operators, constructors, destructors<br />Static and instance members<br />Nested types<br />Member access<br />public, protected, internal, private<br />
  9. 9. Properties<br />public class Button: Control<br />{<br /> private string caption;<br /> public string Caption {<br /> get {<br /> return caption;<br /> }<br /> set {<br /> caption = value;<br /> Repaint();<br /> }<br /> }<br />}<br />Button b = new Button();<br />b.Caption = "OK";<br />String s = b.Caption;<br />
  10. 10. Events (sourcing)<br />public class Button{ public event EventHandler Click;<br /> protected void OnClick(EventArgs e) { if (Click != null) Click(this, e); }<br />}<br />
  11. 11. Events (handling)<br />public class MyForm: Form<br />{<br /> Button okButton;<br /> public MyForm() {<br />okButton = new Button(...);<br />okButton.Caption = "OK";<br />okButton.Click += new EventHandler(OkButtonClick);<br /> }<br /> void OkButtonClick(object sender, EventArgs e) {<br />ShowMessage("You pressed the OK button");<br /> }<br />}<br />
  12. 12. More Information<br />Wikibooks: <br />http://en.wikibooks.org/wiki/C_Sharp_Programming<br />
  13. 13. Overview SIMULATION TOOL API<br />
  14. 14.
  15. 15. Setting UP VISUAL STUDIO<br />
  16. 16. The Template<br />http://sourceforge.net/projects/sbwsimtool/files/visual-studio-templates/v1<br />
  17. 17. Save in My Documents<br />The template needs to be saved in: <br />%USERPROFILE%My DocumentsVisual Studio 2010TemplatesProjectTemplatesVisual C#<br />Or <br />%USERPROFILE%My DocumentsVisual Studio 2008TemplatesProjectTemplatesVisual C#<br />
  18. 18. Open Visual Studio<br />
  19. 19. ProjectSimula… Properties<br />
  20. 20. ProjectSimula… Properties<br />
  21. 21. Visual Studio Express<br /><?xml version="1.0" encoding="utf-8"?><br /><Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><br /> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"><br /> <StartAction>Program</StartAction><br /> <StartProgram>C:Program Files (x86)KGISBW oadrunnerSimDriverNET.exe</StartProgram><br /> <StartWorkingDirectory>C:Program Files (x86)KGISBW oadrunner</StartWorkingDirectory><br /> </PropertyGroup><br /></Project><br />
  22. 22. DebugRun<br />
  23. 23. DebugRun<br />
  24. 24. C O D E <br />
  25. 25. RECAP<br />
  26. 26. Hello World <br />
  27. 27. SBML Viewer<br />
  28. 28. Jarnac Editor<br />
  29. 29. Access to the BioModels Database<br />
  30. 30. Basic Stochastic Simulation<br />
  31. 31. Source / Binaries<br />The Visual Studio Projects + source code & binaries are available from: <br />http://sourceforge.net/projects/sbwsimtool/files/tutorials/bloomington2010<br />
  32. 32. Acknowledgements<br />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”).<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×