Beispiel #1
0
        void CreateItem(ITopologyItem n, Point location)
        {
            if (n == null)
            {
                return;
            }

            UCTopologyItem top = new UCTopologyItem(n);

            top.Location = location;
            n.Tag        = top;
            top.RefreshInPlay(_InPlay);

            top.MouseDown += pictureBox1_MouseDown;
            top.MouseMove += pictureBox1_MouseMove;
            pItems.Controls.Add(top);

            n.OnProcess += Item_OnProcess;
            _List.Add(top);

            if (n is IDataInput)
            {
                IDataInput i = (IDataInput)n;
                _Inputs.Add(i);

                if (_InPlay)
                {
                    _Inputs.Stop();
                    _Inputs.Start();
                }
            }

            Select(top);
        }
Beispiel #2
0
        /// <summary>
        /// Compila el archivo
        /// </summary>
        /// <param name="inputs">Colección de entradas</param>
        /// <param name="pathForEnvironmentVariable">Ruta para variable de entorno</param>
        public void Compile(DataInputCollection inputs, string pathForEnvironmentVariable)
        {
            // Cargar topología
            if (Items != null)
            {
                foreach (TopologyItem item in Items.Values)
                {
                    if (item.Item is IDataInput)
                    {
                        inputs.Add((IDataInput)item.Item);
                    }
                }

                if (Relations != null)
                {
                    foreach (Relation rel in Relations)
                    {
                        if (rel.From == rel.To)
                        {
                            continue;
                        }

                        TopologyItem from, to;
                        if (Items.TryGetValue(rel.From, out from) && Items.TryGetValue(rel.To, out to) && from != null && to != null)
                        {
                            if (to.Item is IDataProcess)
                            {
                                from.Item.Process.Add((IDataProcess)to.Item);
                            }
                        }
                    }
                }

                // Si los remplazo en diseño, ahora mismo se cambiarian en real, tendria que runearse una copia, y no el de edición
                RemplaceVariables(inputs, Variables, null);
            }

            LasterHelper.SetEnvironmentPath(pathForEnvironmentVariable);
        }