コード例 #1
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        public TestImGuiScreenView(Screen screen) : base(screen)
        {
            TestImGuiMenu = new TestImGuiMenu();

            // Make a button
            // ReSharper disable once ObjectCreationAsStatement
            for (var i = 0; i < 5000; i++)
            {
                Boxes.Add(new ImageButton(WobbleAssets.WhiteBox, (sender, args) => Logger.Important("CLICKED", LogType.Runtime, false))
                {
                    Parent    = Container,
                    Alignment = Alignment.MidCenter,
                    Size      = new ScalableVector2(100, 100),
                    Tint      = Color.Crimson,
                });
            }

            // ReSharper disable once ObjectCreationAsStatement
            var box2 = new Sprite()
            {
                Parent    = Container,
                Alignment = Alignment.TopLeft,
                Size      = new ScalableVector2(75, 75),
                Position  = new ScalableVector2(0, 400),
                Tint      = Color.Red,
                Rotation  = 60
            };

            box2.MoveToX(1200, Easing.OutQuint, 4000);
        }
コード例 #2
0
 /// <summary>
 /// Constructs a constraint that will enforce that the given <paramref name="squares"/> are
 /// magic squares based on the rows, columns, and, optionally, the diagonals.
 /// </summary>
 /// <param name="possibleValues">
 /// The possible values that can be in the magic squares.
 /// </param>
 /// <param name="squares">
 /// The locations of the magic squares.
 /// </param>
 /// <param name="includeDiagonals">
 /// If true, values along the diagonals of the square must also sum to the magic number.
 /// </param>
 /// <exception cref="ArgumentException">
 /// If the any of the given <paramref name="squares"/>' sizes are not compatible with the
 /// length of <paramref name="possibleValues"/>.
 /// </exception>
 public MagicSquaresConstraint(ReadOnlySpan <int> possibleValues, IEnumerable <Box> squares, bool includeDiagonals = true)
 {
     _size             = possibleValues.Length;
     _magicSquares     = squares.ToArray();
     _squareSize       = Boxes.IntSquareRoot(_size);
     _includeDiagonals = includeDiagonals;
     if (_magicSquares.Any(
             b =>
             b.TopLeft.Row < 0 || b.TopLeft.Column < 0 ||
             b.TopLeft.Row + b.Size > _size || b.TopLeft.Column + b.Size > _size ||
             b.Size != _squareSize))
     {
         throw new ArgumentException(
                   $"Based on the {nameof(possibleValues)}, {nameof(squares)} must fit in a puzzle of size {_size} and have size {_squareSize}.");
     }
     _allPossibleValues = new BitVector();
     for (int i = 0; i < possibleValues.Length; ++i)
     {
         if (_allPossibleValues.IsBitSet(possibleValues[i]))
         {
             throw new ArgumentException("Values must be unique.");
         }
         _allPossibleValues.SetBit(possibleValues[i]);
     }
     _possibleSets = MagicSquares.ComputeSets(possibleValues, _squareSize, _allPossibleValues);
 }
コード例 #3
0
ファイル: Yatzy.cs プロジェクト: Castux/yahtzee
    public Yatzy()
    {
        Boxes = new Boxes(new List<string>
        {
            "ones",
            "twos",
            "threes",
            "fours",
            "fives",
            "sixes",
            "one pair",
            "two pairs",
            "three of kind",
            "four of kind",
            "small straight",
            "large straight",
            "full house",
            "chance",
            "yatzy"
        });

        UpperBonusThreshold = 63;
        UpperBonus = 50;
        NumPhases = 3;
    }
コード例 #4
0
        //private void ListUnboxedSpecimens(int colId)
        //{
        //    SpecimenManagerDa da = new SpecimenManagerDa();
        //    DataTable dt = da.GetUnboxedSpecimensByCollectionId(colId);
        //    this.unboxedSpecList.DataSource = dt.DefaultView;
        //    this.unboxedSpecList.DataBind();
        //}

        private void BindOriginSelectBoxes()
        {
            if (QueryBoxId > 0)
            {
                SpecimenManagerDa da             = new SpecimenManagerDa();
                DataSet           resultsDataSet = da.GetBoxAndAncestors(QueryBoxId);

                SpecimenBox box = new SpecimenBox();
                box.Get(QueryBoxId);

                DataTable boxesDT = resultsDataSet.Tables[0];
                Boxes.DataSource = boxesDT;
                Boxes.DataBind();
                Boxes.Value = box[SpecimenBox.BoxId].ToString();

                DataTable containersDT = resultsDataSet.Tables[1];
                Containers.DataSource = containersDT;
                Containers.DataBind();
                Containers.Value = boxesDT.Rows[0][SpecimenBox.ContainerId].ToString();

                DataTable storagesDT = resultsDataSet.Tables[2];
                Storages.DataSource = storagesDT;
                Storages.DataBind();
                Storages.Value = containersDT.Rows[0][SpecimenContainer.StorageId].ToString();

                string siteId = resultsDataSet.Tables[3].Rows[0][SpecimenSite.SiteId].ToString();
                Sites.Value = siteId;
            }
        }
