Esempio n. 1
0
        public PlaneForm(ISharedManager sm, IPlaneFormManager pfm, string title, AddressPlane sourcePlane = null)
        {
            sharedManager    = sm;
            planeFormManager = pfm;

            InitializeComponent();
            Text = title;

            if (sourcePlane != null)
            {
                XMinUpDown.Value         = sourcePlane.XMin;
                XMaxUpDown.Value         = sourcePlane.XMax;
                YMinUpDown.Value         = sourcePlane.YMin;
                YMaxUpDown.Value         = sourcePlane.YMax;
                DefaultValueUpDown.Value = sourcePlane.DefaultValue;
                DescriptionTextBox.Text  = sourcePlane.Description;
            }

            StructuresGridView.AutoGenerateColumns = false;
            XAddressesGridView.AutoGenerateColumns = false;
            YAddressesGridView.AutoGenerateColumns = false;


            StructuresGridView.DataSource = planeFormManager.GetStructureSource();
            XAddressesGridView.DataSource = planeFormManager.GetXAddressSource();
            YAddressesGridView.DataSource = planeFormManager.GetYAddressSource();
        }
        public ObjectFormManager(ISharedManager sm, ObjectBlock o = null)
        {
            observers     = new List <IStructureObserver <ObjectBlock> >();
            oldBlock      = o;
            sharedManager = sm;
            xAddresses    = new BindingList <IntegerAddress>();
            yAddresses    = new BindingList <IntegerAddress>();
            xPending      = false;

            if (o != null)
            {
                if (o.Information == null)
                {
                    info = null;
                }
                else
                {
                    info = (InformationAddress)o.Information.Clone();
                }
                foreach (var x in o.XAddresses)
                {
                    xAddresses.Add((IntegerAddress)x.Clone());
                }
                foreach (var y in o.YAddresses)
                {
                    yAddresses.Add((IntegerAddress)y.Clone());
                }
            }
        }
Esempio n. 3
0
        public DatabaseSettingsForm(ISharedManager sm, IDatabaseSettingsFormManager setm, DatabaseSettings ds)
        {
            InitializeComponent();

            sharedManager   = sm;
            settingsManager = setm;

            EndAddressTextBox.Text         = ds.EndAddress.ToString("X");
            EndValueUpDown.Value           = ds.EndValue;
            PopulationUpDown.Value         = ds.Population;
            StagnantGenerationUpDown.Value = ds.StagnantGeneration;
            TimeoutUpDown.Value            = ds.Timeout;
            StagnantTimeoutUpDown.Value    = ds.StagnantTimeout;
            ReleaseCheckBox.Checked        = ds.ReleaseButtons;

            CategoryColorGridView.AutoGenerateColumns = false;
            CategoryColorGridView.DataSource          = settingsManager.GetCategoryColors();

            ButtonsDataGridView.AutoGenerateColumns = false;
            ButtonsDataGridView.DataSource          = settingsManager.UpdateButtons();

            var validButtons = settingsManager.GetValidButtons();

            foreach (var s in validButtons)
            {
                ButtonNamesComboBox.Items.Add(s);
            }
        }
Esempio n. 4
0
        public UserForm(IUserManager um, ISharedManager sm)
        {
            userManager   = um;
            sharedManager = sm;
            login         = true;

            InitializeComponent();
        }
Esempio n. 5
0
        public RegionFormManager(ISharedManager sm, AddressRegion or = null)
        {
            sharedManager = sm;
            oldRegion     = or;
            observers     = new List <IStructureObserver <AddressRegion> >();

            structures = new BindingList <MemStructObject>();
            if (or != null)
            {
                foreach (var o in or.Structures)
                {
                    structures.Add((MemStructObject)o.Clone());
                }
            }
        }
        public IntegerAddressForm(IIntFormManager ifm, ISharedManager sm, string title = "Integer Address", IntegerAddress ia = null)
        {
            intManager    = ifm;
            sharedManager = sm;

            InitializeComponent();
            Text = title;

            if (ia != null)
            {
                AddressTextBox.Text              = ia.Address.ToString("X");
                DescriptionTextBox.Text          = ia.Description;
                OffsetUpDown.Value               = ia.Offset;
                MultiplicationFactorUpDown.Value = ia.Multiply;
            }
        }
