Beispiel #1
0
        private void InitializeStyle()
        {
            ThumbImageView.TintColor = ThemeColors.BorderLight;

            ThumbLabel.Font      = Theme.VenueShowLogoFont;
            ThumbLabel.TextColor = ThemeColors.ContentDarkText;

            TitleLabel.Font      = Theme.ContentFont;
            TitleLabel.TextColor = ThemeColors.ContentLightText;

            NavigateOnMapButton.SetImage(ThemeIcons.MapPinSmall, UIControlState.Normal);
            LocationLabel.Font      = Theme.VenueShowDescriptionFont;
            LocationLabel.TextColor = ThemeColors.ContentLightTextPassive;

            DescriptionLabel.Font      = Theme.VenueShowDescriptionFont;
            DescriptionLabel.TextColor = ThemeColors.ContentLightTextPassive;

            StartTimeLabel.Font      = Theme.VenueShowTimeFont;
            StartTimeLabel.TextColor = ThemeColors.ContentLightTextPassive;

            EndTimeLabel.Font      = Theme.VenueShowTimeFont;
            EndTimeLabel.TextColor = ThemeColors.BorderLight;

            DetailsButton.SetImage(ThemeIcons.Info, UIControlState.Normal);
            DetailsButton.TintColor = ThemeColors.Action;

            DetailsLabel.Font      = Theme.VenueShowDetailsFont;
            DetailsLabel.TextColor = ThemeColors.Action;

            Separator.BackgroundColor      = ThemeColors.ContentLightBackground;
            BackgroundView.BackgroundColor = ThemeColors.ContentLightBackground;
        }
Beispiel #2
0
        private void UpdateVisibility(bool animated)
        {
            if (DataContext == null)
            {
                return;
            }

            ThumbImageView.SetHidden(!DataContext.IsLogoVisible, animated);
            ThumbLabel.SetHidden(IsExpanded || !DataContext.IsLogoVisible || DataContext.Show.HasPictures(), animated);

            StartTimeLabel.SetHidden(!DataContext.IsTimeVisible, animated);
            EndTimeLabel.SetHidden(!DataContext.IsTimeVisible, animated);

            EndTimeLabel.TextColor = IsExpanded ? ThemeColors.ContentLightTextPassive : ThemeColors.BorderLight;

            var isLocationHidden = !IsExpanded || !DataContext.IsLocationAvailable;

            NavigateOnMapButton.SetHidden(isLocationHidden, animated);
            LocationLabel.SetHidden(isLocationHidden, animated);

            var isDescriptionHidden = !IsExpanded || GetShowDescription(DataContext.Show, !DataContext.IsTimeVisible) == null;

            DescriptionLabel.SetHidden(isDescriptionHidden, animated);

            var isDetailsHidden = !IsExpanded || !DataContext.Show.HasDetailsUrl();

            DetailsLabel.SetHidden(isDetailsHidden, animated);
            DetailsButton.SetHidden(isDetailsHidden, animated);
        }
Beispiel #3
0
        void ReleaseDesignerOutlets()
        {
            if (DetailsButton != null)
            {
                DetailsButton.Dispose();
                DetailsButton = null;
            }

            if (FirstButton != null)
            {
                FirstButton.Dispose();
                FirstButton = null;
            }

            if (GetPhotoButton != null)
            {
                GetPhotoButton.Dispose();
                GetPhotoButton = null;
            }

            if (Parameter != null)
            {
                Parameter.Dispose();
                Parameter = null;
            }
        }
Beispiel #4
0
 private void RefreshButton_Click(object sender, EventArgs e)
 {
     nested = 0;
     BackButton.Hide();
     CancelButton.Hide();
     DetailsButton.Show();
     this.RefreshUsers();
 }
Beispiel #5
0
 public void Login(string login, string password)
 {
     Activate();
     DetailsButton.Click();
     UserNameTextBox.TextValue = login;
     PasswordTextBox.Click();
     PasswordTextBox.PressKeys(password);
     LoginButton.Click();
 }
