Пример #1
0
        // -------------------------------------------------
        public Form_RegPolyWithComments ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            //Font = new Font ("Times New Roman", 14);

            string strTitle = "New comment";
            spaces = new Spaces (Convert .ToInt32 (Auxi_Geometry .MeasureString (this, strTitle) .Height));
            clrComment = Color .Blue;
            fontComment = Font;
            textNewComment .ForeColor = clrComment;
            textNewComment .Font = fontComment;

            polygon = new RegPolyWithComments (Auxi_Geometry .Middle (ClientRectangle), 140, 7, 0, Color .Yellow);

            btnCommentFont .Location = new Point (btnCommentClr .Right, btnCommentClr .Top);
            btnAdd .Location = new Point (btnCommentFont .Right + spaces .HorMin, btnCommentClr .Top);
            int minH_textNewComment = 60;
            textNewComment .Bounds = new Rectangle (btnCommentClr .Left, btnCommentClr .Top - (spaces .VerMin + minH_textNewComment),
                                                    btnAdd .Right - btnCommentClr .Left, minH_textNewComment);
            Rectangle rcFrame = Auxi_Geometry .FrameAroundControls (new Control [] { textNewComment, btnCommentClr, btnCommentFont, btnAdd }, spaces);
            groupNewCmnt = new Group (this, rcFrame, 
                                      new RectRange (rcFrame .Width, 4 * rcFrame .Width, rcFrame .Height, 3 * rcFrame .Height), 
                                      strTitle, MoveNewGroup);
            string [] cmnts = new string [] {"Comments ", "- add, move, rotate", 
                                             "Polygon ",  "- move, rotate, resize", 
                                             "Group ",    "- move, resize, use", 
                                            };
            info = new TwoColumnInfo (this, new Point (300, 350), cmnts);
            RenewMover ();
        }
Пример #2
0
        // -------------------------------------------------
        public Form_BoardsAndBalls ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            //Font = new Font ("Times New Roman", 14);

            clrFrameLR = Auxi_Colours .IntermediateClr (0.7, BackColor, ControlPaint .Dark (BackColor));
            penFrameLR = new Pen (clrFrameLR);

            sizefStrs = Auxi_Geometry .MeasureStrings (this, strs);
            hStr = Convert .ToInt32 (sizefStrs [0] .Height);
            spaces = new Spaces (hStr);

            lrNew = new LinkedRectangles (new Control [] { numericUD_Balls, checkSameSize, buttonAdd });
            int cxL = numericUD_Balls .Left - spaces .Left_inFrame;
            int cyT = numericUD_Balls .Top - spaces .Top_inFrame;
            int cxR = buttonAdd .Right + spaces .Right_inFrame;
            int cyB = buttonAdd .Bottom + spaces .Btm_inFrame;
            Rectangle rcArea = new Rectangle (cxL, cyT, cxR - cxL, cyB - cyT);
            rcArea .Inflate (3, 3);
            lrNew .Add (rcArea, "Area");

            rand = Auxi_Common .RandomByCurTime (out nSeed);

            boards .Add (new BoardWithBalls (this, new Rectangle (40, 70, 400, 300), Color .White, 5, false, 
                                             new Font ("Times New Roman", 14, FontStyle .Bold | FontStyle .Italic), Color .Blue));
            info = new TextM (this, new Point (200, 400), cmnts);
            info .ShowBackground = false;

            comboCase .SelectedIndex = 0;
            RenewMover ();
        }
Пример #3
0
 public AutoBuilderConfiguration(
     CharacterSetType stringCharacterSetType = CharacterSetType.Alpha,
     Casing stringCasing            = Casing.ProperCase,
     Spaces stringSpaces            = Spaces.None,
     Language defaultLanguage       = Language.English,
     int intMinimum                 = 1,
     int intMaximum                 = 10000,
     double doubleMinimum           = 100,
     double doubleMaximum           = 100000,
     short shortMinimum             = 1,
     short shortMaximum             = 32000,
     bool defaultBoolean            = true,
     int stringMinLength            = 5,
     int stringMaxLength            = 25,
     int maxDepth                   = 5,
     int defaultCollectionItemCount = 2)
     : this(
         DateTime.UtcNow,
         stringCharacterSetType,
         stringCasing,
         stringSpaces,
         defaultLanguage,
         intMinimum,
         intMaximum,
         doubleMinimum,
         doubleMaximum,
         shortMinimum,
         shortMaximum,
         defaultBoolean,
         stringMinLength,
         stringMaxLength,
         maxDepth,
         defaultCollectionItemCount)
 {
 }