コード例 #5
0
        // Removes this box from the body and broadphase. Forces the body
        // to recompute its mass if the body is dynamic. Frees the memory
        // pointed to by the box pointer.
        public void RemoveBox(Box box)
        {
            Assert(box != null);
            Assert(box.body == this);

            bool found = Boxes.Remove(box);

            // This shape was not connected to this body.
            Assert(found);

            // Remove all contacts associated with this shape
            foreach (var edge in ContactList)
            {
                ContactConstraint contact = edge.constraint;

                Box A = contact.A;
                Box B = contact.B;

                if (box == A || box == B)
                {
                    Scene.ContactManager.RemoveContact(contact);
                }
            }

            Scene.ContactManager.Broadphase.RemoveBox(box);

            CalculateMassData();

            // Scene.Heap.Free((void)box);
        }
コード例 #6
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:
                var box = Boxes[indexPath.Row];
                Boxes.Remove(box);
                tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

                var items = itemDAO.getAllItemInBox(box.Id);

                foreach (var i in items)
                {
                    i.Container = 0;
                    itemDAO.updateItem(i);
                }
                boxDAO.deleteBox(box);

                break;

            case UITableViewCellEditingStyle.None:
                break;

            default:
                break;
            }
        }
コード例 #7
0
 /// <inheritdoc/>
 public bool TryInitFor(IReadOnlyPuzzleWithMutablePossibleValues puzzle)
 {
     _boxSize = Boxes.IntSquareRoot(puzzle.Size);
     _puzzle  = puzzle;
     _helper  = new UniqueInXHelper(puzzle);
     return(true);
 }
コード例 #8
0
ファイル: ShoppingCart.cs プロジェクト: Mezaru/LimeBox
 static public void AddToCart(Boxes box)
 {
     if (!ExistInList(box.Id))
     {
         cart.Add(box);
     }
 }
コード例 #9
0
        public void SelectBoxRandomly(Player player)
        {
            var result = _random.Next(0, Boxes.Count);

            player.ChosenBox = Boxes[result];
            Boxes.RemoveAt(result);
        }
コード例 #10
0
        private void Start()
        {
            this.scoreText = GameObject.Find("Score").GetComponent <Text>();
            this.livesText = GameObject.Find("Lives").GetComponent <Text>();

            this.hint = GameObject.Find("Hint");
            this.ball = GameObject.Find("Ball").GetComponent <Ball>();

            this.gameManager = GameObject.Find("_GameManager").GetComponent <GameManager>();
            Boxes boxes = GameObject.Find("Boxes").GetComponent <Boxes>();

            if (this.gameManager.savedData != null)
            {
                this.Lifes = this.gameManager.savedData.lifes;
                this.Score = this.gameManager.savedData.score;
                boxes.CreateBoardFromSave(gameManager.savedData);
            }
            else
            {
                this.Lifes = 3;
                this.Score = 0;
                boxes.CreateBoard();
            }

            this.gameManager.ClearSavedData();
        }
コード例 #11
0
ファイル: Service.cs プロジェクト: boqnd/Sokoban
 public void SetLevel2()
 {
     player     = new Player("1 0");
     field      = new Field(3, 4);
     obsticales = new Obsticales(new List <string>()
     {
         "2 0", "0 3", "1 3"
     });
     boxes = new Boxes
             (
         new List <string>()
     {
         "1 1", "1 2"
     },
         new List <string>()
     {
         "2 2", "2 3"
     }
             );
     _display = new Display();
     _display.DisplayLevel(currLevel);
     _display.DisplayField(field, player, obsticales, boxes);
     Play();
     SetLevel3();
 }