Beispiel #6
0
        /// <summary>
        /// Gets the activation link.
        /// </summary>
        /// <param name="email">The email.</param>
        /// <returns>System.String.</returns>
        public string GetActivationLink(string email)
        {
            EmailSearch.SendKeys(email);
            DetailsButton.Click();
            var input  = HTMLBody.Text;
            var result = input.Split(new[] { "href=\"" }, StringSplitOptions.None)[1]
                         .Split('"')[0]
                         .Trim();

            return(result);
        }
        public void DetailsButtonAccessibleObject_Ctor_Default()
        {
            using PropertyGrid propertyGrid   = new PropertyGrid();
            using GridErrorDlg gridErrorDlg   = new GridErrorDlg(propertyGrid);
            using DetailsButton detailsButton = new DetailsButton(gridErrorDlg);
            DetailsButton.DetailsButtonAccessibleObject accessibleObject = new DetailsButton.DetailsButtonAccessibleObject(detailsButton);

            Assert.Equal(detailsButton, accessibleObject.Owner);
            Assert.False(propertyGrid.IsHandleCreated);
            Assert.False(gridErrorDlg.IsHandleCreated);
            Assert.False(detailsButton.IsHandleCreated);
        }
        public void DetailsButtonAccessibleObject_ControlType_IsButton_IfAccessibleRoleIsDefault()
        {
            using PropertyGrid propertyGrid   = new PropertyGrid();
            using GridErrorDlg gridErrorDlg   = new GridErrorDlg(propertyGrid);
            using DetailsButton detailsButton = new DetailsButton(gridErrorDlg);
            // AccessibleRole is not set = Default

            object actual = detailsButton.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId);

            Assert.Equal(UiaCore.UIA.ButtonControlTypeId, actual);
            Assert.False(propertyGrid.IsHandleCreated);
            Assert.False(gridErrorDlg.IsHandleCreated);
            Assert.False(detailsButton.IsHandleCreated);
        }
        public void DetailsButtonAccessibleObject_Role_IsPushButton_ByDefault(bool createControl, AccessibleRole expectedRole)
        {
            using PropertyGrid propertyGrid   = new PropertyGrid();
            using GridErrorDlg gridErrorDlg   = new GridErrorDlg(propertyGrid);
            using DetailsButton detailsButton = new DetailsButton(gridErrorDlg);
            // AccessibleRole is not set = Default

            if (createControl)
            {
                detailsButton.CreateControl();
            }

            AccessibleRole actual = detailsButton.AccessibilityObject.Role;

            Assert.Equal(expectedRole, actual);
            Assert.False(propertyGrid.IsHandleCreated);
            Assert.False(gridErrorDlg.IsHandleCreated);
            Assert.Equal(createControl, detailsButton.IsHandleCreated);
        }