Пример #4
0
        public void Move(Player player, int numSpaces)
        {
            int modifier = 1;

            if (numSpaces < 0)
            {
                modifier = modifier * -1;
            }

            for (int i = 0; i < Math.Abs(numSpaces); i++)
            {
                Spaces[player.Position].Exit(player);
                if (!player.IsInJail)
                {
                    player.Position = (player.Position + modifier) % Spaces.Count();
                    if (player.Position < 0)
                    {
                        player.Position = Spaces.Count() - 1;
                    }
                    Spaces[player.Position].Enter(player);
                }
            }

            Spaces[player.Position].LandedOnBy(player);
        }
 public デマンド登録_Request()
 {
     pickUpPosition  = new Position();
     dropOffPosition = new Position();
     spaces          = new Spaces[1];
     spaces[0]       = new Spaces();
 }
        private static async Task MonitorAsync(HttpClient httpClient)
        {
            for (int i = 0; i < 60; i++)
            {
                var spaces = await Spaces.GetAllSpacesAsync(httpClient, true);

                var spacesData = spaces.Where(s => s.Values != null &&
                                              s.Values.Any(v => v.Type == "condicion"));
                if (spacesData.Any())
                {
                    foreach (var item in spacesData)
                    {
                        foreach (var value in item.Values)
                        {
                            Console.WriteLine($"Timestamp: {value.Timestamp}\nValue: {value.Value}\n");
                        }
                    }
                }
                else
                {
                    Console.WriteLine("No es posible encontrar habitaciones");
                }

                await Task.Delay(2000);
            }
        }
Пример #7
0
        private void addToGroup(Space space)
        {
            SpaceCollection newGroup = new SpaceCollection();

            newGroup.AddAt(space.X, space.Y);
            this._groups.Add(newGroup);
            space.SetGroup(newGroup);

            // TODO: Modify: get each connected space and add the groups for all connected spaces together
            List <Space> connected = GetConnectedSpaces(space.X, space.Y);

            foreach (Space cSpace in connected)
            {
                if (cSpace.GetGroup() != space.GetGroup())
                {
                    SpaceCollection cGroup = cSpace.GetGroup();
                    for (int i = cGroup.Count - 1; i >= 0; i--)
                    {
                        Space groupSpace      = cGroup.GetByIndex(i);
                        Space boardGroupSpace = Spaces.GetSpace(groupSpace.X, groupSpace.Y);
                        space.GetGroup().AddAt(boardGroupSpace.X, boardGroupSpace.Y);
                        boardGroupSpace.SetGroup(space.GetGroup());
                    }
                    this._groups.Remove(cGroup);
                }
            }
        }
Пример #8
0
        private bool IsFlowOperator(string code)
        {
            const int offset     = 3;
            var       delimiters = new char[Spaces.Length + offset];

            delimiters[0] = Multicast;
            delimiters[1] = BlockOpen;
            delimiters[2] = ParenOpen;
            Spaces.CopyTo(delimiters, offset);
            string word = code.Split(delimiters, 2)[0].ToLowerInvariant();

            switch (word)
            {
            case FlowBreak:
            case FlowContinue:
            case FlowElse:
            case FlowGosub:
            case FlowGoto:
            case FlowIf:
            case FlowLoop:
            case FlowReturn:
            case FlowWhile:
            case FunctionLocal:
            case FunctionGlobal:
            case FunctionStatic:
                return(true);
            }

            return(false);
        }