コード例 #12
0
ファイル: Service.cs プロジェクト: boqnd/Sokoban
 public void SetLevel3()
 {
     player     = new Player("3 4");
     field      = new Field(6, 8);
     obsticales = new Obsticales(new List <string>()
     {
         "0 0", "1 0", "2 0", "3 0", "2 1", "3 1", "2 3", "3 3", "2 5", "3 5", "2 7", "3 7", "1 7", "0 7", "0 6", "0 5", "5 3", "5 4"
     });
     boxes = new Boxes
             (
         new List <string>()
     {
         "1 2", "2 2", "1 5"
     },
         new List <string>()
     {
         "4 1", "4 3", "4 5"
     }
             );
     _display = new Display();
     _display.DisplayLevel(currLevel);
     _display.DisplayField(field, player, obsticales, boxes);
     Play();
     _display.Congrats();
 }
コード例 #13
0
        public void TruckTest()
        {
            var t1 = new Truck();
            var t2 = new Truck();

            t1.size.Height = 2;
            t1.size.Width = 2;

            t2.size.Height = 3;
            t2.size.Width = 3;

            ComparisonResult result = _compare.Compare(t1, t2);
            Assert.IsFalse(result.AreEqual);

            var b1 = new Boxes();
            var b2 = new Boxes();

            b1.sizes = new List<Size>();
            Size s1 = new Size();
            s1.Height = 2;
            s1.Width = 2;
            b1.sizes.Add(s1);

            b2.sizes = new List<Size>();
            Size s2 = new Size();
            s2.Height = 3;
            s2.Width = 3;
            b1.sizes.Add(s2);

            result = _compare.Compare(b1, b2);
            Assert.IsFalse(result.AreEqual);
        }
コード例 #14
0
ファイル: Service.cs プロジェクト: boqnd/Sokoban
        public void StartUp()
        {
            player     = new Player("0 0");
            field      = new Field(5, 5);
            obsticales = new Obsticales(new List <string>()
            {
                "0 3", "1 3", "2 3", "2 2"
            });
            boxes = new Boxes
                    (
                new List <string>()
            {
                "2 0", "2 1"
            },
                new List <string>()
            {
                "4 0", "3 3"
            }
                    );
            _display = new Display();
            _display.DisplayLevel(currLevel);
            _display.DisplayField(field, player, obsticales, boxes);

            Play();
            SetLevel1();
        }
コード例 #15
0
 public NetworkStack(Helper iHelper, System.Net.IPAddress aIpAddress)
 {
     iIpAddress             = aIpAddress;
     iEventServerUpnp       = new EventServerUpnp();
     iSsdpListenerMulticast = new SsdpListenerMulticast();
     iBoxes = new Boxes(iHelper, iEventServerUpnp, iSsdpListenerMulticast);
 }
コード例 #16
0
        public void TruckTest()
        {
            var t1 = new Truck();
            var t2 = new Truck();

            t1.size.Height = 2;
            t1.size.Width  = 2;

            t2.size.Height = 3;
            t2.size.Width  = 3;

            ComparisonResult result = _compare.Compare(t1, t2);

            Assert.IsFalse(result.AreEqual);

            var b1 = new Boxes();
            var b2 = new Boxes();

            b1.sizes = new List <Size>();
            Size s1 = new Size();

            s1.Height = 2;
            s1.Width  = 2;
            b1.sizes.Add(s1);

            b2.sizes = new List <Size>();
            Size s2 = new Size();

            s2.Height = 3;
            s2.Width  = 3;
            b1.sizes.Add(s2);

            result = _compare.Compare(b1, b2);
            Assert.IsFalse(result.AreEqual);
        }
コード例 #17
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            // Graphics3DControl
            graphCtrl.DrawingContainer = this;
            // list of packs
            ComboBoxHelpers.FillCombo(Boxes.ToArray(), cbInnerBox, null != _packProperties ? _packProperties.Box : Boxes[0]);
            // arrangement
            if (null != _packProperties)
            {
                cbDir.SelectedIndex          = (int)(_packProperties.BoxOrientation);
                Arrangement                  = _packProperties.Arrangement;
                Wrapper                      = _packProperties.Wrap;
                uCtrlOuterDimensions.Checked = _packProperties.HasForcedOuterDimensions;
                OuterDimensions              = _packProperties.OuterDimensions;
            }
            else
            {
                cbDir.SelectedIndex = 5; // HalfAxis.HAxis.AXIS_Z_P
                Arrangement         = new PackArrangement(3, 2, 1);
                Wrapper             = new WrapperPolyethilene(0.1, 0.010, Color.LightGray, true);

                uCtrlThickness.Value = UnitsManager.ConvertLengthFrom(0.1, UnitsManager.UnitSystem.UNIT_METRIC1);
                uCtrlHeight.Value    = UnitsManager.ConvertLengthFrom(40, UnitsManager.UnitSystem.UNIT_METRIC1);
            }
            // set StrapperSet
            ctrlStrapperSet.StrapperSet = StrapperSet;

            // disable Ok button
            UpdateStatus(string.Empty);
        }
