public override GridSquare GetNextSquare(Action action)
    {
        int newRow = Row, newCol = Col;

        switch (action)
        {
        case Action.Up:
            newRow -= 1;
            break;

        case Action.Down:
            newRow += 1;
            break;

        case Action.Left:
            newCol -= 1;
            break;

        case Action.Right:
            newCol += 1;
            break;

        default:
            throw new System.ArgumentException("Unsupported Action");
        }
        if (!ParentGrid.CoordsInRange(newRow, newCol))
        {
            return(this);
        }
        GridSquare newSquare = ParentGrid.GetSquareAt(newRow, newCol);

        return(newSquare == null ? this : newSquare.Walkable?newSquare : this);
    }
        public void FixMainGridCurrentRowIndexOnRefocus()
        {
            AddDataForSetList();
            CreateControllers(typeof(SetList));
            ParentGrid.Focus();
            Assert.AreEqual(1, View.SetMouseCursorToDefaultCount,
                            "SetMouseCursorToDefaultCount after focusing parent grid");
            Controller.Populate(); // Populate parent and main grids
            Assert.IsTrue(ParentGrid.Focused, "ParentGrid.Focused after Populate");
            Assert.AreEqual(2, View.SetMouseCursorToDefaultCount,
                            "SetMouseCursorToDefaultCount after Populate");
            MainGrid.Focus();
            Assert.AreEqual(3, View.SetMouseCursorToDefaultCount,
                            "SetMouseCursorToDefaultCount after focusing main grid");
            MainGridController.CreateAndGoToNewRow();
            int mainGridNewRowIndex = MainGrid.CurrentRowIndex;

            ParentGrid.Focus();
            // Simulate the problem that occurs when switching focus from the main grid to the
            // parent grid. If the main grid's current row is the new row before focusing the
            // parent grid, then, on focusing the parent grid, the new row is removed, so the
            // main grid's last existing row becomes its current row.
            MainGrid.MakeRowCurrent(mainGridNewRowIndex - 1);
            Assert.AreEqual(mainGridNewRowIndex - 1, MainGrid.CurrentRowIndex,
                            "Main grid current row index after focus switched back to parent grid");
            // Now test the fix. When focus is switched back to the main grid, we want to
            // restore currency to the new row.
            MainGrid.Focus();
            Assert.AreEqual(mainGridNewRowIndex, MainGrid.CurrentRowIndex,
                            "Main grid current row index after focus switched back to main grid");
            Assert.IsTrue(ParentGrid.Enabled,
                          "Parent grid enabled after focus switched back to main grid");
        }
Ejemplo n.º 3
0
        public override Rectangle GetLabelTextRect(Rectangle itemRect, PropertyEnumerator enumSelf)
        {
            Font     underlinedFont = new Font(Font, FontStyle.Underline);
            Graphics graphics       = ParentGrid.CreateGraphics();

            Size textSize = Win32Calls.GetTextExtent(graphics, DisplayName, underlinedFont);

            Rectangle labelColumnRect = GetLabelColumnRect(itemRect, enumSelf);

            labelColumnRect.Inflate(-ParentGrid.GlobalTextMargin, 0);
            Rectangle labelRect = labelColumnRect;

            if (textSize.Width <= labelColumnRect.Width)
            {
                labelRect.X     = labelColumnRect.Right - textSize.Width;
                labelRect.Width = textSize.Width;
            }
            else
            {
                labelRect.Width = labelColumnRect.Right - labelRect.Left;
            }

            graphics.Dispose();
            underlinedFont.Dispose();

            return(labelRect);
        }
Ejemplo n.º 4
0
 ///--------------------------------------------------------------------------------
 /// <summary>Raise the ElementClosed event on mouse leave.</summary>
 ///
 /// <param name="sender">The sender</param>
 /// <param name="e">Event args</param>
 ///--------------------------------------------------------------------------------
 void element_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (ParentGrid != null)
     {
         ParentGrid.RaiseElementClosed();
     }
 }
