예제 #1
0
        public BaseControl(IPresentableAlgorithm alg)
        {
            InitializeComponent();
            Algorithm = alg;
            _group.Text = alg.Name;
            SetTable();
            _group.CloseButtonClicked += (o, e) => FireCloseButtonClicked();

            Resize += ResizeTable;
            ResizeTable();

            Disposed += (o, e) => Algorithm.Dispose();
        }
예제 #2
0
파일: MainForm.cs 프로젝트: mgrman/DGCLib
        private BaseControl AddAlgoritmControl(IPresentableAlgorithm alg)
        {
            if (alg == null)
                return null;

            _algorithms.Add(alg);
            alg.RequestForceRedraw += RedrawRequested;

            var con = new BaseControl(alg);

            _flowAlg.Controls.Add(con);

            con.CloseButtonClicked += RemoveAlgorithmEvent;
            con.ValueChanged += RedrawRequested;

            return con;
        }