コード例 #18
0
 /// <summary>
 /// Creates a new PackProperties object
 /// </summary>
 public void CreateNewPackUI()
 {
     using (FormNewPack form = new FormNewPack(this, null)
     {
         Boxes = Boxes.ToList()
     })
     {
         if (DialogResult.OK == form.ShowDialog())
         {
             PackProperties packProperties = CreateNewPack(
                 form.ItemName, form.ItemDescription
                 , form.SelectedPackable
                 , form.Arrangement
                 , form.BoxOrientation, form.RevSolidLayout
                 , form.Wrapper
                 , form.Tray);
             if (form.HasForcedOuterDimensions)
             {
                 packProperties.ForceOuterDimensions(form.OuterDimensions);
             }
             packProperties.StrapperSet = form.StrapperSet;
             packProperties.Bulge       = form.Bulge;
         }
     }
 }
コード例 #19
0
        public void MergeSelectedBoxes(IEnumerable <TessBoxControl> selectedBoxes)
        {
            var bounds = Rect.Empty;
            var remove = new List <TessBoxControl>();

            foreach (var box in selectedBoxes)
            {
                var boxBounds = new Rect(box.Left, box.Top, box.Width, box.Height);
                if (bounds.IsEmpty)
                {
                    bounds = boxBounds;
                }
                else
                {
                    bounds.Union(boxBounds);
                }
                remove.Add(box);
            }
            var keep = remove[remove.Count - 1];

            remove.RemoveAt(remove.Count - 1);
            foreach (var box in remove)
            {
                Boxes.Remove(box);
            }

            keep.Left   = bounds.Left;
            keep.Top    = bounds.Top;
            keep.Width  = bounds.Width;
            keep.Height = bounds.Height;
        }
コード例 #20
0
 public static void SetAutoShowToolTipWhenObscured(FrameworkElement element, bool value)
 {
     if (element == null)
     {
         throw new ArgumentNullException(nameof(element));
     }
     element.SetValue(AutoShowToolTipWhenObscuredProperty, Boxes.Box(value));
 }
コード例 #21
0
ファイル: ViewModel.cs プロジェクト: Randow/logistics
 public void InitializeBoxCollection()
 {
     Boxes.Add(new Box("21877/8 паллет 1", 3.17, 1.82, 1.59, 770, 1, false));
     Boxes.Add(new Box("21877/8 паллет 2", 2.27, 2.07, 1.45, 900, 1, false));
     Boxes.Add(new Box("21877/8 паллет 3", 2.67, 2.17, 1.25, 650, 1, false));
     Boxes.Add(new Box("21877/8 паллет 4", 3.2, 0.52, 0.71, 297, 1, false));
     OnPropertyChanged("Boxex");
 }
コード例 #22
0
        private void ItemIsBought(Boxes item)
        {
            var box = FindBoxById(item.Id);

            box.Bought = true;

            context.SaveChanges();
        }
コード例 #23
0
 public void PopulateBoxes()
 {
     Boxes.Add(new Box());
     Boxes.Add(new Box());
     Boxes.Add(new Box());
     Boxes.Add(new Box());
     Boxes.Add(new Box());
 }
コード例 #24
0
 public void AddBox(Box box)
 {
     if (!box.IsValid)
     {
         throw new GraphicsException("Box is invalid and cannot be drawn!");
     }
     Boxes.Add(box);
 }
コード例 #25
0
ファイル: Container.cs プロジェクト: timickb/VegetableStorage
 public void AddBox(Box box)
 {
     if (TotalWeight + box.Weight > MaxWeight)
     {
         throw new BoxAddException();
     }
     Boxes.Add(box);
 }
コード例 #26
0
 public static void SetHasMinimizeButton(Window window, bool value)
 {
     if (window == null)
     {
         throw new ArgumentNullException(nameof(window));
     }
     window.SetValue(HasMinimizeButtonProperty, Boxes.Box(value));
 }
