Click here to Skip to main content
15,895,777 members
Articles / Programming Languages / C#

Grandiose Projects 3. Compatibility with Simulink

Rate me:
Please Sign up or sign in to vote.
4.27/5 (11 votes)
8 Feb 2010CPOL23 min read 47.8K   5.9K   38  
Import of Simulink files
using System;
using System.Collections.Generic;
using System.Text;


using CategoryTheory;
using DiagramUI;
using DiagramUI.Labels;
using Diagram.UI.Interfaces.Labels;
using DiagramUI.Interfaces;

namespace Diagram.UI.Interfaces
{
    /// <summary>
    /// The factory of objects arrows and controls
    /// </summary>
    public interface IUIFactory
    {
        /// <summary>
        /// Creates object the corresponds to button
        /// </summary>
        /// <param name="button">The button</param>
        /// <returns>Created object</returns>
        ICategoryObject CreateObject(IPaletteButton button);

        /// <summary>
        /// Creates an arrow the corresponds to button
        /// </summary>
        /// <param name="button">The button</param>
        /// <returns>Created arrow</returns>
        ICategoryArrow CreateArrow(IPaletteButton button);

        /// <summary>
        /// Creates a form for component properties editor
        /// </summary>
        /// <param name="comp">The component</param>
        /// <returns>The result form</returns>
        object CreateForm(INamedComponent comp);

        /// <summary>
        /// Shows error
        /// </summary>
        /// <param name="e">The exception of the error</param>
        void ShowError(Exception e);

        /// <summary>
        /// Creates arrow label
        /// </summary>
        /// <param name="button">Corresponding button</param>
        /// <param name="arrow">Corresponding arrow</param>
        /// <param name="source">Soource label</param>
        /// <param name="target">Target label</param>
        /// <returns>The arrow label</returns>
        IArrowLabelUI CreateArrowLabel(IPaletteButton button, ICategoryArrow arrow, IObjectLabel source, IObjectLabel target);

        /// <summary>
        /// Creates object label
        /// </summary>
        /// <param name="button">Corresponding button</param>
        /// <returns>The object label</returns>
        IObjectLabelUI CreateObjectLabel(IPaletteButton button);


        /// <summary>
        /// Gets button from category
        /// </summary>
        /// <param name="category">The category</param>
        /// <returns>The button</returns>
        IPaletteButton GetObjectButton(ICategory category);

        /// <summary>
        /// Gets button from category
        /// </summary>
        /// <param name="category">The category</param>
        /// <returns>The button</returns>
        IPaletteButton GetArrowButton(ICategory category);


        /// <summary>
        /// Tools
        /// </summary>
        IToolsDiagram Tools
        {
            set;
        }

        /// <summary>
        /// Gets button from object
        /// </summary>
        /// <param name="obj">The object</param>
        /// <returns>The button</returns>
        IPaletteButton GetObjectButton(ICategoryObject obj);

        /// <summary>
        /// Gets button from arrow
        /// </summary>
        /// <param name="arrow">The arrow</param>
        /// <returns>The arrow</returns>
        IPaletteButton GetArrowButton(ICategoryArrow arrow);

        /// <summary>
        /// Checks order of desktop and throws exception if order is illegal
        /// </summary>
        /// <param name="desktop">The desktop</param>
        void CheckOrder(IDesktop desktop);


        /// <summary>
        /// Creates object label from object
        /// </summary>
        /// <param name="obj">The object</param>
        /// <returns>The label</returns>
        IObjectLabelUI CreateLabel(ICategoryObject obj);

        /// <summary>
        /// Crerates arrow label from arrow
        /// </summary>
        /// <param name="arr">The arrow</param>
        /// <returns>The label</returns>
        IArrowLabelUI CreateLabel(ICategoryArrow arr);
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Russian Federation Russian Federation
Ph. D. Petr Ivankov worked as scientific researcher at Russian Mission Control Centre since 1978 up to 2000. Now he is engaged by Aviation training simulators http://dinamika-avia.com/ . His additional interests are:

1) Noncommutative geometry

http://front.math.ucdavis.edu/author/P.Ivankov

2) Literary work (Russian only)

http://zhurnal.lib.ru/editors/3/3d_m/

3) Scientific articles
http://arxiv.org/find/all/1/au:+Ivankov_Petr/0/1/0/all/0/1

Comments and Discussions