Пример #9
0
        public double ParkingCost(int spaceId, int levelId)
        {
            Space foundSpace = Spaces.Find(x => x.SpaceId == spaceId && x.LevelId == levelId);

            if (foundSpace != null)
            {
                CarOwner foundCar = CarOwners.Find(x => x.SpaceId == spaceId && x.SpaceLevel == levelId);
                if (foundCar != null)
                {
                    Time = 1;
                    if (foundCar.Status == SpaceType.General)
                    {
                        Console.WriteLine($"You parking space type is General and your total is ${Time * 1.0}.00");
                        return(Time * 1.0);
                    }
                    else if (foundCar.Status == SpaceType.Valet)
                    {
                        Console.WriteLine($"Your parking space type is Valet and your total is ${Time * 2.0}.00");
                        return(Time * 2.0);
                    }
                    else
                    {
                        Console.WriteLine($"Your parking space type is Frequent Flyer and your total is ${Time * 3.0}.00");
                        return(Time * 3.0);
                    }
                }
            }
            else
            {
                Console.WriteLine("Your parking is free today");
            }
            return(0.0);
        }
Пример #10
0
 private void CreateSpaces()
 {
     for (int spaceIndex = 1; spaceIndex <= 9; spaceIndex++)
     {
         Spaces.Add(new BoardCardSpace(spaceIndex));
     }
 }
        public Device GetDeviceById(string deviceId)
        {
            var spaces  = Spaces.Flatten <Space>(s => s.childSpaces);
            var devices = spaces.Where(s => s.devices != null && s.devices.Any()).SelectMany(s => s.devices);

            return(devices.FirstOrDefault(d => d != null && d.id == deviceId));
        }
Пример #12
0
 private void CreateSpaces(MainWindow mainWindow)
 {
     for (int spaceIndex = 1; spaceIndex <= 9; spaceIndex++)
     {
         Spaces.Add(new BoardCardSpace(spaceIndex, mainWindow));
     }
 }
Пример #13
0
 private void AssertHaveCorrectNames(Spaces spaces)
 {
     foreach (var pair in spaces.Zip(Spaces.Names, (s, n) => new { Space = s, Name = n }))
     {
         Assert.That(pair.Space, Has.Property(nameof(ISpace.Name)).EqualTo(pair.Name));
     }
 }
Пример #14
0
        /// <summary>
        /// Classifies the character into normal chars, spaces, semicola, quotes,
        /// control chars.
        /// </summary>
        /// <param name="ch">a char</param>
        /// <returns>Return the character kind.</returns>
        private static UnicodeKind ClassifyCharacter(char ch)
        {
            if (Spaces.IndexOf(ch) >= 0 || (0x2000 <= ch && ch <= 0x200B))
            {
                return(UnicodeKind.Space);
            }
            if (Commas.IndexOf(ch) >= 0)
            {
                return(UnicodeKind.Comma);
            }
            if (Semicola.IndexOf(ch) >= 0)
            {
                return(UnicodeKind.Semicolon);
            }
            if (Quotes.IndexOf(ch) >= 0 || (0x3008 <= ch && ch <= 0x300F) || (0x2018 <= ch && ch <= 0x201F))
            {
                return(UnicodeKind.Quote);
            }
            if (ch < 0x0020 || Controls.IndexOf(ch) >= 0)
            {
                return(UnicodeKind.Control);
            }

            // Assume typical case.
            return(UnicodeKind.Normal);
        }
Пример #15
0
        public List <Space> GetConnectedSpaces(int x, int y)
        {
            List <Space> spaces = new List <Space>();

            int connectionX = x - 1;
            int connectionY = y;

            if (connectionX > 0 && Spaces.GetSpace(connectionX, connectionY).SpaceColor == Spaces.GetSpace(x, y).SpaceColor)
            {
                spaces.Add(Spaces.GetSpace(connectionX, connectionY));
            }

            connectionX = x + 1;
            if (connectionX <= this.BoardSize && Spaces.GetSpace(connectionX, connectionY).SpaceColor == Spaces.GetSpace(x, y).SpaceColor)
            {
                spaces.Add(Spaces.GetSpace(connectionX, connectionY));
            }

            connectionX = x;
            connectionY = y - 1;
            if (connectionY > 0 && Spaces.GetSpace(connectionX, connectionY).SpaceColor == Spaces.GetSpace(x, y).SpaceColor)
            {
                spaces.Add(Spaces.GetSpace(connectionX, connectionY));
            }

            connectionY = y + 1;
            if (connectionY <= this.BoardSize && Spaces.GetSpace(connectionX, connectionY).SpaceColor == Spaces.GetSpace(x, y).SpaceColor)
            {
                spaces.Add(Spaces.GetSpace(connectionX, connectionY));
            }

            return(spaces);
        }