コード例 #27
0
        /// <summary>
        /// Genera una sezione di gioco.
        /// Di default genera i fences (confini visuali) e il plane.
        /// </summary>
        /// <param name="additionalElements">Numero di elementi scenici da aggiungere in modo casuale.</param>
        /// <param name="numberOfEnemies">Numero di nemici da generare in modo casuale</param>
        public Section(int additionalElements, int numberOfEnemies, float position)
        {
            emitters = new List <Vector3>();

            zPosition = position;

            ScenicElements = new ScenicElement[20 + additionalElements];
            //Plane
            ScenicElements[0] = new ScenicElement(0, Vector3.Zero, Vector3.Zero);
            //Fences
            ScenicElements[1] = new ScenicElement(1, new Vector3(9, 0, 12.5f), new Vector3(0, getRandomRotation(), 0));
            ScenicElements[2] = new ScenicElement(1, new Vector3(-9, 0, 12.5f), new Vector3(0, getRandomRotation(), 0));
            ScenicElements[3] = new ScenicElement(1, new Vector3(9, 0, 37.5f), new Vector3(0, getRandomRotation(), 0));
            ScenicElements[4] = new ScenicElement(1, new Vector3(-9, 0, 37.5f), new Vector3(0, getRandomRotation(), 0));
            //Trees
            ScenicElements[5]  = new ScenicElement(2, new Vector3(12, 0, 12.5f + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, -getTreeRotation(), 0));
            ScenicElements[6]  = new ScenicElement(2, new Vector3(-12, 0, 12.5f + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, getTreeRotation(), 0));
            ScenicElements[7]  = new ScenicElement(2, new Vector3(12, 0, 37.5f + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, -getTreeRotation(), 0));
            ScenicElements[8]  = new ScenicElement(2, new Vector3(-12, 0, 37.5f + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, getTreeRotation(), 0));
            ScenicElements[9]  = new ScenicElement(2, new Vector3(12, 0, 25 + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, -getTreeRotation(), 0));
            ScenicElements[10] = new ScenicElement(2, new Vector3(-12, 0, 25 + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, getTreeRotation(), 0));
            ScenicElements[11] = new ScenicElement(2, new Vector3(12, 0, 50 + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, -getTreeRotation(), 0));
            ScenicElements[12] = new ScenicElement(2, new Vector3(-12, 0, 50 + (UtilityClass.nextInt(-500, 500) / 100.0f)), new Vector3(0, getTreeRotation(), 0));
            //MOAR PLANES
            ScenicElements[13] = new ScenicElement(0, new Vector3(24, 0, 0), Vector3.Zero);
            ScenicElements[14] = new ScenicElement(0, new Vector3(-24, 0, 0), Vector3.Zero);
            ScenicElements[15] = new ScenicElement(0, new Vector3(24, 12, 0), new Vector3(0, 0, MathHelper.ToRadians(90)));
            ScenicElements[16] = new ScenicElement(0, new Vector3(-24, 12, 0), new Vector3(0, 0, MathHelper.ToRadians(270)));
            ScenicElements[17] = new ScenicElement(0, new Vector3(0, 24, 0), new Vector3(0, 0, MathHelper.ToRadians(180)));
            ScenicElements[18] = new ScenicElement(0, new Vector3(12, 24, 0), new Vector3(0, 0, MathHelper.ToRadians(180)));
            ScenicElements[19] = new ScenicElement(0, new Vector3(-12, 24, 0), new Vector3(0, 0, MathHelper.ToRadians(180)));

            Enemies = new Enemy[numberOfEnemies];
            for (int counter = 0; counter < numberOfEnemies; counter++)
            {
                if (UtilityClass.nextBoolean())
                {
                    Enemies[counter] = new Dog();
                }
                else
                {
                    Enemies[counter] = new Boxes();
                }
            }

            //PowerUps
            //DA GENERARE GIA' ORDINATI, PER EVITARE CICLI DI ORDINAMENTO
            //Aumentare il numero col tempo? Forse ne basta uno per section.
            PowerUps = new PowerUp[1];
            if (Utilities.UtilityClass.nextBoolean())
            {
                PowerUps[0] = new Boost();
            }
            else
            {
                PowerUps[0] = new Heart();
            }
        }
コード例 #28
0
ファイル: Drawer3D.cs プロジェクト: chengjingfeng/dwarfcorp
 public static void Cleanup()
 {
     Verticies   = new VertexPositionColor[MaxTriangles * 3];
     VertexCount = 0;
     Effect      = null;
     Camera      = null;
     Boxes.Clear();
     Segments.Clear();
 }
コード例 #29
0
        public void DeleteSelectedBoxes(IEnumerable <TessBoxControl> selectedBoxes)
        {
            var remove = new List <TessBoxControl>(selectedBoxes);

            foreach (var box in remove)
            {
                Boxes.Remove(box);
            }
        }