Ejemplo n.º 5
0
        // IWebPrehander

        public override bool ProcessRequest(HttpContext context)
        {
            if (base.ProcessRequest(context))
            {
                return(true);
            }
            ISource source = ParentGrid.Source;

            if (!ReadOnly && (ColumnName != String.Empty) && Session.IsActionLink(context, _checkID) && ParentGrid.DataLink.Active && !source.DataView.IsEmpty())
            {
                string rowIndex = context.Request.QueryString["RowIndex"];
                if (rowIndex != null)
                {
                    ParentGrid.MoveTo(Int32.Parse(rowIndex));
                    DAE.Client.DataField    field    = source.DataView.Fields[ColumnName];
                    DAE.Client.DataSetState oldState = source.DataView.State;
                    field.AsBoolean = !(field.HasValue() && field.AsBoolean);
                    if (oldState == DAE.Client.DataSetState.Browse)
                    {
                        try
                        {
                            source.DataView.Post();
                        }
                        catch
                        {
                            source.DataView.Cancel();
                            throw;
                        }
                    }
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 6
0
 ///--------------------------------------------------------------------------------
 /// <summary>Raise the ElementOpened event on mouse enter.</summary>
 ///
 /// <param name="sender">The sender</param>
 /// <param name="e">Event args</param>
 ///--------------------------------------------------------------------------------
 void element_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (ParentGrid != null)
     {
         ParentGrid.RaiseElementOpened();
     }
 }
Ejemplo n.º 7
0
 private void GridSplitWatch(MyCubeGrid parent, MyCubeGrid child)
 {
     GetParentGrid[child] = new ParentGrid {
         Parent = parent, Age = Tick
     };
     GetParentGrid.ApplyAdditionsAndModifications();
 }
Ejemplo n.º 8
0
        public override void OnMouseClick(object o, MouseEventArgs e)
        {
            switch (e.Button)
            {
            case MouseButtons.Left:
            {
                ItemGridCell cell = o as ItemGridCell;
                _newcell.ParentGrid = ParentGrid;
                _newcell.Row        = Row;
                _newcell.Colomn     = Colomn;
                ItemGridDataCell newCell = (ItemGridDataCell)_newcell.Copy();
                if (cell == this || cell == null)
                {
                    ParentGrid.AddCellAt(this.Row, newCell);
                }
                else
                {
                    ParentGrid.InsertCellAt(cell.Colomn, cell.Row, newCell);
                }

                newCell.StartEditing(o, e);
            }
            break;

            case MouseButtons.Right:
                break;
            }
        }
Ejemplo n.º 9
0
 public override void RunCommand(string cmd)
 {
     if (cmd == "Remove")
     {
         if (LastTile != null)
         {
             ParentGrid.SetTile(LastTile, X, Y);
         }
     }
 }
 private void CreateControllers(Type mainListType)
 {
     Controller         = new TestEditorController(mainListType, View, QueryHelper, Session);
     MainGridController = View.MainGridController =
         new TestMainGridController(MainGrid, Controller);
     MainGrid.SetController(MainGridController);
     if (Controller.IsParentGridToBeShown)
     {
         ParentGridController = new TestParentGridController(ParentGrid, Controller);
         ParentGrid.SetController(ParentGridController);
     }
 }
Ejemplo n.º 11
0
        public virtual Rectangle GetLabelTextRect(Rectangle itemRect, PropertyEnumerator enumSelf)
        {
            Rectangle labelRect = itemRect;

            Rectangle imgRect = GetImageRect(itemRect, enumSelf);

            if (imgRect != Rectangle.Empty)
            {
                labelRect.X = imgRect.Right;
            }
            else
            {
                Rectangle checkboxRect = GetManuallyDisableRect(itemRect, enumSelf);
                if (checkboxRect != Rectangle.Empty)
                {
                    labelRect.X = checkboxRect.Right;
                }
                else
                {
                    Rectangle signRect = GetSignRect(itemRect, enumSelf);
                    if (signRect != Rectangle.Empty)
                    {
                        labelRect.X = signRect.Right;
                    }
                    else
                    {
                        labelRect.X = ParentGrid.LeftColumnWidth + 1 +
                                      (enumSelf.Depth - 1) * (_grid.GlobalTextMargin + TreeGlyphWidth);
                    }
                }
            }

            labelRect.X += _grid.GlobalTextMargin;

            Graphics graphics = ParentGrid.CreateGraphics();

            labelRect.Width = Win32Calls.GetTextExtent(graphics, DisplayName, Font).Width;
            graphics.Dispose();

            int maxRight = ParentGrid.LeftColumnWidth + 1 + ParentGrid.LabelColumnWidth;

            if ((ParentGrid.EllipsisMode & PropertyGrid.EllipsisModes.EllipsisOnLabels) != 0)
            {
                maxRight -= _grid.GlobalTextMargin;
            }

            if (labelRect.Right > maxRight)
            {
                labelRect.Width = maxRight - labelRect.Left;
            }

            return(labelRect);
        }
Ejemplo n.º 12
0
        public override object Copy()
        {
            Guid?nextTech = ParentGrid.GetCellData(this.Colomn - 1, this.Row) as Guid?;

            if (nextTech != null)
            {
                List <Guid> keyList = _guidDictionary.Keys.ToList();
                int         index   = keyList.IndexOf((Guid)nextTech);
                nextTech = keyList[index + 1];
            }
            return(new ItemGridCell_TechStaticDataType(nextTech, _guidDictionary.Values.ToList()));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Performs basic instance initialization for a data control field.
        /// </summary>
        /// <param name="sortingEnabled">A value that indicates whether the control supports the sorting of columns of data.</param>
        /// <param name="control">The data control that owns the <see cref="T:System.Web.UI.WebControls.DataControlField"/>.</param>
        /// <returns>
        /// Always returns false.
        /// </returns>
        public override bool Initialize( bool sortingEnabled, Control control )
        {
            GroupPickerFieldTemplate groupPickerFieldTemplate = new GroupPickerFieldTemplate();
            groupPickerFieldTemplate.GroupPickerSelect += groupPickerFieldTemplate_GroupSelect;
            this.ItemTemplate = groupPickerFieldTemplate;
            
            ParentGrid = control as Grid;
            if ( ParentGrid != null )
            {
                ColumnIndex = ParentGrid.GetColumnIndex( this );
            }

            return base.Initialize( sortingEnabled, control );
        }
Ejemplo n.º 14
0
        internal void SetManuallyDisabled(PropertyEnumerator propEnum, object containerInstance, string memberName)
        {
            if (containerInstance != null)
            {
                _canBeDisabledManually = true;
                _enabledVariable       = new PropertyValueIndirect(_grid, null, containerInstance, TypeDescriptor.GetProperties(containerInstance)[memberName], null);
                _enabledVariable.Grid  = ParentGrid;
                ParentGrid.EnableProperty(propEnum, (GetManuallyDisabledVariable() && !ParentGrid.Grid.IsAncestorDisabled(propEnum)));
//                _enabled = (GetManuallyDisabledVariable() && !ParentGrid.Grid.IsAncestorDisabled(propEnum));

//                if (_grid != null)
//                  _grid.Grid.Invalidate();
            }
        }
Ejemplo n.º 15
0
        internal override void OnPropertyClicked(PropertyEnumerator enumSelf, Point point, Rectangle itemRect)
        {
            if ((ParentGrid.Enabled == false) && (ParentGrid.DisableMode != PropertyGrid.DisableModes.None))
            {
                return;
            }

            Rectangle labelRect = GetLabelTextRect(itemRect, enumSelf);

            if (labelRect.Contains(point))
            {
                PropertyHyperLinkClickedEventArgs ev = new PropertyHyperLinkClickedEventArgs(enumSelf, HyperLink);
                ParentGrid.OnHyperLinkPropertyClicked(ev);
            }
        }
Ejemplo n.º 16
0
        internal virtual void OnPropertyClicked(PropertyEnumerator enumSelf, Point point, Rectangle itemRect)
        {
            if ((Control.ModifierKeys == Keys.Control) && (HyperLinkFormat.Length > 0))
            {
                Rectangle valueRect = GetValueRect(itemRect);
                Graphics  graphics  = ParentGrid.CreateGraphics();
                Rectangle strRect   = Value.GetStringValueRect(graphics, valueRect, point);
                graphics.Dispose();

                if (strRect.Contains(point))
                {
                    ParentGrid.OnHyperLinkPropertyClicked(new PropertyHyperLinkClickedEventArgs(enumSelf, HyperLink));
                }
            }
        }
Ejemplo n.º 17
0
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            if (ParentGrid != null)
            {
                ParentGrid.AddColumn(this);
            }

            if (TextAlign == null && (Property is IntegerProperty ||
                                      Property is DecimalProperty || Property is DateTimeProperty))
            {
                TextAlign = Alignment.End;
            }

            base.OnInitialized();
        }
Ejemplo n.º 18
0
        protected override void Initiate()
        {
            Console.Clear();
            var pallet = ParentGrid.GetPallet(typeof(SakuraBlue.Entities.Tiles.Forest).Assembly);

            map = new ParentGrid($"{AppDomain.CurrentDomain.BaseDirectory}\\Maps\\map1.bmp", pallet);

            //Player.SetPlayer(fromCharacterCreaton);

            PlayerInstanceManager.SetPlayer(map.AddAgent <Entities.Agent.Player>(Entities.Agent.Gender.Female, Singleton <Entities.Agent.Race.Human> .GetInstance(), Singleton <Entities.Agent.Class.MageClass> .GetInstance(), "NotInstantiated", 3, 5));
            var hostileDjin = map.AddAgent <Entities.Agent.NPCBase>(Entities.Agent.Gender.Female, Singleton <Entities.Agent.Race.Djin> .GetInstance(), Singleton <Entities.Agent.Class.WarriorClass> .GetInstance(), "Hostile Djin female", 8, 25);

            hostileDjin.AI        = new Entities.Agent.AI.HostileAI(hostileDjin);
            hostileDjin.IsHostile = true;
            hostileDjin.ArmStarterGear();
            hostileDjin.AddPartyMember(Gender.Male, Singleton <Entities.Agent.Race.Narugan> .GetInstance(), Singleton <Entities.Agent.Class.MageClass> .GetInstance(), "Narugan Mage");



            Singleton <Music> .GetInstance().Play(@"\Music\Good Night.mp3");

            keyInterface = new KeyInterface(
                new KeyHook(ConsoleKey.UpArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Up); if (desciription != null)
                                                        {
                                                            RedrawNext();
                                                        }
                            }),
                new KeyHook(ConsoleKey.DownArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Down); if (desciription != null)
                                                          {
                                                              RedrawNext();
                                                          }
                            }),
                new KeyHook(ConsoleKey.LeftArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Left); if (desciription != null)
                                                          {
                                                              RedrawNext();
                                                          }
                            }),
                new KeyHook(ConsoleKey.RightArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Right); if (desciription != null)
                                                           {
                                                               RedrawNext();
                                                           }
                            }),
                new KeyHook(ConsoleKey.Escape, () => {
                Program.currentState = Singleton <Menu.TopMenu> .GetInstance();
                Console.Clear();
                Program.currentState.RedrawNext();
            }));
        }