Пример #16
0
        public Board Clone()
        {
            Board b = new Board();

            b.Spaces = (Space[])Spaces.Clone();
            return(b);
        }
Пример #17
0
        public void GetOffsetSpace_GivenOffsetThatLandsOnBoard_ReturnsSpaceWithIndexEqualToSumOfInitialSpaceAndOffset()
        {
            var offset = GivenOffsetThatLandsOnBoard();

            var nextSpace = Board.GetOffsetSpace(InitialSpace, offset);

            Assert.That(Spaces.IndexOf(nextSpace), Is.EqualTo(InitialSpaceIndex + offset));
        }
Пример #18
0
        // -------------------------------------------------
        public Form_LinkedElements ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            //Font = new Font ("Times New Roman", 14);

            rand = Auxi_Common .RandomByCurTime (out nSeed);
            spaces = new Spaces (Convert .ToInt32 (Auxi_Geometry .MeasureString (this, strChatPolyText [0]) .Height));

            // dfRegPoly
            string [] strs = new string [] { "Sides", "Color" };
            Size [] sizeStrs = Auxi_Geometry .RoundMeasureStrings (this, strs);
            CommentedControl ccSides = new CommentedControl (this, numericUD_RegSides, 4 + sizeStrs [0] .Width / 2, 0.5, strs [0]);
            CommentedControl ccColor = new CommentedControl (this, panelRegPolyClr, 4 + sizeStrs [1] .Width / 2, 0.5, strs [1]);
            List<ElementInsideDependentFrame> elems = new List<ElementInsideDependentFrame> ();
            elems .Add (new ElementInsideDependentFrame (ccSides));
            elems .Add (new ElementInsideDependentFrame (ccColor));
            elems .Add (new ElementInsideDependentFrame (new FramedControl (btnAddRegPoly)));
            dfRegPoly = new DependentFrame (this, elems, spaces, "Regular polygon");  

            // lrsCircle
            lrsCircle = new LinkedRectangles (new Control [] { btnCircleClr, panelCircleSample, btnAddCircle });
            sizeStrs = Auxi_Geometry .RoundMeasureStrings (this, strCircle);
            lrsCircle .Add (new Rectangle (btnCircleClr .Left, btnCircleClr .Top - (sizeStrs [0] .Height + 4),
                                           sizeStrs [0] .Width, sizeStrs [0] .Height), "Title");
            int cyT = (panelCircleSample .Top + panelCircleSample .Bottom) / 2 - sizeStrs [1] .Height / 2;
            lrsCircle .Add (new Rectangle (panelCircleSample .Right + 4, cyT, sizeStrs [1] .Width, sizeStrs [1] .Height), "ColorLabel");
            lrsCircle .Add (new Rectangle (panelCircleSample .Right, cyT, btnAddCircle .Right - panelCircleSample .Right, btnAddCircle .Top - cyT));

            InGroupRelativePosition ();
            Rectangle rc = Auxi_Geometry .FrameAroundControls (new Control [] {numericUD_ChatApexes, btnStartPolyClr, btnEndPolyClr, 
                                                                     btnChatPolyCenterClr, panelChatPolyCenterSample, btnAddChatPoly }, spaces);
            groupChatPoly = new Group (this, rc, strChatPolyText [0], MoveChatPolyGroup);

            mover .Insert (0, buttonCovers);
            dfRegPoly .IntoMover (mover, 0);
            mover .Insert (0, lrsCircle);
            mover .Insert (0, groupChatPoly);

            info = new TextM (this, new Point (210, 170),
                              "Different classes are used to add the new colored figures:\n" +
                              "   regular polygons are added via the DependentFrame class,\n" +
                              "   circles are added via the LinkedRectangles class,\n" +
                              "   chatoyant polygons are added via the Group class.\n" +
                              "All colored figures can be moved (L_Press inside) and\n" +
                              "resized (L_Press on border); chatoyant polygons can be also\n" +
                              "rotated (R_Press) and reconfigured (L_Press on apexes).\n" +
                              "L_Click any colored figure to popup it.", 
                              new Font ("Microsoft Sans Serif", 9));
            info .BackColor = Color .Yellow;
            mover .Add (info);

            iTopElemOrder = mover .Count;

            panelRegPolyClr .BackColor = clrNewRegPoly;
            panelCircleSample .BackColor = clrNewCircle;
            panelChatPolyCenterSample .BackColor = clrChatPolyCenter;
        }