Esempio n. 7
0
        public RegionForm(ISharedManager sm, IRegionFormManager rm, string title, AddressRegion r = null)
        {
            sharedManager = sm;
            rManager      = rm;

            InitializeComponent();
            Text = title;
            StructuresGridView.AutoGenerateColumns = false;
            StructuresGridView.DataSource          = rManager.GetDataSource();

            if (r != null)
            {
                DescriptionTextBox.Text      = r.Description;
                StartAddressTextBox.Text     = r.StartAddress.ToString("X");
                EndAddressTextBox.Text       = r.EndAddress.ToString("X");
                AddressIncrementUpDown.Value = r.Increment;
            }
        }
Esempio n. 8
0
        public InformationAddressForm(IInfoFormManager im, ISharedManager sm, string title, InformationAddress ia = null)
        {
            infoManager   = im;
            sharedManager = sm;

            InitializeComponent();
            Text = title;

            ValueCategoryDataGrid.AutoGenerateColumns = false;
            ValueCategoryDataGrid.DataSource          = infoManager.UpdateValueCategories();

            if (ia != null)
            {
                AddressTextBox.Text      = ia.Address.ToString("X");
                DescriptionTextBox.Text  = ia.Description;
                DefaultValueUpDown.Value = ia.DefaultValue;
            }
        }
Esempio n. 9
0
        public ObjectForm(ISharedManager sm, IObjectFormManager ofm, string title, ObjectBlock o = null)
        {
            sharedManager = sm;
            objectManager = ofm;

            InitializeComponent();
            Text = title;
            XAddressesGridView.AutoGenerateColumns = false;
            YAddressesGridView.AutoGenerateColumns = false;

            XAddressesGridView.DataSource  = objectManager.GetXAddresses();
            YAddressesGridView.DataSource  = objectManager.GetYAddresses();
            InformationAddressTextBox.Text = objectManager.GetInfoString();

            if (o != null)
            {
                DescriptionTextBox.Text = o.Description;
                FixedValueUpDown.Value  = o.FixedValue;
            }
        }
        public PlaneFormManager(ISharedManager sm, AddressPlane op = null)
        {
            sharedManager = sm;
            observers     = new List <IStructureObserver <AddressPlane> >();
            oldPlane      = op;

            if (op != null)
            {
                structures = new BindingList <MemStructObject>(op.Structures.Select(o => (MemStructObject)(o.Clone())).ToList());
                xAddresses = new BindingList <IntegerAddress>(op.XCenterAddress.Select(o => (IntegerAddress)o.Clone()).ToList());
                yAddresses = new BindingList <IntegerAddress>(op.YCenterAddress.Select(o => (IntegerAddress)o.Clone()).ToList());
            }
            else
            {
                structures = new BindingList <MemStructObject>();
                xAddresses = new BindingList <IntegerAddress>();
                yAddresses = new BindingList <IntegerAddress>();
            }

            xPending = false;
        }
Esempio n. 11
0
        public XYRegionForm(ISharedManager sm, IXYFormManager xy, string title, XYRegion xyr = null)
        {
            sharedManager = sm;
            xyManager     = xy;

            InitializeComponent();
            Text = title;
            ValueCategoryDataGrid.DataSource = xyManager.UpdateValueCategories();

            if (xyr != null)
            {
                AddressTextBox.Text     = xyr.StartAddress.ToString("X");
                DescriptionTextBox.Text = xyr.Description;

                WidthUpDown.Value        = xyr.Width;
                HeightUpDown.Value       = xyr.Height;
                RowOffsetUpDown.Value    = xyr.RowOffset;
                XStartUpDown.Value       = xyr.XOffset;
                YStartUpDown.Value       = xyr.YOffset;
                DefaultValueUpDown.Value = xyr.DefaultValue;
            }
        }