Ejemplo n.º 19
0
        protected override void contextMenuStrip_Cell_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            switch (e.ClickedItem.ToString())
            {
            case "Edit":
                StartEditing(sender, e);
                break;

            case "Delete This Cell":
                ParentGrid.DeleteCell(this.Row, this.Colomn);
                break;

            case "Insert Cell":
                ParentGrid.GetFooterCell(Row).OnMouseClick(this, null);
                break;
            }
        }
Ejemplo n.º 20
0
        public virtual Rectangle GetSignRect(Rectangle itemRect, PropertyEnumerator enumSelf)
        {
            if (ParentGrid.HasOneVisibleChild(enumSelf) == false)
            {
                return(Rectangle.Empty);
            }

            Rectangle signRect = itemRect;

            signRect.Y     += signRect.Height / HeightMultiplier / 2 - 4;
            signRect.Height = TreeGlyphWidth;

            signRect.X     = ParentGrid.LeftColumnWidth + 1 + (enumSelf.Depth - 1) * (_grid.GlobalTextMargin + TreeGlyphWidth) + _grid.GlobalTextMargin;
            signRect.Width = TreeGlyphWidth;

            return(signRect);
        }
Ejemplo n.º 21
0
        public override string AgentMove(ParentGrid grid, Direction direction)
        {
            var result = base.AgentMove(grid, direction);

            foreach (Agent.NPCBase npc in ((ParentGrid)this.World).Agents)
            {
                if (npc.GetType() != typeof(Player))
                {
                    if (npc.AI != null)
                    {
                        npc.AI.Detect();
                        npc.AI.TurnStep();
                    }
                }
            }

            return(result);
        }