Пример #19
0
 // Update is called once per frame
 void Update()
 {
     // cycle spaces
     if (Input.GetKeyDown(KeyCode.Space))
     {
         // wrap around increment space
         CurrentSpace = (Spaces)(((int)CurrentSpace + 1) % spaceMasks.Length);
     }
 }
Пример #20
0
        public string ToString(Spaces format)
        {
            if (Spaces.with == format)
            {
                return(ToStringWithSpaces());
            }

            return(ToString());
        }
Пример #21
0
 public Demands()
 {
     pickUpPosition  = new Position();
     dropOffPosition = new Position();
     reason          = new Reason();
     sav             = new Sav();
     spaces          = new Spaces[1];
     spaces[0]       = new Spaces();
 }
Пример #22
0
        public Space GetParkingSpace(string license, string name = "")
        {
            CarOwner foundOwner = CarOwners.Find(x =>
                                                 x.Name.ToLower() == name.ToLower() || x.LicensePlate.ToLower() == license.ToLower());

            return(foundOwner != null
                ? Spaces.Find(x => x.SpaceId == foundOwner.SpaceId && x.LevelId == foundOwner.SpaceLevel)
                : null);
        }
Пример #23
0
 public void AddCar(CarOwner car, int spaceId, int levelId)
 {
     SpaceId        = spaceId;
     LevelId        = levelId;
     car.SpaceId    = spaceId;
     car.SpaceLevel = levelId;
     Spaces.Add(this);
     CarOwners.Add(car);
 }
Пример #24
0
 /// <summary>
 /// Override model string property.
 /// </summary>
 /// <param name="expression">The expression.</param>
 /// <param name="length">The length.</param>
 /// <param name="characterSetType">Type of the character set.</param>
 /// <param name="spaces">The spaces.</param>
 /// <returns>Returns this.</returns>
 public IAutoBuilderOverrides <TModel> With(
     Expression <Func <TModel, string> > expression,
     int length,
     CharacterSetType characterSetType,
     Spaces spaces)
 {
     this.Actions.Add(() => SetStringPropertyUsingNewRandomizerSetting(() => NAuto.GetRandomString(length, characterSetType, spaces), expression));
     return(this);
 }
Пример #25
0
        public void GetOffsetSpace_GivenOffsetThatLandsAfterHighestSpaceOnBoard_ReturnsSpaceAtWrappedIndex()
        {
            var offset = GivenOffsetThatLandsAfterHighestSpaceOnBoard();
            var expectedFinalSpaceIndex = (InitialSpaceIndex + offset).Modulo(TotalSpaces);

            var nextSpace = Board.GetOffsetSpace(InitialSpace, offset);

            Assert.That(Spaces.IndexOf(nextSpace), Is.EqualTo(expectedFinalSpaceIndex));
        }
Пример #26
0
        internal override void RemoveKey(IEntityKey key)
        {
            base.RemoveKey(key);
            var space = key as SpaceKey;

            if (space != null && Spaces != null)
            {
                Spaces.Remove(space);
            }
        }
Пример #27
0
    void ClearLists()
    {
        foreach (GameObject cube in CubeList)
        {
            GameObject.Destroy(cube);
        }

        Spaces.Clear();
        CubeList.Clear();
    }
Пример #28
0
        public void Discard()
        {
            int score = CalculateScore();

            for (int i = 0; i < score; i++)
            {
                List <BoardCardSpace> filledSpaces = Spaces.Where(x => x.Card != null).ToList();
                filledSpaces[random.Next(filledSpaces.Count)].TakeCard();
            }
        }
Пример #29
0
        public List <Property> GetPropertiesInGroup(string groupName)
        {
            List <Property> props = new List <Property>();

            props = Spaces
                    .OfType <Property>()
                    .Where(prop => prop.Group.Name == groupName)
                    .ToList <Property>();
            return(props);
        }
Пример #30
0
 // Function to decide what to do if a neighbor has a mine or not.
 private void CheckSpecificNeighbor(Spaces TempSpace, Spaces space)
 {
     if (TempSpace.HasMine)
     {
         Neighbors++;
     }
     else
     {
         space.NeighborSpaces.Add(TempSpace);
     }
 }