コード例 #30
0
 public static Boxes Boxes(this World world)
 {
     if (world.TryGet <Boxes>(out var module))
     {
         return(module);
     }
     world.Set(module = new Boxes());
     return(module);
 }
コード例 #31
0
    public void rePlay()
    {
        gamePause();

        Boxes.reset();
        transform.position = initpos;

        StartCoroutine(waitforDestory());
    }
コード例 #32
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            var headerSiteHeight = (double)values[0];
            var expandSiteHeight = (double)values[1];
            var scale            = (double)values[2];

            var result = headerSiteHeight + expandSiteHeight * scale;

            return(Boxes.Double(result));
        }
コード例 #33
0
ファイル: Form1.cs プロジェクト: jithuin/infogeezer
 private void Init()
 {
     this.SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.UserPaint|ControlStyles.OptimizedDoubleBuffer, true);
     //this.SetStyle(ControlStyles.OptimizedDoubleBuffer |
     // ControlStyles.AllPaintingInWmPaint |
     // ControlStyles.UserPaint |
     // ControlStyles.Opaque, true);
     boxes = new Boxes();
     boxes.Location = new Point(100, 100);
     this.Paint += new PaintEventHandler(boxes.OnPaint);
     timer = new System.Timers.Timer();
     timer.AutoReset = true;
     timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
     CheckForIllegalCrossThreadCalls = false;
     //prevVscroll = vScrollBar1.Value;
 }
コード例 #34
0
 public void Visit(Boxes box)
 {
     ArtefactList.Add("Autographs from " + box.Owner + " team");
 }
コード例 #35
0
ファイル: BoxesProxy.cs プロジェクト: Adamster/PatternsFun
 public BoxesProxy(List<Fan> fan, Boxes boxes)
 {
     _realFans = fan;
     _realBoxes = boxes;
 }
コード例 #36
0
ファイル: BoxesProxy.cs プロジェクト: Adamster/PatternsFun
 public BoxesProxy(Fan fan, Boxes boxes)
 {
     _realBoxes = boxes;
     _realFans.Add(fan);
 }
コード例 #37
0
ファイル: BoxesProxy.cs プロジェクト: Adamster/PatternsFun
 public BoxesProxy(Pilot pilot, Boxes boxes)
 {
     _realBoxes = boxes;
     _realPilot = pilot;
 }
コード例 #38
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BoxInfo"/> class.
 /// </summary>
 /// <param name="configurationHelper">The configuration helper.</param>
 /// <remarks>
 /// If this constructor is used no configuration file is loaded 
 /// and localization config files are loaded (deserealized and stored in
 /// cache) as needed (lazy loading).
 /// </remarks>
 public BoxInfo(Boxes.Serializer.Configuration.IHelper configurationHelper)
 {
     if (configurationHelper == null)
     {
         string message = "BoxInf17: Unable to get config for " + this.identifier;
         Debug.WriteLine(message);
         throw new ArgumentNullException(message);
     }
     this.box = configurationHelper;
 }
コード例 #39
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BoxInfo"/> class.
        /// </summary>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="defaultLocalization">The default localization.</param>
        /// <param name="localizations">The localizations.</param>
        /// <remarks>
        /// If this constructor is used no configuration file is loaded 
        /// and localization config files are loaded (deserealized and stored in
        /// cache) as needed (lazy loading) but only if specified 
        /// <c>localizations</c> does not satisfy some localePrefs.
        /// </remarks>
        public BoxInfo(
            Boxes.Serializer.Configuration.IHelper configurationHelper,
            Boxes.Serializer.Localization.IHelper defaultLocalization,
            Boxes.Serializer.Localization.IHelper[] localizations
            )
        {
            if (configurationHelper == null)
            {
                string message = "BoxInf18: Unable to get config for " + this.identifier;
                Debug.WriteLine(message);
                throw new ArgumentNullException(message);
            }
            this.box = configurationHelper;

            if (defaultLocalization == null)
            {
                string message = "BoxInf19: Unable to get default localization for " + this.identifier;
                Debug.WriteLine(message);
                throw new ArgumentNullException(message);
            }
            this.boxLocalizations.Add(defaultLanguageId, defaultLocalization);

            if (localizations.Length > 0)
            {
                foreach (Boxes.Serializer.Localization.IHelper localization in localizations)
                {
                    this.boxLocalizations.Add(localization.LocaleId, localization);
                }
            }
        }