Ejemplo n.º 22
0
        public override Rectangle GetSignRect(Rectangle itemRect, PropertyEnumerator enumSelf)
        {
            if (ParentGrid.HasOneVisibleChild(enumSelf) == false)
            {
                return(Rectangle.Empty);
            }

            Rectangle signRect = itemRect;

            // Default rectangle in the left most column for root categories
            signRect.Y     += itemRect.Height / 2 - (TreeGlyphWidth / 2);
            signRect.Height = TreeGlyphWidth;

            signRect.X     = ParentGrid.LeftColumnWidth + 1 + (enumSelf.Depth - 1) * (ParentGrid.GlobalTextMargin + TreeGlyphWidth) + ParentGrid.GlobalTextMargin;
            signRect.Width = TreeGlyphWidth;

            return(signRect);
        }
Ejemplo n.º 23
0
        public virtual bool OverrideCursor(Point mouseLocation, Rectangle itemRect, PropertyEnumerator propEnum)
        {
            if ((HyperLinkFormat.Length != 0) && (Control.ModifierKeys == Keys.Control) && (Value != null))
            {
                Rectangle valueRect = GetValueRect(itemRect);
                Graphics  graphics  = ParentGrid.CreateGraphics();
                Rectangle strRect   = Value.GetStringValueRect(graphics, valueRect, mouseLocation);
                graphics.Dispose();

                if (strRect.Contains(mouseLocation) && Enabled)
                {
                    ParentGrid.Grid.Cursor = Cursors.Hand;
                    return(true);
                }
            }

            return(false);
        }
 public void FocusGrids()
 {
     CreateControllers(typeof(SetList));
     ParentGrid.Focus();
     Assert.IsFalse(MainGrid.Focused,
                    "MainGrid.Focused after ParentGrid.Focus");
     Assert.AreEqual(1, MainGrid.CellColorScheme.InvertCount,
                     "MainGrid.CellColorScheme.InvertCount after ParentGrid.Focus");
     Assert.AreEqual(1, MainGrid.DisableCount,
                     "MainGrid.DisableCount after ParentGrid.Focus");
     Assert.AreEqual(1, MainGrid.EnableCount,
                     "MainGrid.EnableCount after ParentGrid.Focus");
     Assert.IsTrue(MainGrid.Enabled, "MainGrid.Enabled after ParentGrid.Focus");
     Assert.IsTrue(ParentGrid.Focused,
                   "ParentGrid.Focused after ParentGrid.Focus");
     Assert.AreEqual(1, ParentGrid.CellColorScheme.RestoreToDefaultCount,
                     "ParentGrid.CellColorScheme.RestoreToDefaultCount after ParentGrid.Focus");
     Assert.AreEqual(1, View.SetMouseCursorToWaitCount,
                     "SetMouseCursorToWaitCount after ParentGrid.Focus");
     Assert.AreEqual(1, View.SetMouseCursorToDefaultCount,
                     "SetMouseCursorToDefaultCount after ParentGrid.Focus");
     Controller.FocusUnfocusedGridIfAny();
     Assert.IsTrue(MainGrid.Focused,
                   "MainGrid.Focused after FocusUnfocusedGridIfAny #1");
     Assert.AreEqual(1, MainGrid.CellColorScheme.RestoreToDefaultCount,
                     "MainGrid.CellColorScheme.RestoreToDefaultCount after FocusUnfocusedGridIfAny #1");
     Assert.IsFalse(ParentGrid.Focused,
                    "ParentGrid.Focused after FocusUnfocusedGridIfAny #1");
     Assert.AreEqual(1, ParentGrid.CellColorScheme.InvertCount,
                     "ParentGrid.CellColorScheme.InvertCount after FocusUnfocusedGridIfAny #1");
     Controller.FocusUnfocusedGridIfAny();
     Assert.IsFalse(MainGrid.Focused,
                    "MainGrid.Focused after FocusUnfocusedGridIfAny #2");
     Assert.AreEqual(2, MainGrid.CellColorScheme.InvertCount,
                     "MainGrid.CellColorScheme.InvertCount after FocusUnfocusedGridIfAny #2");
     Assert.IsTrue(ParentGrid.Focused,
                   "ParentGrid.Focused after FocusUnfocusedGridIfAny #2");
     Assert.AreEqual(2, ParentGrid.CellColorScheme.RestoreToDefaultCount,
                     "ParentGrid.CellColorScheme.RestoreToDefaultCount after FocusUnfocusedGridIfAny #2");
     Controller.FocusUnfocusedGridIfAny();
     Assert.IsTrue(MainGrid.Focused,
                   "MainGrid.Focused after FocusUnfocusedGridIfAny #3");
 }
Ejemplo n.º 25
0
        // IWebHandler

        public virtual bool ProcessRequest(HttpContext context)
        {
            if (Session.IsActionLink(context, _triggerID))
            {
                string rowIndex = context.Request.QueryString["RowIndex"];
                if (rowIndex != null)
                {
                    ParentGrid.MoveTo(Int32.Parse(rowIndex));
                    if (GetEnabled())
                    {
                        Action.Execute();
                    }
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 26
0
        public virtual string AgentMove(ParentGrid grid, Direction direction)
        {
            var result = "";

            switch (direction)
            {
            case Direction.Up:
                if (Y - 1 >= 0)
                {
                    if (grid.Tiles[X, Y - 1].IsPassable)
                    {
                        Y--;
                        result = grid.Tiles[X, Y].Description;
                    }
                    else
                    {
                        result = grid.Tiles[X, Y - 1].Description;
                    }
                }
                else
                {
                    result = null;
                }
                break;

            case Direction.Down:
                if (Y + 1 <= grid.Tiles.GetLength(1))
                {
                    if (grid.Tiles[X, Y + 1].IsPassable)
                    {
                        Y++;
                        result = grid.Tiles[X, Y].Description;
                    }
                    else
                    {
                        result = grid.Tiles[X, Y + 1].Description;
                    }
                }
                else
                {
                    result = null;
                }
                break;

            case Direction.Left:
                if (X - 1 >= 0)
                {
                    if (grid.Tiles[X - 1, Y].IsPassable)
                    {
                        X--;
                        result = grid.Tiles[X, Y].Description;
                    }
                    else
                    {
                        result = grid.Tiles[X - 1, Y].Description;
                    }
                }
                else
                {
                    result = null;
                }
                break;

            case Direction.Right:
                if (X + 1 <= grid.Tiles.GetLength(0))
                {
                    if (grid.Tiles[X + 1, Y].IsPassable)
                    {
                        X++;
                        result = grid.Tiles[X, Y].Description;
                    }
                    else
                    {
                        result = grid.Tiles[X + 1, Y].Description;
                    }
                }
                else
                {
                    result = null;
                }
                break;

            default:
                result = null;
                break;
            }


            return(result);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Resize the analogue clock based on the smallest of its width and height
        /// </summary>
        private void AnalogueClockSize()
        {
            try
            {
                ParentGrid.Height   = MyGrid.RowDefinitions.FirstOrDefault().ActualHeight;
                ParentGrid.Width    = MyGrid.ColumnDefinitions.FirstOrDefault().ActualWidth;
                TBlockTime.FontSize = MyGrid.RowDefinitions.FirstOrDefault().ActualHeight * 0.30;

                ParentGrid.UpdateLayout();
                TBlockTime.UpdateLayout();

                //Parent meassurements
                int clockParentWidth  = (int)ParentGrid.ActualWidth;
                int clockParentHeight = (int)ParentGrid.RowDefinitions.FirstOrDefault().ActualHeight;

                clockHandler.SizeCalc(clockParentWidth, clockParentHeight);

                int clockDiameter = clockHandler.Diameter;
                int radius        = clockHandler.Radius;

                //Clock meassurements
                AnalogueClockEllipsis.Height = clockDiameter;
                AnalogueClockEllipsis.Width  = clockDiameter;

                //Arm Width (Length)
                rectangleSecond.Width = clockHandler.ArmSLength;
                rectangleMinute.Width = clockHandler.ArmMLength;
                rectangleHour.Width   = clockHandler.ArmHLength;

                //Arm Height
                rectangleSecond.Height = clockHandler.ArmSHeight;
                rectangleMinute.Height = clockHandler.ArmMHeight;
                rectangleHour.Height   = clockHandler.ArmHHeight;

                //Margin for arm offset
                rectangleSecond.Margin = new Thickness(rectangleSecond.Width, 0, 0, 0);;
                rectangleMinute.Margin = new Thickness(rectangleMinute.Width, 0, 0, 0);;
                rectangleHour.Margin   = new Thickness(rectangleHour.Width, 0, 0, 0);;

                //Offset for animation center
                secondHand.CenterY = rectangleSecond.Height / 2;
                minuteHand.CenterY = rectangleMinute.Height / 2;
                hourHand.CenterY   = rectangleHour.Height / 2;

                //Timestamps -TextBlocks- coord and size
                double dist   = clockHandler.TxtDist;
                double coordY = clockHandler.TxtCoordX;
                double coordX = clockHandler.TxtCoordY;

                //Can this be List<>() looped?
                TBlockTwelve.Margin = new Thickness(0, -dist, 0, 0);
                TBlockOne.Margin    = new Thickness(coordY, -coordX, 0, 0);
                TBlockTwo.Margin    = new Thickness(coordX, -coordY, 0, 0);
                TBlockThree.Margin  = new Thickness(dist, 0, 0, 0);
                TBlockFour.Margin   = new Thickness(coordX, coordY, 0, 0);
                TBlockFive.Margin   = new Thickness(coordY, coordX, 0, 0);
                TBlockSix.Margin    = new Thickness(0, dist, 0, 0);
                TBlockSeven.Margin  = new Thickness(-coordY, coordX, 0, 0);
                TBlockEight.Margin  = new Thickness(-coordX, coordY, 0, 0);
                TBlockNine.Margin   = new Thickness(-dist, 0, 0, 0);
                TBlockTen.Margin    = new Thickness(-coordX, -coordY, 0, 0);
                TBlockEleven.Margin = new Thickness(-coordY, -coordX, 0, 0);

                double txtSize = clockHandler.TxtSize;

                IEnumerable <TextBlock> txtChilden = ParentGrid.Children.OfType <TextBlock>();

                foreach (var child in txtChilden)
                {
                    child.FontSize = txtSize;
                }

                AnalogueClockEllipsis.StrokeThickness = clockHandler.BordorThickness;

                //Center dot for style
                ArmDotEllipsis.Width  = rectangleHour.Height;
                ArmDotEllipsis.Height = rectangleHour.Height;
            }
            catch (Exception error)
            {
                DataValidation.SaveError(error.ToString());
            }
        }
Ejemplo n.º 28
0
 public void TransformGlobal2Local(MultidimensionalArray GlobalVerticesIn, MultidimensionalArray LocalVerticesOut, int jCell, bool[] NewtonConvergence)
 {
     ParentGrid.TransformGlobal2Local(GlobalVerticesIn, LocalVerticesOut, jCell, NewtonConvergence);
 }
Ejemplo n.º 29
0
 public void TransformGlobal2Local(MultidimensionalArray GlobalVerticesIn, MultidimensionalArray LocalVerticesOut, int j0, int Len, int OutArrayOffset)
 {
     ParentGrid.TransformGlobal2Local(GlobalVerticesIn, LocalVerticesOut, j0, Len, OutArrayOffset);
 }
Ejemplo n.º 30
0
 public void TransformLocal2Global(MultidimensionalArray NS, int j0, int Len, MultidimensionalArray Nodesglob)
 {
     ParentGrid.TransformLocal2Global(NS, j0, Len, Nodesglob);
 }