Пример #31
0
        internal override void RemoveKey(IEntityKey key)
        {
            base.RemoveKey(key);
            var space = key as SpaceKey;

            if (space == null || Spaces == null)
            {
                return;
            }
            Spaces.Remove(space);
        }
Пример #32
0
        private static IEnumerable <int> ParseInput()
        {
            var countParser = Int.AndL(Newline);
            var seqParser   = Many(Spaces.AndRTry(Int));
            var entryParser = Tuple(countParser, seqParser);
            var allEntries  = Many1(entryParser);
            var path        = Path.Combine(AppContext.BaseDirectory, "data.txt");
            var result      = allEntries.RunOnFile(path).GetResult();

            return(result[0].Item2);
        }
Пример #33
0
    /// <summary>
    /// Private Methods
    /// </summary>

    void Init()
    {
        for (int i = 0; i < Size; i++)
        {
            Spaces.Add(new List <Space>());
            for (int j = 0; j < Size; j++)
            {
                Spaces[i].Add(new Space(new Vector3(i, j), i * Size + j));
            }
        }
    }
Пример #34
0
        public static string Get(int length, CharacterSetType characterSetType, Spaces spaces, Casing casing,
            Language language = Language.English)
        {
            SetLanguageCharacterSets(language);
            SetLanguageNumbers(language);
            var characters = GetCharacterSet(characterSetType, casing);

            var sb = BuildRandomString(length, spaces, characters);

            return ConvertToProperCaseIfRequired(sb.ToString(), casing);
        }
Пример #35
0
        // -------------------------------------------------
        public Form_Calculator ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            mover .Clipping = Clipping .Safe;

            spaces = new Spaces (Auxi_Geometry .RoundMeasureString (this, "Text") .Height);
            DefaultView ();
            RestoreFromRegistry ();
            foreach (Control control in Controls)
            {
                mover .Add (control);
            }
            ClearValue ();
        }
Пример #36
0
        private static StringBuilder BuildRandomString(int length, Spaces spaces, List<string> characters)
        {
            switch (spaces)
            {
                case Spaces.Any:
                    characters.Add(" ");
                    break;
            }

            var sb = new StringBuilder();
            var randomMiddleSpaceLocation = 0;

            if (length - 2 > 0)
            {
                randomMiddleSpaceLocation = Random.Next(1, length - 2);
            }

            for (var i = 0; i < length; i++)
            {
                if (i == 0 && (spaces == Spaces.Start || spaces == Spaces.StartAndEnd))
                {
                    sb.Append(" ");
                    continue;
                }

                if (i == length - 1 && (spaces == Spaces.End || spaces == Spaces.StartAndEnd))
                {
                    sb.Append(" ");
                    continue;
                }

                if (spaces == Spaces.Middle && randomMiddleSpaceLocation > 0 && i == randomMiddleSpaceLocation)
                {
                    sb.Append(" ");
                    continue;
                }

                sb.Append(characters[GetRandomNumber(characters.Count - 1)]);
            }

            return sb;
        }
Пример #37
0
        // -------------------------------------------------
        public Form_PersonalInfo_LTP ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            mover .Clipping = Clipping .Safe;

            ctrls = new Control [] {textName, textSurname,                                          // 0, 1
                                    textMonth, textDay, textYear,                                   // 2, 3, 4
                                    textProfession,                                                 // 5
                                    textHomePhone, textOfficePhone, textMobilePhone,                // 6, 7, 8
                                    textStreet, textTown, textProvince, textCountry, textZipCode};  // 9 - 13
            comctrls = new CommentedControlLTP [ctrls .Length];

            spaces = new Spaces (Auxi_Geometry .RoundMeasureString (this, "Temporary") .Height);
            tmBirth = new TextM (this, new Point (100, 100), "Birth");
            tmBirth .ShowFrame = false;
            DefaultView ();
            RestoreFromRegistry ();

            RenewMover ();
        }