Beispiel #10
0
        void ReleaseDesignerOutlets()
        {
            if (BottomBorderLeftConstraint != null)
            {
                BottomBorderLeftConstraint.Dispose();
                BottomBorderLeftConstraint = null;
            }

            if (DescriptionAndDetailsSpaceConstraint != null)
            {
                DescriptionAndDetailsSpaceConstraint.Dispose();
                DescriptionAndDetailsSpaceConstraint = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (DetailsButton != null)
            {
                DetailsButton.Dispose();
                DetailsButton = null;
            }

            if (DetailsLabel != null)
            {
                DetailsLabel.Dispose();
                DetailsLabel = null;
            }

            if (EndTimeLabel != null)
            {
                EndTimeLabel.Dispose();
                EndTimeLabel = null;
            }

            if (LocationAndDescriptionConstraint != null)
            {
                LocationAndDescriptionConstraint.Dispose();
                LocationAndDescriptionConstraint = null;
            }

            if (LocationLabel != null)
            {
                LocationLabel.Dispose();
                LocationLabel = null;
            }

            if (NavigateOnMapButton != null)
            {
                NavigateOnMapButton.Dispose();
                NavigateOnMapButton = null;
            }

            if (Separator != null)
            {
                Separator.Dispose();
                Separator = null;
            }

            if (StarButton != null)
            {
                StarButton.Dispose();
                StarButton = null;
            }

            if (StartTimeLabel != null)
            {
                StartTimeLabel.Dispose();
                StartTimeLabel = null;
            }

            if (ThumbHeightConstraint != null)
            {
                ThumbHeightConstraint.Dispose();
                ThumbHeightConstraint = null;
            }

            if (ThumbImageView != null)
            {
                ThumbImageView.Dispose();
                ThumbImageView = null;
            }

            if (ThumbLabel != null)
            {
                ThumbLabel.Dispose();
                ThumbLabel = null;
            }

            if (ThumbLabelView != null)
            {
                ThumbLabelView.Dispose();
                ThumbLabelView = null;
            }

            if (ThumbLeftConstraint != null)
            {
                ThumbLeftConstraint.Dispose();
                ThumbLeftConstraint = null;
            }

            if (ThumbTopConstraint != null)
            {
                ThumbTopConstraint.Dispose();
                ThumbTopConstraint = null;
            }

            if (ThumbWidthConstraint != null)
            {
                ThumbWidthConstraint.Dispose();
                ThumbWidthConstraint = null;
            }

            if (TimeBackgroundView != null)
            {
                TimeBackgroundView.Dispose();
                TimeBackgroundView = null;
            }

            if (TimeTopConstraint != null)
            {
                TimeTopConstraint.Dispose();
                TimeTopConstraint = null;
            }

            if (TitleAndLocationConstraint != null)
            {
                TitleAndLocationConstraint.Dispose();
                TitleAndLocationConstraint = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (TitleLeftConstraint != null)
            {
                TitleLeftConstraint.Dispose();
                TitleLeftConstraint = null;
            }
        }
Beispiel #11
0
        private Panel BuildSettingPanel(Rectangle panelBounds)
        {
            var etPanel = new Panel()
            {
                CanScroll = false,
                Size      = panelBounds.Size
            };

            var eventPanel = new FlowPanel()
            {
                FlowDirection  = ControlFlowDirection.LeftToRight,
                ControlPadding = new Vector2(8, 8),
                Location       = new Point(etPanel.Width - 720 - 10 - 20, 50),
                Size           = new Point(748, etPanel.Size.Y - 50 - Panel.BOTTOM_MARGIN),
                Parent         = etPanel,
                CanScroll      = true,
            };

            var ddSortMethod = new Dropdown()
            {
                Parent   = etPanel,
                Location = new Point(etPanel.Right - 150 - 10, 5),
                Width    = 150
            };

            foreach (var meta in Meta.Events)
            {
                var setting = allSettings.DefineSetting("watchEvent:" + meta.Name, true, true, false, "");

                meta.IsWatched = setting.Value;

                var es2 = new DetailsButton {
                    Parent           = eventPanel,
                    BasicTooltipText = meta.Category,
                    Text             = meta.Name,
                    IconSize         = DetailsIconSize.Small,
                    Icon             = string.IsNullOrEmpty(meta.Icon) ? null : GameService.Content.GetTexture(meta.Icon),
                    ShowVignette     = false,
                    HighlightType    = DetailsHighlightType.LightHighlight,
                    ShowToggleButton = true
                };

                var nextTimeLabel = new Label()
                {
                    Size                = new Point(65, es2.ContentRegion.Height),
                    Text                = meta.NextTime.ToShortTimeString(),
                    BasicTooltipText    = GetTimeDetails(meta),
                    HorizontalAlignment = DrawUtil.HorizontalAlignment.Center,
                    VerticalAlignment   = DrawUtil.VerticalAlignment.Middle,
                    Parent              = es2,
                };

                Adhesive.Binding.CreateOneWayBinding(() => nextTimeLabel.Height, () => es2.ContentRegion, (rectangle => rectangle.Height), true);

                if (!string.IsNullOrEmpty(meta.Wiki))
                {
                    var glowWikiBttn = new GlowButton {
                        Icon             = GameService.Content.GetTexture("102530"),
                        ActiveIcon       = GameService.Content.GetTexture("glow-wiki"),
                        BasicTooltipText = "Read about this event on the wiki.",
                        Parent           = es2,
                        GlowColor        = Color.White * 0.1f
                    };

                    glowWikiBttn.Click += delegate {
                        if (Url.IsValid(meta.Wiki))
                        {
                            Process.Start(meta.Wiki);
                        }
                    };
                }

                if (!string.IsNullOrEmpty(meta.Waypoint))
                {
                    var glowWaypointBttn = new GlowButton {
                        Icon             = GameService.Content.GetTexture("waypoint"),
                        ActiveIcon       = GameService.Content.GetTexture("glow-waypoint"),
                        BasicTooltipText = $"Nearby waypoint: {meta.Waypoint}",
                        Parent           = es2,
                        GlowColor        = Color.White * 0.1f
                    };

                    glowWaypointBttn.Click += delegate {
                        System.Windows.Forms.Clipboard.SetText(meta.Waypoint);

                        Controls.Notification.ShowNotification(GameService.Content.GetTexture("waypoint"), "Waypoint copied to clipboard.", 2);
                    };
                }

                var toggleFollowBttn = new GlowButton()
                {
                    Icon             = GameService.Content.GetTexture("605021"),
                    ActiveIcon       = GameService.Content.GetTexture("605019"),
                    BasicTooltipText = "Click to toggle tracking for this event.",
                    ToggleGlow       = true,
                    Checked          = meta.IsWatched,
                    Parent           = es2,
                };

                toggleFollowBttn.Click += delegate {
                    meta.IsWatched = toggleFollowBttn.Checked;
                    setting.Value  = toggleFollowBttn.Checked;
                };

                meta.OnNextRunTimeChanged += delegate {
                    UpdateSort(ddSortMethod, EventArgs.Empty);

                    nextTimeLabel.Text             = meta.NextTime.ToShortTimeString();
                    nextTimeLabel.BasicTooltipText = GetTimeDetails(meta);
                };

                displayedEvents.Add(es2);
            }

            var menuSection = new Panel {
                ShowBorder = true,
                Size       = new Point(etPanel.Width - 720 - 10 - 10 - 5 - 20, eventPanel.Height + Panel.BOTTOM_MARGIN),
                Location   = new Point(5, 50),
                Parent     = etPanel,
                Title      = "Event Categories"
            };

            // Add menu items for each category (and built-in categories)
            var eventCategories = new Menu {
                Size           = menuSection.ContentRegion.Size,
                MenuItemHeight = 40,
                Parent         = menuSection,
            };

            List <IGrouping <string, Meta> > submetas = Meta.Events.GroupBy(e => e.Category).ToList();

            var evAll = eventCategories.AddMenuItem(EC_ALLEVENTS);

            evAll.LeftMouseButtonReleased += delegate {
                displayedEvents.ForEach(de => { de.Visible = true; });

                //RepositionES();
            };

            foreach (IGrouping <string, Meta> e in submetas)
            {
                var ev = eventCategories.AddMenuItem(e.Key);
                ev.LeftMouseButtonReleased += delegate {
                    //displayedEvents.ForEach(de => { de.Visible = de.AssignedMeta.Category == e.Key; });

                    //RepositionES();
                };
            }

            // TODO: Hidden events/timers to be added later
            //eventCategories.AddMenuItem(EC_HIDDEN);

            // Add dropdown for sorting events
            ddSortMethod.Items.Add(DD_ALPHABETICAL);
            ddSortMethod.Items.Add(DD_NEXTUP);

            ddSortMethod.ValueChanged += UpdateSort;

            ddSortMethod.SelectedItem = DD_NEXTUP;
            UpdateSort(ddSortMethod, EventArgs.Empty);

            Console.WriteLine("Main Panel is: " + etPanel.Location.ToString() + " :: " + etPanel.Size.ToString());
            Console.WriteLine("Event Panel is: " + eventPanel.Location.ToString() + " :: " + eventPanel.Size.ToString());
            Console.WriteLine("Menu Section Panel is: " + menuSection.Location.ToString() + " :: " + eventPanel.Size.ToString());

            return(etPanel);
        }
 private void InitializeComponent()
 {
     this._chooseLabel = new System.Windows.Forms.Label();
     this._connectionsComboBox = new AutoSizeComboBox();
     this._newConnectionButton = new System.Windows.Forms.Button();
     this._connectionTableLayoutPanel = new TableLayoutPanel();
     this._detailsButton = new DetailsButton();
     this._connectionStringLabel = new System.Windows.Forms.Label();
     this._dividerLabel = new System.Windows.Forms.Label();
     this._connectionStringTextBox = new System.Windows.Forms.TextBox();
     this._connectionTableLayoutPanel.SuspendLayout();
     base.SuspendLayout();
     this._chooseLabel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._chooseLabel.Location = new Point(0, 0);
     this._chooseLabel.Name = "_chooseLabel";
     this._chooseLabel.Size = new Size(0x220, 0x10);
     this._chooseLabel.TabIndex = 10;
     this._connectionTableLayoutPanel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._connectionTableLayoutPanel.ColumnCount = 2;
     this._connectionTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
     this._connectionTableLayoutPanel.ColumnStyles.Add(new ColumnStyle());
     this._connectionTableLayoutPanel.Controls.Add(this._newConnectionButton, 1, 0);
     this._connectionTableLayoutPanel.Controls.Add(this._connectionsComboBox, 0, 0);
     this._connectionTableLayoutPanel.Location = new Point(0, 0x12);
     this._connectionTableLayoutPanel.Name = "_connectionTableLayoutPanel";
     this._connectionTableLayoutPanel.RowCount = 1;
     this._connectionTableLayoutPanel.RowStyles.Add(new RowStyle());
     this._connectionTableLayoutPanel.Size = new Size(0x220, 0x17);
     this._connectionTableLayoutPanel.TabIndex = 20;
     this._connectionsComboBox.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._connectionsComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
     this._connectionsComboBox.Location = new Point(0, 0);
     this._connectionsComboBox.Margin = new Padding(0, 0, 3, 0);
     this._connectionsComboBox.Name = "_connectionsComboBox";
     this._connectionsComboBox.Size = new Size(0x1cf, 0x15);
     this._connectionsComboBox.Sorted = true;
     this._connectionsComboBox.TabIndex = 10;
     this._connectionsComboBox.SelectedIndexChanged += new EventHandler(this.OnConnectionsComboBoxSelectedIndexChanged);
     this._newConnectionButton.AutoSize = true;
     this._newConnectionButton.AutoSizeMode = AutoSizeMode.GrowAndShrink;
     this._newConnectionButton.Location = new Point(0x1d5, 0);
     this._newConnectionButton.Margin = new Padding(3, 0, 0, 0);
     this._newConnectionButton.MinimumSize = new Size(0x4b, 0x17);
     this._newConnectionButton.Name = "_newConnectionButton";
     this._newConnectionButton.Padding = new Padding(10, 0, 10, 0);
     this._newConnectionButton.Size = new Size(0x4b, 0x17);
     this._newConnectionButton.TabIndex = 20;
     this._newConnectionButton.Click += new EventHandler(this.OnNewConnectionButtonClick);
     this._detailsButton.Location = new Point(0, 0x33);
     this._detailsButton.Name = "_detailsButton";
     this._detailsButton.Size = new Size(15, 15);
     this._detailsButton.TabIndex = 30;
     this._detailsButton.Click += new EventHandler(this.OnDetailsButtonClick);
     this._connectionStringLabel.AutoSize = true;
     this._connectionStringLabel.Location = new Point(0x15, 0x33);
     this._connectionStringLabel.Name = "_connectionStringLabel";
     this._connectionStringLabel.Padding = new Padding(0, 0, 6, 0);
     this._connectionStringLabel.Size = new Size(0x5c, 0x10);
     this._connectionStringLabel.TabIndex = 40;
     this._dividerLabel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._dividerLabel.BackColor = SystemColors.ControlDark;
     this._dividerLabel.Location = new Point(30, 0x39);
     this._dividerLabel.Name = "_dividerLabel";
     this._dividerLabel.Size = new Size(0x202, 1);
     this._dividerLabel.TabIndex = 50;
     this._connectionStringTextBox.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._connectionStringTextBox.BackColor = SystemColors.Control;
     this._connectionStringTextBox.Location = new Point(0x15, 0x47);
     this._connectionStringTextBox.Multiline = true;
     this._connectionStringTextBox.Name = "_connectionStringTextBox";
     this._connectionStringTextBox.ReadOnly = true;
     this._connectionStringTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
     this._connectionStringTextBox.Size = new Size(0x20b, 90);
     this._connectionStringTextBox.TabIndex = 60;
     this._connectionStringTextBox.Text = "";
     this._connectionStringTextBox.Visible = false;
     base.Controls.Add(this._connectionStringLabel);
     base.Controls.Add(this._dividerLabel);
     base.Controls.Add(this._detailsButton);
     base.Controls.Add(this._connectionStringTextBox);
     base.Controls.Add(this._chooseLabel);
     base.Controls.Add(this._connectionTableLayoutPanel);
     base.Name = "SqlDataSourceDataConnectionChooserPanel";
     base.Size = new Size(0x220, 0x112);
     this._connectionTableLayoutPanel.ResumeLayout(false);
     this._connectionTableLayoutPanel.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
        private Panel BuildSettingPanel(Rectangle panelBounds)
        {
            var etPanel = new Panel()
            {
                CanScroll = false,
                Size      = panelBounds.Size
            };

            var ddSortMethod = new Dropdown()
            {
                Location = new Point(etPanel.Right - 150 - Dropdown.Standard.ControlOffset.X, Dropdown.Standard.ControlOffset.Y),
                Width    = 150,
                Parent   = etPanel,
            };

            int topOffset = ddSortMethod.Bottom + Panel.MenuStandard.ControlOffset.Y;

            var menuSection = new Panel {
                Title      = "Event Categories",
                ShowBorder = true,
                Size       = Panel.MenuStandard.Size - new Point(0, topOffset + Panel.MenuStandard.ControlOffset.Y),
                Location   = new Point(Panel.MenuStandard.PanelOffset.X, topOffset),
                Parent     = etPanel
            };

            var eventPanel = new FlowPanel()
            {
                FlowDirection  = ControlFlowDirection.LeftToRight,
                ControlPadding = new Vector2(8, 8),
                Location       = new Point(menuSection.Right + Panel.MenuStandard.ControlOffset.X, menuSection.Top),
                Size           = new Point(ddSortMethod.Right - menuSection.Right - Control.ControlStandard.ControlOffset.X, menuSection.Height),
                CanScroll      = true,
                Parent         = etPanel
            };

            GameService.Overlay.QueueMainThreadUpdate((gameTime) => {
                var searchBox = new TextBox()
                {
                    PlaceholderText = "Event Search",
                    Width           = menuSection.Width,
                    Location        = new Point(ddSortMethod.Top, menuSection.Left),
                    Parent          = etPanel
                };

                searchBox.TextChanged += delegate(object sender, EventArgs args) {
                    eventPanel.FilterChildren <DetailsButton>(db => db.Text.ToLower().Contains(searchBox.Text.ToLower()));
                };
            });

            foreach (var meta in Meta.Events)
            {
                var setting = _watchCollection.DefineSetting("watchEvent:" + meta.Name, true);

                meta.IsWatched = setting.Value;

                var es2 = new DetailsButton {
                    Parent           = eventPanel,
                    BasicTooltipText = meta.Category,
                    Text             = meta.Name,
                    IconSize         = DetailsIconSize.Small,
                    ShowVignette     = false,
                    HighlightType    = DetailsHighlightType.LightHighlight,
                    ShowToggleButton = true
                };

                if (meta.Texture.HasTexture)
                {
                    es2.Icon = meta.Texture;
                }

                var nextTimeLabel = new Label()
                {
                    Size                = new Point(65, es2.ContentRegion.Height),
                    Text                = meta.NextTime.ToShortTimeString(),
                    BasicTooltipText    = GetTimeDetails(meta),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Middle,
                    Parent              = es2,
                };

                Adhesive.Binding.CreateOneWayBinding(() => nextTimeLabel.Height, () => es2.ContentRegion, (rectangle => rectangle.Height), true);

                if (!string.IsNullOrEmpty(meta.Wiki))
                {
                    var glowWikiBttn = new GlowButton {
                        Icon             = GameService.Content.GetTexture("102530"),
                        ActiveIcon       = GameService.Content.GetTexture("glow-wiki"),
                        BasicTooltipText = "Read about this event on the wiki.",
                        Parent           = es2,
                        GlowColor        = Color.White * 0.1f
                    };

                    glowWikiBttn.Click += delegate {
                        if (UrlIsValid(meta.Wiki))
                        {
                            Process.Start(meta.Wiki);
                        }
                    };
                }

                if (!string.IsNullOrEmpty(meta.Waypoint))
                {
                    var glowWaypointBttn = new GlowButton {
                        Icon             = GameService.Content.GetTexture("waypoint"),
                        ActiveIcon       = GameService.Content.GetTexture("glow-waypoint"),
                        BasicTooltipText = $"Nearby waypoint: {meta.Waypoint}",
                        Parent           = es2,
                        GlowColor        = Color.White * 0.1f
                    };

                    glowWaypointBttn.Click += delegate {
                        System.Windows.Forms.Clipboard.SetText(meta.Waypoint);

                        ScreenNotification.ShowNotification("Waypoint copied to clipboard.");
                    };
                }

                var toggleFollowBttn = new GlowButton()
                {
                    Icon             = _textureWatch,
                    ActiveIcon       = _textureWatchActive,
                    BasicTooltipText = "Click to toggle tracking for this event.",
                    ToggleGlow       = true,
                    Checked          = meta.IsWatched,
                    Parent           = es2,
                };

                toggleFollowBttn.Click += delegate {
                    meta.IsWatched = toggleFollowBttn.Checked;
                    setting.Value  = toggleFollowBttn.Checked;
                };

                meta.OnNextRunTimeChanged += delegate {
                    UpdateSort(ddSortMethod, EventArgs.Empty);

                    nextTimeLabel.Text             = meta.NextTime.ToShortTimeString();
                    nextTimeLabel.BasicTooltipText = GetTimeDetails(meta);
                };

                _displayedEvents.Add(es2);
            }

            // Add menu items for each category (and built-in categories)
            var eventCategories = new Menu {
                Size           = menuSection.ContentRegion.Size,
                MenuItemHeight = 40,
                Parent         = menuSection,
                CanSelect      = true
            };

            List <IGrouping <string, Meta> > submetas = Meta.Events.GroupBy(e => e.Category).ToList();

            var evAll = eventCategories.AddMenuItem(EC_ALLEVENTS);

            evAll.Select();
            evAll.Click += delegate {
                eventPanel.FilterChildren <DetailsButton>(db => true);
            };

            foreach (IGrouping <string, Meta> e in submetas)
            {
                var ev = eventCategories.AddMenuItem(e.Key);
                ev.Click += delegate {
                    eventPanel.FilterChildren <DetailsButton>(db => string.Equals(db.BasicTooltipText, e.Key));
                };
            }

            // TODO: Hidden events/timers to be added later
            //eventCategories.AddMenuItem(EC_HIDDEN);

            // Add dropdown for sorting events
            ddSortMethod.Items.Add(DD_ALPHABETICAL);
            ddSortMethod.Items.Add(DD_NEXTUP);

            ddSortMethod.ValueChanged += delegate(object sender, ValueChangedEventArgs args) {
                switch (args.CurrentValue)
                {
                case DD_ALPHABETICAL:
                    eventPanel.SortChildren <DetailsButton>((db1, db2) => string.Compare(db1.Text, db2.Text, StringComparison.CurrentCultureIgnoreCase));
                    break;

                case DD_NEXTUP:
                    break;
                }
            };

            ddSortMethod.SelectedItem = DD_NEXTUP;
            //UpdateSort(ddSortMethod, EventArgs.Empty);

            return(etPanel);
        }
Beispiel #14
0
        private Panel BuildHomePanel(WindowBase wndw)
        {
            var tdPanel = new Panel()
            {
                CanScroll = false,
                Size      = wndw.ContentRegion.Size
            };


            int topOffset = 40 + Panel.MenuStandard.ControlOffset.Y;

            var menuSection = new Panel
            {
                Title      = "Event Categories",
                ShowBorder = true,
                Size       = Panel.MenuStandard.Size - new Point(0, +topOffset + Panel.MenuStandard.ControlOffset.Y),
                Location   = new Point(Panel.MenuStandard.PanelOffset.X, topOffset),
                Parent     = tdPanel
            };
            var mainPanel = new FlowPanel()
            {
                FlowDirection = ControlFlowDirection.LeftToRight,
                Location      = new Point(menuSection.Right + Panel.MenuStandard.ControlOffset.X, menuSection.Top),
                Size          = new Point(tdPanel.Right - menuSection.Right - (Control.ControlStandard.ControlOffset.X * 2), menuSection.Height),
                CanScroll     = false,
                Parent        = tdPanel,
            };
            var taskPanel = new FlowPanel()
            {
                FlowDirection  = ControlFlowDirection.LeftToRight,
                ControlPadding = new Vector2(8, 8),
                //Location = new Point(menuSection.Right + Panel.MenuStandard.ControlOffset.X, menuSection.Top),
                Size      = new Point(tdPanel.Right - menuSection.Right - (Control.ControlStandard.ControlOffset.X * 2), menuSection.Height - 70),
                CanScroll = true,
                Parent    = mainPanel,
            };

            GameService.Overlay.QueueMainThreadUpdate((gameTime) => {
                var searchBox = new TextBox()
                {
                    PlaceholderText = "Filter Tasks",
                    Width           = menuSection.Width,
                    Location        = new Point(menuSection.Left, TextBox.Standard.ControlOffset.Y),
                    Parent          = tdPanel
                };

                searchBox.TextChanged += delegate(object sender, EventArgs args) {
                    taskPanel.FilterChildren <DetailsButton>(db => db.Text.ToLower().Contains(searchBox.Text.ToLower()));
                };
            });

            foreach (var task in tdTask.Tasks)
            {
                var es2 = new DetailsButton
                {
                    Parent           = taskPanel,
                    BasicTooltipText = task.Category,
                    Text             = task.Description,
                    IconSize         = DetailsIconSize.Small,
                    ShowVignette     = false,
                    HighlightType    = DetailsHighlightType.LightHighlight,
                    ShowToggleButton = true
                };

                if (task.Texture.HasTexture)
                {
                    es2.Icon = task.Texture;
                }
                _displayedTasks.Add(es2);
            }

            var actionPanel = new FlowPanel()
            {
                Size           = new Point(taskPanel.Width, 50),
                CanScroll      = false,
                FlowDirection  = ControlFlowDirection.LeftToRight,
                ShowBorder     = false,
                Parent         = mainPanel,
                ControlPadding = new Vector2(8, 8)

                                 //BackgroundColor = Microsoft.Xna.Framework.Color.Black
            };
            var newTaskButton = new StandardButton
            {
                Parent = actionPanel,
                Text   = "New Task"
            };

            //Create new panel to switch to
            var newtaskPanel = BuildNewTaskPanel(wndw);

            newTaskButton.LeftMouseButtonReleased += delegate { wndw.Navigate(newtaskPanel, true); };

            //Add categories
            var taskCategories = new Menu
            {
                Size           = menuSection.ContentRegion.Size,
                MenuItemHeight = 40,
                Parent         = menuSection,
                CanSelect      = true
            };

            List <IGrouping <string, tdTask> > submetas = tdTask.Tasks.GroupBy(e => e.Category).ToList();

            var evAll = taskCategories.AddMenuItem(EC_ALLEVENTS);

            evAll.Select();
            evAll.Click += delegate {
                taskPanel.FilterChildren <DetailsButton>(db => true);
            };
            foreach (IGrouping <string, tdTask> e in submetas)
            {
                var ev = taskCategories.AddMenuItem(e.Key);
                ev.Click += delegate {
                    taskPanel.FilterChildren <DetailsButton>(db => string.Equals(db.BasicTooltipText, e.Key));
                };
            }
            return(tdPanel);
        }
        public async Task ShowAsync(PhotoData photo)
        {
            if (photo == null || photo.Uri == null)
            {
                return;
            }

            Root.Opacity    = 0;
            Root.Visibility = Visibility.Visible;

            LoadingScreen.Opacity          = 1;
            LoadingScreen.IsHitTestVisible = true;
            ProgressRing.IsActive          = true;

            await Root.Scale(1.2f, 1.2f, (float)ActualWidth / 2, (float)ActualHeight / 2, 0).Then()
            .Fade(1).Scale(1, 1, (float)ActualWidth / 2, (float)ActualHeight / 2).StartAsync();

            _photo = photo;
            var uri = new Uri(photo.Uri);

            if (uri.IsFile)
            {
                _file = await StorageFile.GetFileFromPathAsync(photo.Uri);
            }
            else
            {
                _file = await StorageFile.CreateStreamedFileFromUriAsync("photo.jpg", uri, null);
            }

            if (_file == null)
            {
                Hide();
                return;
            }

            var stream = await _file.OpenReadAsync();

            _canvasImage = await CanvasBitmap.LoadAsync(ImageCanvas, stream);

            var imgBounds = _canvasImage.GetBounds(ImageCanvas);

            //var size = Math.Min(imgBounds.Height, imgBounds.Width);

            ImageCanvas.Height = 1200;
            ImageCanvas.Width  = 950;

            _selectedEffectType = EffectType.none;
            ImageCanvas.Invalidate();

            if (_photo.InkUri != null)
            {
                Inker.LoadInkFromFile(_photo.InkUri);
            }

            if (App.IsXbox())
            {
                DetailsButton.Focus(FocusState.Keyboard);
            }

            SetCanvasSize();

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            ((App)(App.Current)).BackRequested += PhotoPreviewView_BackRequested;

            SizeChanged           += PhotoPreviewView_SizeChanged;
            ImageRoot.SizeChanged += ImageRoot_SizeChanged;
            SetCanvasSize();

            LoadingScreen.Fade(0, 300).Start();
            ProgressRing.IsActive          = false;
            LoadingScreen.IsHitTestVisible = false;

            FinishedShowing?.Invoke(this, null);

            IsVisible = true;

            AnalyzeFaces();
        }
 public void ClickOnDetailsButton()
 {
     DetailsButton.Click();
     BackToPreviousLink.Click();
 }
 private void InitializeComponent()
 {
     this._chooseLabel                = new System.Windows.Forms.Label();
     this._connectionsComboBox        = new AutoSizeComboBox();
     this._newConnectionButton        = new System.Windows.Forms.Button();
     this._connectionTableLayoutPanel = new TableLayoutPanel();
     this._detailsButton              = new DetailsButton();
     this._connectionStringLabel      = new System.Windows.Forms.Label();
     this._dividerLabel               = new System.Windows.Forms.Label();
     this._connectionStringTextBox    = new System.Windows.Forms.TextBox();
     this._connectionTableLayoutPanel.SuspendLayout();
     base.SuspendLayout();
     this._chooseLabel.Anchor   = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._chooseLabel.Location = new Point(0, 0);
     this._chooseLabel.Name     = "_chooseLabel";
     this._chooseLabel.Size     = new Size(0x220, 0x10);
     this._chooseLabel.TabIndex = 10;
     this._connectionTableLayoutPanel.Anchor      = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._connectionTableLayoutPanel.ColumnCount = 2;
     this._connectionTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
     this._connectionTableLayoutPanel.ColumnStyles.Add(new ColumnStyle());
     this._connectionTableLayoutPanel.Controls.Add(this._newConnectionButton, 1, 0);
     this._connectionTableLayoutPanel.Controls.Add(this._connectionsComboBox, 0, 0);
     this._connectionTableLayoutPanel.Location = new Point(0, 0x12);
     this._connectionTableLayoutPanel.Name     = "_connectionTableLayoutPanel";
     this._connectionTableLayoutPanel.RowCount = 1;
     this._connectionTableLayoutPanel.RowStyles.Add(new RowStyle());
     this._connectionTableLayoutPanel.Size           = new Size(0x220, 0x17);
     this._connectionTableLayoutPanel.TabIndex       = 20;
     this._connectionsComboBox.Anchor                = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._connectionsComboBox.DropDownStyle         = ComboBoxStyle.DropDownList;
     this._connectionsComboBox.Location              = new Point(0, 0);
     this._connectionsComboBox.Margin                = new Padding(0, 0, 3, 0);
     this._connectionsComboBox.Name                  = "_connectionsComboBox";
     this._connectionsComboBox.Size                  = new Size(0x1cf, 0x15);
     this._connectionsComboBox.Sorted                = true;
     this._connectionsComboBox.TabIndex              = 10;
     this._connectionsComboBox.SelectedIndexChanged += new EventHandler(this.OnConnectionsComboBoxSelectedIndexChanged);
     this._newConnectionButton.AutoSize              = true;
     this._newConnectionButton.AutoSizeMode          = AutoSizeMode.GrowAndShrink;
     this._newConnectionButton.Location              = new Point(0x1d5, 0);
     this._newConnectionButton.Margin                = new Padding(3, 0, 0, 0);
     this._newConnectionButton.MinimumSize           = new Size(0x4b, 0x17);
     this._newConnectionButton.Name                  = "_newConnectionButton";
     this._newConnectionButton.Padding               = new Padding(10, 0, 10, 0);
     this._newConnectionButton.Size                  = new Size(0x4b, 0x17);
     this._newConnectionButton.TabIndex              = 20;
     this._newConnectionButton.Click                += new EventHandler(this.OnNewConnectionButtonClick);
     this._detailsButton.Location         = new Point(0, 0x33);
     this._detailsButton.Name             = "_detailsButton";
     this._detailsButton.Size             = new Size(15, 15);
     this._detailsButton.TabIndex         = 30;
     this._detailsButton.Click           += new EventHandler(this.OnDetailsButtonClick);
     this._connectionStringLabel.AutoSize = true;
     this._connectionStringLabel.Location = new Point(0x15, 0x33);
     this._connectionStringLabel.Name     = "_connectionStringLabel";
     this._connectionStringLabel.Padding  = new Padding(0, 0, 6, 0);
     this._connectionStringLabel.Size     = new Size(0x5c, 0x10);
     this._connectionStringLabel.TabIndex = 40;
     this._dividerLabel.Anchor            = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._dividerLabel.BackColor         = SystemColors.ControlDark;
     this._dividerLabel.Location          = new Point(30, 0x39);
     this._dividerLabel.Name                  = "_dividerLabel";
     this._dividerLabel.Size                  = new Size(0x202, 1);
     this._dividerLabel.TabIndex              = 50;
     this._connectionStringTextBox.Anchor     = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this._connectionStringTextBox.BackColor  = SystemColors.Control;
     this._connectionStringTextBox.Location   = new Point(0x15, 0x47);
     this._connectionStringTextBox.Multiline  = true;
     this._connectionStringTextBox.Name       = "_connectionStringTextBox";
     this._connectionStringTextBox.ReadOnly   = true;
     this._connectionStringTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
     this._connectionStringTextBox.Size       = new Size(0x20b, 90);
     this._connectionStringTextBox.TabIndex   = 60;
     this._connectionStringTextBox.Text       = "";
     this._connectionStringTextBox.Visible    = false;
     base.Controls.Add(this._connectionStringLabel);
     base.Controls.Add(this._dividerLabel);
     base.Controls.Add(this._detailsButton);
     base.Controls.Add(this._connectionStringTextBox);
     base.Controls.Add(this._chooseLabel);
     base.Controls.Add(this._connectionTableLayoutPanel);
     base.Name = "SqlDataSourceDataConnectionChooserPanel";
     base.Size = new Size(0x220, 0x112);
     this._connectionTableLayoutPanel.ResumeLayout(false);
     this._connectionTableLayoutPanel.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }