示例#1
0
        public GraphViewModel(IInspectorTool inspectorTool)
        {
            DisplayName = "[New Graph]";

            _elements    = new BindableCollection <ElementViewModel>();
            _connections = new BindableCollection <ConnectionViewModel>();

            _inspectorTool = inspectorTool;

            var element1 = AddElement <ImageSource>(100, 50);

            element1.Bitmap = BitmapUtility.CreateFromBytes(DesignTimeImages.Desert);

            var element2 = AddElement <ColorInput>(100, 300);

            element2.Color = Colors.Green;

            var element3 = AddElement <Add>(400, 250);


            Connections.Add(new ConnectionViewModel(
                                element1.OutputConnector,
                                element3.InputConnectors[0]));

            Connections.Add(new ConnectionViewModel(
                                element2.OutputConnector,
                                element3.InputConnectors[1]));

            element1.IsSelected = true;
        }
示例#2
0
 public StartupPackage(IOutput output, IInspectorTool inspectorTool, IStatusBarDataModelService statusBarService, IToolboxService toolboxService)
 {
     _output           = output;
     _inspectorTool    = inspectorTool;
     _statusBarService = statusBarService;
     _toolboxService   = toolboxService;
 }
示例#3
0
        public SheetDocumentViewModel(Sheet sheet,
                                      IInspectorTool inspectorTool,
                                      IAPlayAwareShell shell,
                                      Action <SheetDocumentViewModel> onOpenedChanged,
                                      Client client)
        {
            _sheet         = sheet;
            _inspectorTool = inspectorTool;
            _shell         = shell;

            _onOpenedChanged = onOpenedChanged;
            _client          = client;

            _name = _sheet.Name;


            SheetId     = _sheet.Id;
            DisplayName = _name;

            _symbolVms   = new BindableCollection <SymbolBaseViewModel>();
            _connections = new BindableCollection <ConnectionViewModel>();

            foreach (var blockSymbol in _sheet.BlockSymbols)
            {
                _symbolVms.Add(new BlockViewModel(blockSymbol, _client, _inspectorTool));
            }

            foreach (var connector in _sheet.Connectors)
            {
                _symbolVms.Add(new ConnectorViewModel(connector, client, _inspectorTool));
            }

            foreach (var connection in _sheet.Connections)
            {
                _connections.Add(new ConnectionViewModel(connection, _client, _inspectorTool));
            }


            _sheet.NameChangeEventHandler += _sheet_NameChangeEventHandler;

            _sheet.BlockSymbolsAddEventHandler      += OnBlockSymbolsAddEventHandler;
            _sheet.BlockSymbolsInsertAtEventHandler += OnBlockSymbolsInsertAtEventHandler;
            _sheet.BlockSymbolsRemoveAtEventHandler += OnBlockSymbolsRemoveAtEventHandler;

            _sheet.ConnectorsAddEventHandler      += OnConnectorAddEventHandler;
            _sheet.ConnectorsInsertAtEventHandler += OnConnectorInsertAtEventHandler;
            _sheet.ConnectorsRemoveAtEventHandler += OnConnectorRemoveAtEventHandler;

            _sheet.ConnectionsAddEventHandler      += OnConnectionsAddEventHandler;
            _sheet.ConnectionsRemoveEventHandler   += OnConnectionsRemoveEventHandler;
            _sheet.ConnectionsRemoveAtEventHandler += OnConnectionsRemoveAtEventHandler;
            _sheet.ConnectionsInsertAtEventHandler += OnConnectionsInsertAtEventHandler;
        }
示例#4
0
      public ConnectionViewModel(Connection connection, Client client, IInspectorTool inspectorTool)
      {
          _connection  = connection;
          _client      = client;
          Id           = connection.Id;
          FromPosition = new Point(_connection.FromPosition.X, _connection.FromPosition.Y);
          ToPosition   = new Point(_connection.ToPosition.X, _connection.ToPosition.Y);

          //Register for changes triggerd by the model.
          _connection.FromPositionChangeEventHandler += ConnectionOnFromPositionChangeEventHandler;
          _connection.ToPositionChangeEventHandler   += ConnectionOnToPositionChangeEventHandler;
      }
示例#5
0
        public BlockViewModel(BlockSymbol blockSymbol, Client client, IInspectorTool inspectorTool)
        {
            Id = blockSymbol.Id;

            _blockSymbol   = blockSymbol;
            _client        = client;
            _inspectorTool = inspectorTool;

            _x = _blockSymbol.PositionX;
            _y = _blockSymbol.PositionY;

            _blockSymbol.PositionXChangeEventHandler += x => X = x;
            _blockSymbol.PositionYChangeEventHandler += y => Y = y;
        }
        public ConnectorViewModel(Connector connector, Client client, IInspectorTool inspectorTool) : this()
        {
            _connector     = connector;
            _client        = client;
            _inspectorTool = inspectorTool;

            Id = _connector.Id;

            _x = _connector.PositionX;
            _y = _connector.PositionY;

            _connector.PositionXChangeEventHandler += x => X = x;
            _connector.PositionYChangeEventHandler += y => Y = y;
        }
示例#7
0
        public SheetTreeViewModel(IAPlayAwareShell shell, IInspectorTool inspectorTool)
        {
            _shell         = shell;
            _inspectorTool = inspectorTool;

            DisplayName = "Sheet Tree";
            Sheets      = new BindableCollection <SheetDocumentViewModel>();

            _shell.ProjectChanged += OnProjectChanged;

            if (shell.Project != null)
            {
                if (shell.Project.SheetManager.Sheets != null)
                {
                    Sheets.AddRange(shell.Project.SheetManager.Sheets.Select(sheet => new SheetDocumentViewModel(sheet,
                                                                                                                 inspectorTool, shell, OnOpenedChanged, _shell.Client)));
                }
            }
        }
示例#8
0
	    public Module(IOutput output, IInspectorTool inspectorTool)
        {
            _output = output;
            _inspectorTool = inspectorTool;
        }
示例#9
0
文件: Module.cs 项目: Tristyn/gemini
 public Module(IInspectorTool inspectorTool)
 {
     _inspectorTool = inspectorTool;
 }
示例#10
0
 public Module(IOutput output, IInspectorTool inspectorTool)
 {
     Output         = output;
     _inspectorTool = inspectorTool;
 }
示例#11
0
文件: Module.cs 项目: gmich/Gem
 public Module(IInspectorTool inspectorTool)
 {
     this.inspectorTool = inspectorTool;
 }
示例#12
0
 public Module(IInspectorTool inspectorTool)
 {
     _inspectorTool = inspectorTool;
 }
示例#13
0
 public GraphViewModel(string title)
 {
     Title          = title;
     _inspectorTool = Locator.Current.GetService <IInspectorTool>();
 }
示例#14
0
 public Module(IOutput output, IInspectorTool inspectorTool, LoggerFacory logger)
 {
     _output            = output;
     _inspectorTool     = inspectorTool;
     LogManager.Adapter = logger;
 }
示例#15
0
 public Module(IOutput output, IInspectorTool inspectorTool)
 {
     _output = output;
 }