Пример #38
0
        // -------------------------------------------------
        public Form_DataSelection ()
        {
            InitializeComponent ();
            mover = new Mover (this);

            sizeTitles = Auxi_Geometry .RoundMeasureStrings (this, titles);
            spaces = new Spaces (sizeTitles [0] .Height);

            Rectangle rc = Auxi_Geometry .FrameAroundControls (new Control [] { listYearsAll, btnSelect }, spaces);
            groupAll = new Group (this, rc, new RectRange (sizeTitles [0] .Width + 20, 180, 100, 500), titles [0], MoveAll);
            rc = Auxi_Geometry .FrameAroundControls (new Control [] { listYearsSelected, btnExclude }, spaces);
            groupSelected = new Group (this, rc, new RectRange (sizeTitles [1] .Width + 20, 180, 100, 500), titles [1], MoveSelected);
            RestoreFromRegistry ();

            mover .Add (groupAll);
            mover .Insert (0, groupSelected);
            mover .Insert (0, btnOK);

            for (int i = 1880; i <= DateTime .Now .Year; i++)
            {
                listYearsAll .Items .Add (i .ToString ());
            }
        }
        // -------------------------------------------------
        public Form_PersonalInfo_DependentFrame ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            mover .Clipping = Clipping .Safe;

            spaces = new Spaces (Auxi_Geometry .RoundMeasureString (this, "Any text") .Height);
            info = new TextM (this, new Point (textProvince .Right + 30, textProvince .Bottom), strInfo);
            info .BackColor = Color .FromArgb (255, 255, 128);

            ctrls = new Control [] {textName, textSurname,                                          // 0, 1
                                    textMonth, textDay, textYear,                                   // 2, 3, 4
                                    textProfession,                                                 // 5
                                    textHomePhone, textOfficePhone, textMobilePhone,                // 6, 7, 8
                                    textStreet, textTown, textProvince, textCountry, textZipCode};  // 9 - 13
            DefaultView ();
            RestoreFromRegistry ();
            if (views .Count > 0)
            {
                SetView (0);
            }
            RenewMover ();
        }
Пример #40
0
 public bool ChangeSpace(Spaces space)
 {
     RestRequest request = GeneratePost("/steam/space/");
     request.AddParameter("name", space.ToString().ToLower(), ParameterType.GetOrPost);
     return (ProcessRequest(request).StatusCode == HttpStatusCode.Accepted);
 }
