The GUI designer for MonoDevelop (Stetic) provides design-time support for widgets, such as the Notebook widget, which has options for Insert Page Before and Insert Page After. It also allows me to drop child widgets onto those separate pages.
Is this implemented directly in Gtk#? Where can I examine the code for this? How can I implement this for my own custom widgets? I want to create a notebook-like navigation control (similar to MS Outlook 2007/2010/2013) that can be designed using drag-and-drop with Stetic.
I have already tried searching through the source for MonoDevelop and Gtk#. It seems to me this may be implemented in a similar manner with additional classes and attributes like in Visual Studio with Attributes and Design-Time Support but I cannot find any evidence of that.
In MonoDevelop, Stetic is defined as a member in AddIns. Technically, it is always available/installed, so it is not something you deal with from the Add In Manager.
So you are looking for:
MonoDevelop.GtkCore.dll
libstetic.dll
libsteticui.dll
During a monodevelop build, assuming you have monodevelop code local, those get built and placed in:
monodevelop/main/build/AddIns/MonoDevelop.GtkCore
The source code that you are looking for is at:
monodevelop/main/src/addins/*
I would highly recommend in order to jump-start you:
git clone the monodevelop source repo
cd into the repo
./configure --help (to figure out what options you need to use)
Once you can build monodevelop, you can use that build version or (Xamarin
Starter+) to open workspace MonoDevelop.mdw (in root dir of repo)
Navigate to:
Main / Addins / MonoDevelop.GtkCore / libstetic
Main / Addins / MonoDevelop.GtkCore / libsteticui
Have fun storming the castle ;-)
The Stetic designer in MonoDevelop simply does not support the concept of "pluggable" widget design or commands. It's just written the way it is for the controls it supports and anything else has to be added via the Custom Widget widget and manipulated via code.
Related
I'd like to do some "structural meta-programming" in C# (like in other languages as Smalltalk).
For doing so I'd like to script, using a REPL-like tool that should run "inside" VisualStudio. Doing so it would be possible to try ideas, execute refactorings programmatically, etc. from the VisualStudio itself and making use of the full meta-model capabilities it and ReSharper has.
I found that the tool "C# Interactive" allows to script in C# as a common REPL, but runs as a "separated process", not inside VisualStudio.
Is there an tool like "C# Interactive" that runs as VisualStudio/ReSharper plug-in? Any hint, idea, etc. will be welcome :-)
You can load Roslyn into your interactive session, then use its APIs to manipulate your code.
Create an MSBuildWorkspace, load your solution, then explore the Roslyn APIs to your heart's content.
No Visual Studio needed.
You may find my Visual Commander extension useful. The command code provides full access to the VS automation model and executes inside Visual Studio.
I'd like to implement a small feature (getting default Styles and ControlTemplates for WPF controls) that is missing in SharpDevelop vs. Visual Studio. I'm facing the problem that I do not understand what is considered to be the public API surface for the WpfDesign.Designer addin that I'd like to extend.
Is there an established mechanism for addins to declare in what ways other addins may extend them (addins extending other addins is explicitly allowed in the SharpDevelop architecture)?
The public API surface is all the public types in the WpfDesign.Designer assemblies. You can reference them directly and specify this in your addin's .addin file so the designer addin is loaded before your addin is loaded.
<Manifest>
<Identity name="YourAddInId"/>
<Dependency addin="ICSharpCode.AvalonEdit" requirePreload="true"/>
</Manifest>
Using the public types is the simplest way to extend an existing addin. You reference the designer assemblies, but do not have them copied locally to your addin's output directory.
There are other ways to extend SharpDevelop using extension paths in the addin system. This allows you to have addins that do not depend on each other. The WPFDesigner addin does not define any extension points/paths as far as I am aware so I would just directly reference the designer assemblies and use them.
Also another approach to consider would be to add the changes directly to the SharpDevelop source code and submit a pull request so they can be included in SharpDevelop directly. However an addin might be useful to as a proof of concept.
We are using Enterprise Architect for our models.
EA can be integrated with version control system, for that, it is required to set configuration from EA to the directory in SVN folder- in which the XMI files of packages will be stored.
The configuration settings process is a long and annoying process which we would like to be done automatically.
Is there a way to do this programmatically?
UPDATE: This is the window which requires the manual configuration for each machine.
Yes, there is. The API does not support selecting version control provider etc, but it does support adding/removing packages to/from version control and checking them in and out once the provider is set.
The methods are in the Package class (in the help file under Automation and Scripting -- Enterprise Architect Object Model -- Reference -- Repository Package -- Package Class):
VersionControlAdd()
VersionControlCheckin()
VersionControlCheckinEx()
VersionControlCheckout()
VersionControlGetLatest()
VersionControlGetStatus()
VersionControlPutLatest()
VersionControlRemove()
VersionControlResynchPkgStatus()
Repository.VersionControlResynchPkgStatuses() resynchronizes all version-controlled packages, but that's the only project-level version control method in the API.
You don't have to write an Add-In if it's a one-off thing. A stand-alone application has access to the Object Model API, whereas an Add-In (which is integrated into EA) also has access to the Add-In Model API (see Automation and Scripting -- Enterprise Architect Add-In Model).
The Add-In Model API fires a number of events when model elements are created, updated, etc, but no events are triggered by version control changes. So if you only need to add a number of packages to the version control repository, a stand-alone application can do that.
Have you referred to the best practices prescribed by Sparx? http://www.sparxsystems.com/WhitePapers/Version_Control.pdf
Whilst I agree it could be a time-consuming process to setup version control for the first time, there are several tricks which could make it less cumbersome.
E.g. COnfiguring the packages (or branches) in one model and then sharing the same to the rest of the team, and just letting them specify the Working Copy of the rewpository.
PS - It is also best not to interfere with the package structure in your SVN folder, and let EA take care of the same
I've a very complex solution in c# containing about 20 projects, each of them control a device since it is a driver.
In many cases those projects use similar structures/code (for example everyone as a connect method, a retrive data method and so on).
Is there a tool to analyze the code and create a general "Skeleton" that can be reused?
You can easily create a project template from an existing project from the File>Export Template menu. The process is described in How To: Create Project Templates.
There is no tool that can decide what to include in a skeleton project, as this depends on knowledge of what each project actually does, which parts that can be generalized and which have to be project specific.
You can use duplicate analysis in Visual Studio or Resharper to find repeated code, but this won't tell you what should be in a template and what shouldn't.
What you can do, is:
Extract common functionality in a separate project that all device projects will reference
Create a template from one of the device projects.
Use template parameters to customize the resulting template.
Step #1 will result in a much simpler template, that is easier to customize
I have an idea to create some sort of extended Immediate Window VS plugin. I've noticed that when I want to test something (like new Regex or DB reqest) I tend to create new console app for this. The idea is to create project that is not included in solution and references current project and has all using directives from current file. So I'll have all advantages of code editor: usings (no full class names), syntax highliting, IntelliSense, multiline commands, other plugins (R#/CR).
Is this possible?
Option A: Write those in a test-project added to your solution
Option B: Create a console application added to your solution
Create a build-script that only builds the projects you want to give to your customers.
To gain some ideas: look at http://mvcstarter.codeplex.com/ (point 9)