Пример #41
0
        // -------------------------------------------------
        public Form_PanelsAndGroups ()
        {
            InitializeComponent ();
            //Font = new Font ("Times New Roman", 14);
            mover = new Mover (this);

            clrFrameLR = Auxi_Colours .IntermediateClr (0.7, BackColor, ControlPaint .Dark (BackColor));
            penFrameLR = new Pen (clrFrameLR);

            sizefTitleFramed = Auxi_Geometry .MeasureString (this, strTitle_Framed);
            sizeTitleUnframed = Size .Round (Auxi_Geometry .MeasureString (this, strTitle_Unframed));
            spaces = new Spaces (Convert .ToInt32 (Auxi_Geometry .MeasureString (this, strTitle_Framed) .Height));
            
            lrNoFrame = new LinkedRectangles (new Control [] { btnInsideClr, btnBorderClr, comboShape });
            lrNoFrame .Add (new Rectangle (btnInsideClr .Left, btnInsideClr .Top, btnBorderClr .Right - btnInsideClr .Left,
                                           comboShape .Top - btnInsideClr .Top - 3), "Picture");
            lrNoFrame .Add (new Rectangle (btnInsideClr .Left - 20, btnInsideClr .Top - sizeTitleUnframed .Height, 
                                           sizeTitleUnframed .Width, sizeTitleUnframed .Height), "Title");
            comboShape .SelectedIndex = (int) shape;

            Control [] cntrls = new Control [] { textBox3, listView4, button7, button8, textBox7, textBox6 };
            lrFramed = new LinkedRectangles (cntrls);
            Rectangle rcFrame = Auxi_Geometry .FrameAroundControls (cntrls, spaces);
            rcFrame .Inflate (3, 3);
            lrFramed .Add (rcFrame, "Area");

            rcFrame = Auxi_Geometry .FrameAroundControls (new Control [] { listView5, button9, button10 }, spaces);
            groupNonresizable = new GroupBoxMR (this, rcFrame, strTitleNR, MoveNonresizable);

            int minW = spaces .Left_inFrame + btnCommentClr .Width + btnCommentFont .Width + 2 * spaces .HorMin + 
                       btnAdd .Width + spaces .Right_inFrame;
            int minH = spaces .Top_inFrame + btnAdd .Height * 2 + spaces .VerMin + spaces .Btm_inFrame;
            rcFrame = Auxi_Geometry .FrameAroundControls (new Control [] { textNewComment, btnCommentClr, btnCommentFont, btnAdd }, spaces);
            groupNewCmnt = new GroupBoxMR (this, rcFrame, new RectRange (minW, 3 * minW, minH, 4 * minH), "Resizable GroupBoxMR", MoveResizable);
            ChatPolyRelativePosition ();
            rcFrame = Auxi_Geometry .FrameAroundControls (new Control [] {numericUD_ChatApexes, btnStartPolyClr, btnEndPolyClr, 
                                                                  btnChatPolyCenterClr, panelChatPolyCenterSample, btnAddChatPoly }, spaces);
            groupChatPoly = new Group (this, rcFrame, strChatPolyText [0], MoveChatPolyGroup);

            btnCommentFont_2 .Location = new Point (btnCommentClr_2 .Right, btnCommentClr_2 .Top);
            btnAdd_2 .Location = new Point (btnCommentFont_2 .Right + spaces .HorMin, btnCommentClr_2 .Top);
            int minH_textNewComment = 60;
            textNewComment_2 .Bounds = new Rectangle (btnCommentClr_2 .Left, btnCommentClr_2 .Top - (spaces .VerMin + minH_textNewComment),
                                                      btnAdd_2 .Right - btnCommentClr_2 .Left, minH_textNewComment);
            rcFrame = Auxi_Geometry .FrameAroundControls (new Control [] { textNewComment_2, btnCommentClr_2, btnCommentFont_2, btnAdd_2 }, spaces);
            groupNewCmnt_2 = new Group (this, rcFrame, 
                                        new RectRange (rcFrame .Width, 4 * rcFrame .Width, rcFrame .Height, 3 * rcFrame .Height),
                                        "Resizable Group", MoveNewGroup);

            List<ElementInsideDependentFrame> elemsDF = new List<ElementInsideDependentFrame> ();
            elemsDF .Add (new ElementInsideDependentFrame (textBox8));
            elemsDF .Add (new ElementInsideDependentFrame (button13));
            elemsDF .Add (new ElementInsideDependentFrame (button12));
            elemsDF .Add (new ElementInsideDependentFrame (button11));
            dfSimilar = new DependentFrame (this, elemsDF, spaces, "DependentFrame"); 

            string [] strs = new string [] { "Street", "Town", "Province", "Country", "ZIP code" };
            SizeF [] sizefStrs = Auxi_Geometry .MeasureStrings (this, strs);
            double fWidthMax = Auxi_Geometry .LongestString (this, strs);
            ccStreet = new CommentedControl (this, textStreet, -(fWidthMax + 4) + sizefStrs [0] .Width / 2, 0.5, strs [0]);
            ccTown = new CommentedControl (this, textTown, -(fWidthMax + 4) + sizefStrs [1] .Width / 2, 0.5, strs [1]);
            ccProvince = new CommentedControl (this, textProvince, -(fWidthMax + 4) + sizefStrs [2] .Width / 2, 0.5, strs [2]);
            ccCountry = new CommentedControl (this, textCountry, -(fWidthMax + 4) + sizefStrs [3] .Width / 2, 0.5, strs [3]);
            ccZipCode = new CommentedControl (this, textZipCode, -(fWidthMax + 4) + sizefStrs [4] .Width / 2, 0.5, strs [4]);
            List<ElementInsideDependentFrame> elemsAddress = new List<ElementInsideDependentFrame> ();
            elemsAddress .Add (new ElementInsideDependentFrame (ccStreet));
            elemsAddress .Add (new ElementInsideDependentFrame (ccTown));
            elemsAddress .Add (new ElementInsideDependentFrame (ccProvince));
            elemsAddress .Add (new ElementInsideDependentFrame (ccCountry));
            elemsAddress .Add (new ElementInsideDependentFrame (ccZipCode));
            dfAddress = new DependentFrame (this, elemsAddress, spaces, "DependentFrame", StringAlignment .Far, 4);

            CreateInfo (spaces .FormSideSpace, panelResizable .Bottom + spaces .Ver_betweenFrames);

            RenewMover ();
        }