상속: MonoBehaviour
예제 #1
0
                public BadPerson()
                {

                        
                        this.Width = Dimensions.GetWidth() / 4;
                        this.Height = Dimensions.GetHeight() / 5;

                        this.WindowStyle = System.Windows.WindowStyle.None;
                        this.ResizeMode = System.Windows.ResizeMode.NoResize;
                        this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                        this.Background = Palette2.GetColor(Palette2.MIDNIGHT_BLUE);

                        _block = new TextBlock();
                        _block.Text = "You are a bad person. ";
                        _block.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
                        _block.FontSize = 30;
                        _block.FontFamily = FontProvider._lato;
                        _block.Foreground = ThemeSelector.GetAccentColor();
                        _block.Margin = new Thickness(0, this.Height / 10, 0, 0);

                        _badButton = new CancelButton(ControlsValues.BAD, this.Width * 0.75, this.Width / 6, new Thickness(0, this.Width / 20, 0, 0), new Thickness(0, this.Width / 30, 0, 0), HorizontalAlignment.Center);
                        _badButton.MouseDown += _badButton_MouseDown;

                        _container = new StackPanel();
                        _container.Orientation = Orientation.Vertical;

                        _container.Children.Add(_block);
                        _container.Children.Add(_badButton);

                        this.AddChild(_container);
                        this.Show();
                }
예제 #2
0
        public CustomButtonAdapter(CustomButtonRenderer renderer)
        {
            Verify.Argument.IsNotNull(renderer, "renderer");

            _button = new CustomButton()
            {
                Renderer = renderer,
            };
            _button.Click += OnButtonClick;
        }
예제 #3
0
        public MainPage()
        {
            CustomButton button = new CustomButton
            {
                Text = "Custom Button",
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Button)),
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Fill
            };

            button.Clicked += (sender, args) =>
            {
                DisplayAlert("Congratulations", "This button was rendered in a platform-specific class.", "OK");
            };

            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Children = {
                    button
				}
            };

        }
예제 #4
0
        public AboutAppPage()
        {
            Title = AppResources.AboutTitle;

            var generalViewSize = 150;
            var iconImage       = new Image
            {
                Source = ImageSource.FromResource("App2Night.Data.Image.icon.png"),
                Margin = new Thickness(8)
            };
            var generalView = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(generalViewSize * 0.66, GridUnitType.Absolute)
                    },
                },
                Children =
                {
                    new Label
                    {
                        Text   = AppResources.GeneralInfo,
                        Margin = new Thickness(15, 5)
                    },
                    { iconImage, 1, 0 }
                }
            };

            var projectViewHeight = 120;
            var projectLabel      = new Label
            {
                Text   = AppResources.GeneralContent,
                Margin = new Thickness(15, 5)
            };
            var githubIconLabel = new CustomButton
            {
                FontFamily = "FontAwesome",
                Text       = "\uf09b",
                FontSize   = 80,
                Margin     = new Thickness(5)
            };

            githubIconLabel.SetBinding(CustomButton.CommandProperty, "OpenProjectSiteCommand");

            var projectView = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(projectViewHeight, GridUnitType.Absolute)
                    },
                },
                Children =
                {
                    projectLabel,
                    { githubIconLabel, 1, 0 }
                }
            };

            var tableRoot = new TableRoot
            {
                new List <TableSection>
                {
                    new TableSection(AppResources.General)                     //General
                    {
                        new ViewCell {
                            View = generalView, Height = generalViewSize
                        }
                    },
                    new TableSection(AppResources.Project)                     //Project
                    {
                        new ViewCell {
                            View = projectView, Height = projectViewHeight
                        }
                    },
                },
            };

            Content = new TableView(tableRoot)
            {
                HasUnevenRows = true
            };
        }
예제 #5
0
        Widget _buildTopView()
        {
            Widget leftWidget;

            switch (this.widget.viewModel.fromPage)
            {
            case FromPage.login: {
                leftWidget = new CustomButton(
                    onPressed: () => this.widget.actionModel.loginRouterPop(),
                    child: new Icon(
                        icon: Icons.arrow_back,
                        size: 24,
                        color: CColors.Icon
                        )
                    );
                break;
            }

            case FromPage.wechat: {
                leftWidget = new CustomButton(
                    onPressed: () => this.widget.actionModel.mainRouterPop(),
                    child: new Text(
                        "跳过",
                        style: CTextStyle.PLargeBody4
                        )
                    );
                break;
            }

            case FromPage.setting: {
                leftWidget = new CustomButton(
                    onPressed: () => this.widget.actionModel.mainRouterPop(),
                    child: new Icon(
                        icon: Icons.arrow_back,
                        size: 24,
                        color: CColors.Icon
                        )
                    );
                break;
            }

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(new Column(
                       crossAxisAlignment: CrossAxisAlignment.start,
                       children: new List <Widget> {
                new Container(
                    height: 44,
                    padding: EdgeInsets.only(8, 8, 8),
                    child: new Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: new List <Widget> {
                    leftWidget,
                    new CustomButton(
                        onPressed: () => this.widget.actionModel.openCreateUnityIdUrl(),
                        child: new Text(
                            "创建 Unity ID",
                            style: CTextStyle.PLargeMediumBlue
                            )
                        )
                }
                        )
                    ),
                new Container(height: 16),
                new Container(
                    padding: EdgeInsets.symmetric(horizontal: 16),
                    child: new Text(
                        this.widget.viewModel.fromPage == FromPage.login ? "登录你的Unity账号" : "绑定你的Unity账号",
                        style: CTextStyle.H2
                        )
                    )
            }
                       ));
        }
 public ButtomSomeInterface(CustomButton button)
     : base(button)
 {
 }
예제 #7
0
        public static void EditNote(NoteVM vm)
        {
            count_subtasks = 0;
            str            = null;
            str_old        = null;
            subtasksSL.Children.Clear();
            //subtasksSL.Children.Add(subdefaultSL);

            editnote          = vm;
            nameEntry.Text    = vm.Name;
            commentEntry.Text = vm.Comment;
            str_old           = vm.Subtasks_string;

            if (String.IsNullOrEmpty(str_old) == false)
            {
                string[] subtasks_array = str_old.Split(new char[] { '✖' });
                foreach (char s in str_old)
                {
                    if (s == '✖')
                    {
                        count_subtasks++;
                    }
                }

                for (int i = 1; i <= count_subtasks; i++)
                {
                    CustomButton donesubtaskButton = new CustomButton
                    {
                        FontSize          = 15,
                        WidthRequest      = 23,
                        FontFamily        = "Segoe MDL2 Assets",
                        HeightRequest     = 23,
                        BorderRadius      = 12,
                        BackgroundColor   = Color.White,
                        BorderWidth       = 1,
                        BorderColor       = Color.Gray,
                        HorizontalOptions = LayoutOptions.Center,
                        VerticalOptions   = LayoutOptions.Start,
                        Margin            = new Thickness(0, 5, 0, 0)
                    };
                    CustomEditor2 newsubtaskEditor = new CustomEditor2
                    {
                        Placeholder     = "Введите название",
                        FontFamily      = "Open Sans",
                        TextColor       = Color.FromHex("0D47A1"),
                        AutoSize        = EditorAutoSizeOption.TextChanges,
                        WidthRequest    = 282,
                        BackgroundColor = Color.Transparent,
                        Text            = subtasks_array[i - 1],
                    };

                    //if (Addition.IsStrikethrough(newsubtaskEditor.Text) == true)
                    //    donesubtaskButton.Text = "\uE73E";
                    if (subtasks_array[i - 1].StartsWith("➥") == true)
                    {
                        donesubtaskButton.Text = "\uE73E";
                        newsubtaskEditor.Text  = newsubtaskEditor.Text.Remove(0, 1);
                    }

                    Label removesubtaskLabel = new Label
                    {
                        FontFamily = "Segoe MDL2 Assets",
                        Text       = "\uE894",
                        HorizontalTextAlignment = TextAlignment.Center,
                        VerticalTextAlignment   = TextAlignment.Center,
                        BackgroundColor         = Color.Transparent,
                        Margin            = new Thickness(-6, 7, 0, 0),
                        TextColor         = Color.Gray,
                        WidthRequest      = 35,
                        HorizontalOptions = LayoutOptions.EndAndExpand,
                        VerticalOptions   = LayoutOptions.Start,
                    };
                    StackLayout newsubtaskSL = new StackLayout
                    {
                        Children    = { donesubtaskButton, newsubtaskEditor, removesubtaskLabel },
                        Orientation = StackOrientation.Horizontal,
                        Margin      = 0
                    };
                    newsubtaskEditor.TextChanged += (sender2, e2) =>
                    {
                        if (String.IsNullOrWhiteSpace(newsubtaskEditor.Text) == false)
                        {
                            newsubtaskEditor.Text = newsubtaskEditor.Text.Substring(0, 1).ToUpper() + newsubtaskEditor.Text.Remove(0, 1);
                        }
                        else
                        {
                            donesubtaskButton.Text = "";
                            newsubtaskEditor.Text  = newsubtaskEditor.Text.TrimStart();
                        }
                    };

                    if (subtasksSL.Children.Count > 1)
                    {
                        subtasksSL.Children.Remove(subdefaultSL);
                    }

                    subtasksSL.Children.Add(newsubtaskSL);
                    subtasksSL.Children.Add(subdefaultSL);

                    string str2 = subtasks_array[i - 1];
                    donesubtaskButton.Clicked += (sender3, e3) =>
                    {
                        if (String.IsNullOrWhiteSpace(newsubtaskEditor.Text) == false)
                        {
                            if (str2.StartsWith("➥") == true)
                            {
                                donesubtaskButton.Text = "";
                                //newsubtaskEditor.Text = newsubtaskEditor.Text.Remove(0, 1);
                                subtasks_array[i - 1] = str2.Remove(0, 1);
                            }
                            else
                            {
                                donesubtaskButton.Text = "\uE73E";
                                //newsubtaskEditor.Text = "➥"+ newsubtaskEditor.Text;
                                subtasks_array[i - 1] = "➥" + str2;
                            }

                            //if (Addition.IsStrikethrough(newsubtaskEditor.Text) == true)
                            //{
                            //    donesubtaskButton.Text = "";
                            //    newsubtaskEditor.Text = Addition.ConvertFromStrikethrough(newsubtaskEditor.Text);
                            //}
                            //else
                            //{
                            //    donesubtaskButton.Text = "\uE73E";
                            //    newsubtaskEditor.Text = Addition.ConvertToStrikethrough(newsubtaskEditor.Text);
                            //}
                        }
                    };
                    removesubtaskLabel.GestureRecognizers.Add(new TapGestureRecognizer
                    {
                        Command = new Command(() => { count_subtasks--; subtasksSL.Children.Remove(newsubtaskSL); })
                    });
                }
            }
            else
            {
                subtasksSL.Children.Add(subdefaultSL);
            }

            //(StackLayout.Children[0] as Label).Text = vm.Subtasks_string;
            //(newnoteSL.Children[0] as Label).Text = "сount: "+count_subtasks.ToString() +"\n"+
            //    "str: "+str+"\n"+
            //    "str_old: "+str_old;

            if (editnote.Date >= DateTime.Today)
            {
                datePicker.MinimumDate = DateTime.Today;
            }
            else
            {
                datePicker.MinimumDate = vm.Date;
            }
            datePicker.Date = vm.Date;

            foreach (Button btn in chooseColorSL.Children)
            {
                btn.Text       = "";
                lastButton_int = 0;
            }
            foreach (Button btn in chooseColorSL.Children)
            {
                if (Addition.HexConverter(btn.BackgroundColor) == vm.ColorMarker_string)
                {
                    btn.Text       = "\uE73E";
                    lastButton_int = btn.GetHashCode();
                    additionButton.BackgroundColor = btn.BackgroundColor;
                }
            }

            repeatSwitch.IsToggled = vm.Repeat;
            newnoteSL.IsVisible    = true;
            edit = true;
            removeButton.IsVisible       = true;
            addnewnoteButton.Text        = "Сохранить";
            MainPage_UWP.addImage.Source = "images/cross.png";
        }
예제 #8
0
        /// <summary>
        /// Initializes custom GUI
        /// </summary>
        private void InitializeCustom()
        {
            //
            // Control
            //
            Width  = 1000;
            Height = 600;
            //
            // pictureBoxOne shown on the left
            //
            pictureBoxOne            = new PictureBox();
            pictureBoxOne.Location   = new System.Drawing.Point(PICTUREBOX_OFFSET, 27 + PICTUREBOX_OFFSET);
            pictureBoxOne.Name       = "pictureBoxOne";
            pictureBoxOne.TabStop    = false;
            pictureBoxOne.BackColor  = themeBackgroundColorTwo;
            pictureBoxOne.SizeMode   = PictureBoxSizeMode.Zoom;
            pictureBoxOne.MouseMove += new MouseEventHandler(this.pictureBoxOne_MouseMove);
            //
            // ai panel shown on the right
            //
            aiPanel           = new Panel();
            aiPanel.Name      = "aiPanel";
            aiPanel.TabStop   = false;
            aiPanel.BackColor = themeBackgroundColorTwo;
            //
            // pictureBoxAI in ai panel
            //
            pictureBoxAI           = new PictureBox();
            pictureBoxAI.Location  = new Point(PICTUREBOX_OFFSET_HALF, PICTUREBOX_OFFSET_HALF);
            pictureBoxAI.Name      = "pictureBoxAI";
            pictureBoxAI.BackColor = Color.Black;
            pictureBoxAI.SizeMode  = PictureBoxSizeMode.Zoom;
            aiPanel.Controls.Add(pictureBoxAI);
            //
            // aiTextBox
            //
            aiTextBox             = new CustomTextBox();
            aiTextBox.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35)))));
            aiTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
            aiTextBox.Font        = new System.Drawing.Font("Microsoft YaHei UI", 9F,
                                                            System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            aiTextBox.Name      = "Title";
            aiTextBox.ReadOnly  = true;
            aiTextBox.Enabled   = false;
            aiTextBox.TabStop   = false;
            aiTextBox.Multiline = true;
            aiTextBox.Text      = "Hello there! :D";
            aiPanel.Controls.Add(aiTextBox);
            //
            // aiDetermineButton
            //
            aiDetermineButton                           = new CustomButton();
            aiDetermineButton.ForeColor                 = Color.Cyan;
            aiDetermineButton.BackgroundImageLayout     = System.Windows.Forms.ImageLayout.Zoom;
            aiDetermineButton.BackColor                 = aiTextBox.BackColor;
            aiDetermineButton.FlatAppearance.BorderSize = 0;
            aiDetermineButton.FlatStyle                 = System.Windows.Forms.FlatStyle.Flat;
            aiDetermineButton.Name                      = "aiDetermineButton";
            aiDetermineButton.TabStop                   = false;
            aiDetermineButton.Text                      = "\u2753";
            aiDetermineButton.UseMnemonic               = false;
            aiDetermineButton.UseVisualStyleBackColor   = true;
            aiDetermineButton.Click                    += new System.EventHandler(aiDetermineButton_Click);
            aiPanel.Controls.Add(aiDetermineButton);
            //
            // conext menu for pictureBoxOne
            //
            ContextMenu cm            = new ContextMenu();
            MenuItem    mnuClearImage = new MenuItem("Clear Drawing");

            mnuClearImage.Click += new EventHandler(mnuClearImage_Click);
            cm.MenuItems.Add(mnuClearImage);
            pictureBoxOne.ContextMenu = cm;
            //
            // panel1
            //
            panel           = new Panel();
            panel.BackColor = System.Drawing.Color.Transparent;
            panel.Controls.Add(this.menuStrip1);
            panel.Location = new System.Drawing.Point(0, 25);
            panel.Name     = "panel1";
            panel.Size     = new System.Drawing.Size(this.Width, this.Height - 25);
            panel.Controls.Add(pictureBoxOne);
            panel.Controls.Add(aiPanel);
            //
            // closeForm
            //
            closeForm                           = new CustomButton();
            closeForm.ForeColor                 = themeColor;
            closeForm.BackgroundImageLayout     = System.Windows.Forms.ImageLayout.Zoom;
            closeForm.FlatAppearance.BorderSize = 0;
            closeForm.FlatStyle                 = System.Windows.Forms.FlatStyle.Flat;
            closeForm.Location                  = new System.Drawing.Point(this.Width - 45, 0);
            closeForm.Name                      = "closeForm";
            closeForm.Size                      = new System.Drawing.Size(30, 25);
            closeForm.TabIndex                  = 6;
            closeForm.Text                      = "X";
            closeForm.UseVisualStyleBackColor   = true;
            closeForm.Click                    += new System.EventHandler(closeForm_Click);
            //
            // maxForm
            //
            maxForm                           = new CustomButton();
            maxForm.ForeColor                 = themeColor;
            maxForm.BackgroundImageLayout     = System.Windows.Forms.ImageLayout.Zoom;
            maxForm.FlatAppearance.BorderSize = 0;
            maxForm.FlatStyle                 = System.Windows.Forms.FlatStyle.Flat;
            maxForm.Location                  = new System.Drawing.Point(this.Width - 75, 0);
            maxForm.Name                      = "maxForm";
            maxForm.Size                      = new System.Drawing.Size(30, 25);
            maxForm.TabIndex                  = 5;
            maxForm.TabStop                   = false;
            maxForm.Text                      = "⎕";
            maxForm.UseMnemonic               = false;
            maxForm.UseVisualStyleBackColor   = true;
            maxForm.Click                    += new System.EventHandler(maxForm_Click);
            //
            // minForm
            //
            minForm                           = new CustomButton();
            minForm.ForeColor                 = themeColor;
            minForm.BackgroundImageLayout     = System.Windows.Forms.ImageLayout.Zoom;
            minForm.FlatAppearance.BorderSize = 0;
            minForm.FlatStyle                 = System.Windows.Forms.FlatStyle.Flat;
            minForm.Font                      = new System.Drawing.Font("Microsoft Sans Serif",
                                                                        BUTTON_FONT_SIZE, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            minForm.Location                = new System.Drawing.Point(this.Width - 105, 0);
            minForm.Name                    = "minForm";
            minForm.Size                    = new System.Drawing.Size(30, 25);
            minForm.TabIndex                = 4;
            minForm.TabStop                 = false;
            minForm.Text                    = "_";
            minForm.TextAlign               = System.Drawing.ContentAlignment.TopCenter;
            minForm.UseMnemonic             = false;
            minForm.UseVisualStyleBackColor = true;
            minForm.Click                  += new System.EventHandler(minForm_Click);
            //
            // title
            //
            title             = new TextBox();
            title.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35)))));
            title.BorderStyle = System.Windows.Forms.BorderStyle.None;
            title.Font        = new System.Drawing.Font("Microsoft YaHei UI", 9F,
                                                        System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            title.Location  = new System.Drawing.Point(LEFT_OFFSET, 4);
            title.Name      = "Title";
            title.Size      = new System.Drawing.Size(163, 16);
            title.ReadOnly  = true;
            title.Enabled   = false;
            title.TabStop   = false;
            title.ForeColor = themeColor;
            title.Text      = "Neural Network";
            //
            // ImageCompressor
            //
            Resize += new System.EventHandler(this.WindowResize);
            Controls.Add(panel);
            Controls.Add(maxForm);
            Controls.Add(title);
            Controls.Add(minForm);
            Controls.Add(closeForm);
            BackColor = Color.FromArgb(35, 35, 35);
        }
        Widget _buildHeadTop(bool isShowTitle, IEvent eventObj)
        {
            Widget shareWidget = new CustomButton(
                onPressed: () => this._showShareView(eventObj),
                child: new Container(
                    color: CColors.Transparent,
                    child: new Icon(Icons.share, size: 28,
                                    color: this._showNavBarShadow ? CColors.White : CColors.Icon))
                );
            Widget titleWidget = new Container();

            if (isShowTitle)
            {
                Widget child = new Container();
                if (this._isHaveTitle)
                {
                    child = new Text(
                        eventObj.title,
                        style: CTextStyle.PXLargeMedium,
                        maxLines: 1,
                        overflow: TextOverflow.ellipsis,
                        textAlign: TextAlign.center
                        );
                }

                titleWidget = new Expanded(
                    child: new Stack(
                        fit: StackFit.expand,
                        children: new List <Widget> {
                    new PositionedTransition(
                        rect: this._titleAnimation,
                        child: child
                        )
                }
                        )
                    );
            }

            return(new AnimatedContainer(
                       height: 44,
                       duration: TimeSpan.FromSeconds(0),
                       padding: EdgeInsets.symmetric(horizontal: 8),
                       decoration: new BoxDecoration(
                           CColors.White,
                           border: new Border(
                               bottom: new BorderSide(this._isHaveTitle ? CColors.Separator2 : CColors.Transparent)),
                           gradient: this._showNavBarShadow
                        ? new LinearGradient(
                               colors: new List <Color> {
                new Color(0x80000000),
                new Color(0x0)
            },
                               begin: Alignment.topCenter,
                               end: Alignment.bottomCenter
                               )
                        : null
                           ),
                       child: new Row(
                           mainAxisAlignment: MainAxisAlignment.spaceBetween,
                           children: new List <Widget> {
                new CustomButton(
                    onPressed: () => { this.widget.actionModel.mainRouterPop(); },
                    child: new Icon(
                        Icons.arrow_back,
                        size: 28,
                        color: this._showNavBarShadow ? CColors.White : CColors.Icon
                        )
                    ),
                titleWidget,
                shareWidget
            }
                           )
                       ));
        }
예제 #10
0
        private void CriarPagina()
        {
            var alturaTela  = Height;
            var paddingTela = alturaTela * .02f;
            var alturaLogo  = alturaTela * .5f;
            var alturaFilePickerContainer  = alturaTela * .05f;
            var alturaCorSelectorContainer = alturaTela * .05f;

            Padding         = new Thickness(paddingTela);
            BackgroundColor = COR_BACKGROUND_TELA;

            var lblSelecaoLogo = new Label
            {
                Text                    = TEXT_LBL_SELECT_LOGO,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.Start,
                HorizontalOptions       = LayoutOptions.StartAndExpand
            };

            var lblVersaoApp = new Label
            {
                Text                    = "Versão " + App.VERSION_NAME,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.End,
                HorizontalOptions       = LayoutOptions.End
            };

            var containerHeader = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Children          = { lblSelecaoLogo, lblVersaoApp },
                Orientation       = StackOrientation.Horizontal
            };

            // instancia de objetos da pagina
            imgLogoSelected = new Image
            {
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                HeightRequest     = alturaLogo,
                WidthRequest      = alturaLogo,
            };

            imgSelectorText = new Label
            {
                Text                    = TEXT_LBL_LOGO_SELECTED,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalOptions         = LayoutOptions.Center,
                LineBreakMode           = LineBreakMode.TailTruncation
            };
            var imgSelectorButton = new Image
            {
                Source            = ImageSource.FromResource("VotacaoEstampas.Images.file_open_icon_128.png"),
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.End,
            };

            imgSelectorButton.GestureRecognizers.Add(new TapGestureRecognizer(async sender =>
            {
                var arquivo = await CrossFilePicker.Current.PickFile();
                if (arquivo != null)
                {
                    imgSelectorText.Text   = arquivo.FileName;
                    Stream stream          = new MemoryStream(arquivo.DataArray);
                    imgLogoSelected.Source = ImageSource.FromStream(() => { return(stream); });
                    DependencyService.Get <IPersistenceService>().SaveImageAsync("logo.jpg", arquivo.DataArray);
                }
            }));

            var imgSelectorContainer = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HeightRequest     = alturaFilePickerContainer,
                WidthRequest      = alturaLogo,
                HorizontalOptions = LayoutOptions.Fill,
                Children          =
                {
                    imgSelectorText, imgSelectorButton
                },
            };

            #region selecao imagem agradecimento

            selectorAgradecimentoText = new Label
            {
                Text                    = TEXT_LBL_AGRADECIMENTO_SELECTED,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalOptions         = LayoutOptions.Center,
                LineBreakMode           = LineBreakMode.TailTruncation
            };
            var imgSelectorAgradecimentoButton = new Image
            {
                Source            = ImageSource.FromResource("VotacaoEstampas.Images.file_open_icon_128.png"),
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.End,
            };
            imgSelectorAgradecimentoButton.GestureRecognizers.Add(new TapGestureRecognizer(async sender =>
            {
                var arquivo = await CrossFilePicker.Current.PickFile();
                if (arquivo != null)
                {
                    //selectorAgradecimentoText.Text = arquivo.FileName;
                    selectorAgradecimentoText.Text = TEXT_LBL_AGRADECIMENTO_OK;
                    Stream stream = new MemoryStream(arquivo.DataArray);
                    //imgLogoSelected.Source = ImageSource.FromStream(() => { return stream; });
                    DependencyService.Get <IPersistenceService>().SaveImageAsync("agradecimento.jpg", arquivo.DataArray);
                }
            }));
            var imgAgradecimentoSelectorContainer = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HeightRequest     = alturaFilePickerContainer,
                WidthRequest      = alturaLogo,
                HorizontalOptions = LayoutOptions.Fill,
                Children          =
                {
                    selectorAgradecimentoText, imgSelectorAgradecimentoButton
                },
            };

            #endregion

            #region selecao imagem header

            selectorHeaderText = new Label
            {
                Text                    = TEXT_LBL_HEADER_SELECTED,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalOptions         = LayoutOptions.Center,
                LineBreakMode           = LineBreakMode.TailTruncation
            };
            var imgSelectorHeaderButton = new Image
            {
                Source            = ImageSource.FromResource("VotacaoEstampas.Images.file_open_icon_128.png"),
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.End,
            };
            imgSelectorHeaderButton.GestureRecognizers.Add(new TapGestureRecognizer(async sender =>
            {
                var arquivo = await CrossFilePicker.Current.PickFile();
                if (arquivo != null)
                {
                    selectorHeaderText.Text = TEXT_LBL_HEADER_OK;
                    Stream stream           = new MemoryStream(arquivo.DataArray);
                    DependencyService.Get <IPersistenceService>().SaveImageAsync("header.jpg", arquivo.DataArray);
                }
            }));
            var imgHeaderSelectorContainer = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HeightRequest     = alturaFilePickerContainer,
                WidthRequest      = alturaLogo,
                HorizontalOptions = LayoutOptions.Fill,
                Children          =
                {
                    selectorHeaderText, imgSelectorHeaderButton
                },
            };

            #endregion

            var SelectorCorText = new Label
            {
                Text                    = TEXT_LBL_COLOR_SELECTED,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                VerticalOptions         = LayoutOptions.Center
            };

            SelectorCorSpinner = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Spacing     = 10,
            };
            CriarRetangulosCores(SelectorCorSpinner);

            var SelectorCorScroll = new ScrollView
            {
                Orientation   = ScrollOrientation.Horizontal,
                HeightRequest = alturaFilePickerContainer,
                WidthRequest  = alturaLogo,
                Padding       = new Thickness(0, 0, 0, 20),
                Content       = SelectorCorSpinner
            };

            SelectorCorButton = new Frame
            {
                BackgroundColor   = _selectedColor,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.End,
                //OutlineColor = Color.White,
                //CornerRadius = 0
            };
            SelectorCorButton.GestureRecognizers.Add(new TapGestureRecognizer(sender =>
            {
                SetVisibilidadeScroll(!SelectorCorSpinner.IsVisible);
            }));

            var SelectorCorContainer = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    SelectorCorText, SelectorCorButton,
                },
            };

            var btnIniciarAplicacao = new CustomButton
            {
                Text              = "Iniciar Aplicação",
                FontSize          = FONTE_TEXTO_LABELS,
                FontFamily        = FAMILIA_TEXTO_LABELS,
                FontAttributes    = ATRIBUTOS_TEXTO_LABELS,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                TextColor         = COR_TEXTO_LABELS,
                BorderRadius      = 20,
                HeightRequest     = FONTE_TEXTO_LABELS + 30,

                CorBackgroundCustomRed   = 30,
                CorBackgroundCustomGreen = 30,
                CorBackgroundCustomBlue  = 30
            };
            btnIniciarAplicacao.Clicked += async(sender, eventArgs) =>
            {
                await Navigation.PushAsync(new ConfigurarEstampasPage());

                Navigation.RemovePage(this);
            };
            var containerBtn = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                Padding           = new Thickness(40, 10),
                Children          =
                {
                    btnIniciarAplicacao
                }
            };

            // set conteudo da página
            Content = new StackLayout
            {
                //Padding = new Thickness(paddingTela),
                Orientation       = StackOrientation.Vertical,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                Children          =
                {
                    containerHeader, imgLogoSelected, imgSelectorContainer, imgAgradecimentoSelectorContainer, imgHeaderSelectorContainer, SelectorCorContainer, SelectorCorScroll, btnIniciarAplicacao
                },
            };
        }
예제 #11
0
        private void CriarPagina()
        {
            var alturaTela   = Height;
            var larguraTela  = Width;
            var alturaHeader = alturaTela * .20f;
            var alturaBody   = alturaTela * .70f;
            //var alturaFooter = alturaTela * .08f;
            //var alturaImageAgradecimento = alturaTela * .5f;
            var spacingContent = alturaTela * .03f;
            var larguraBody    = larguraTela * .8f;

            logoHeader = new Image
            {
                //Source = ImageSource.FromResource("VotacaoEstampas.Images.logo_white_512.png"),
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Center,
                Aspect            = Aspect.AspectFill
            };
            header = new Frame
            {
                OutlineColor      = COR_PAGE_HEADER_FOOTER,
                BackgroundColor   = COR_PAGE_HEADER_FOOTER,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                HeightRequest     = alturaHeader,
                WidthRequest      = alturaHeader
            };
            header.Content = logoHeader;

            BackgroundColor = Color.Gray;

            var btnVoltarPesquisa = new CustomButton
            {
                Text              = "Voltar à votação",
                FontSize          = FONTE_TEXTO_LABELS,
                FontFamily        = FAMILIA_TEXTO_LABELS,
                FontAttributes    = ATRIBUTOS_TEXTO_LABELS,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                TextColor         = COR_TEXTO_LABELS,
                BorderRadius      = 20,
                HeightRequest     = FONTE_TEXTO_LABELS + 30,
#if __ANDROID__
                WidthRequest = larguraBody / 2,
#else
                WidthRequest = larguraBody / 4,
#endif
                CorBackgroundCustomRed   = 30,
                CorBackgroundCustomGreen = 30,
                CorBackgroundCustomBlue  = 30
            };

            btnVoltarPesquisa.Clicked += async(sender, eventArgs) => await Navigation.PopAsync();

            var btnConfirmarPesquisa = new CustomButton
            {
                Text              = "Confirmar",
                FontSize          = FONTE_TEXTO_LABELS,
                FontFamily        = FAMILIA_TEXTO_LABELS,
                FontAttributes    = ATRIBUTOS_TEXTO_LABELS,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                TextColor         = COR_TEXTO_LABELS,
                BorderRadius      = 20,
                HeightRequest     = FONTE_TEXTO_LABELS + 30,
#if __ANDROID__
                WidthRequest = larguraBody / 2,
#else
                WidthRequest = larguraBody / 4,
#endif
                CorBackgroundCustomRed   = 30,
                CorBackgroundCustomGreen = 30,
                CorBackgroundCustomBlue  = 30
            };

            btnConfirmarPesquisa.Clicked += async(sender, eventArgs) =>
            {
                await Navigation.PushAsync(new AgradecimentoPage());

                Navigation.RemovePage(_votarEstampaPage);
                Navigation.RemovePage(this);
            };

            btnsContainer = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.End,
                Spacing           = 10,
                Children          =
                {
                    btnVoltarPesquisa, btnConfirmarPesquisa
                }
            };

            /*var txtbtnsContainer = new StackLayout {
             *  Orientation = StackOrientation.Vertical,
             *  HorizontalOptions = LayoutOptions.FillAndExpand,
             *  VerticalOptions = LayoutOptions.Center,
             *  Children = { txtContainer, btnsContainer}
             * };*/

            imageAgradecimento = new Image
            {
                HorizontalOptions = LayoutOptions.Center,
                Aspect            = Aspect.AspectFit
            };
            containerAgradecimento = new StackLayout
            {
                Padding           = new Thickness(0),
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                // Children = { imageAgradecimento }
            };

            var body = new StackLayout
            {
                Padding           = new Thickness(0),
                Orientation       = StackOrientation.Vertical,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                WidthRequest      = larguraBody,
                HeightRequest     = alturaBody,
                //Spacing = spacingContent,
                Children =
                {
                    containerAgradecimento, btnsContainer
                }
            };

            // set conteudo da página
            Content = new StackLayout
            {
                //Padding = -5, isso resolve o bug de padding no android
#if __ANDROID__
                Padding = new Thickness(-4),
#else
                Padding = new Thickness(0),
#endif
                Orientation = StackOrientation.Vertical,
                //Spacing = spacingContent,
                Children =
                {
                    header, body,    //footer
                }
            };
        }
        public override void Loop()
        {
            base.Loop();

            GameModeSettingsAddition =
                $"\nAbility Active Period: {Functions.ColorPurple}{OnTime}s[]\n" +
                $"Ability Cooldown: {Functions.ColorPurple}{UseCooldown}s[]";

            if (!IsInGame)
            {
                return;
            }

            foreach (var playerId in InvisiblePlayers)
            {
                PlayerController player = PlayerController.FromPlayerId(playerId);

                if (PlayerController.LocalPlayer.PlayerData.IsImpostor || PlayerController.LocalPlayer.PlayerData.IsDead)
                {
                    player.SetOpacity(0.5f);
                }
                else
                {
                    player.IsVisible = false;
                }
            }

            if (!PlayerController.LocalPlayer.PlayerData.IsImpostor)
            {
                return;
            }

            if (EnableDisableInvisibility == null)
            {
                EnableDisableInvisibility = new CustomButton(ButtonOffsetX, ButtonOffsetY, Functions.LoadSpriteFromAssemblyResource(Assembly.GetExecutingAssembly(), "ImpostorInvisibility.Assets.invisibility.png"));
            }

            if (InvisibilityTextRenderer == null)
            {
                InvisibilityTextRenderer = new CustomText(TextOffsetX, TextOffsetY, $"{UseCooldown}");
                InvisibilityTextRenderer.TextRenderer.scale    = 2;
                InvisibilityTextRenderer.TextRenderer.Centered = true;
                InvisibilityTextRenderer.SetActive(false);
            }

            if (PlayerController.LocalPlayer.PlayerData.IsDead)
            {
                if (InvisibilityTextRenderer.Active)
                {
                    InvisibilityTextRenderer.SetActive(false);
                }

                if (EnableDisableInvisibility.Active)
                {
                    EnableDisableInvisibility.SetActive(false);
                }

                return;
            }

            string toDisplay = "--- [7a31f7ff]Impostor Invisibility[]---\n";

            if (IsEnabled)
            {
                toDisplay += $"Visible in [11c5edff]{ OnTime - (Functions.GetUnixTime() - LastEnabled) }s[]";

                InvisibilityTextRenderer.SetActive(true);
                InvisibilityTextRenderer.Text  = $"{ OnTime - (Functions.GetUnixTime() - LastEnabled) }";
                InvisibilityTextRenderer.Color = new Color(0, 1, 0);

                if (OnTime - (Functions.GetUnixTime() - LastEnabled) <= 0)
                {
                    PlayerController ctrl = PlayerController.LocalPlayer;
                    IsEnabled = false;

                    RpcManager.SendRpc(ImpostorInvisibility.ImpostorInvisibilityRpc, new byte[] { 2, ctrl.PlayerId, Convert.ToByte(IsEnabled) });

                    if (IsEnabled)
                    {
                        InvisiblePlayers.Add(ctrl.PlayerId);
                    }
                    else if (InvisiblePlayers.Contains(ctrl.PlayerId))
                    {
                        InvisiblePlayers.Remove(ctrl.PlayerId);

                        var player = PlayerController.FromPlayerId(ctrl.PlayerId);
                        player.SetOpacity(1);

                        if (!player.PlayerControl.inVent)
                        {
                            player.IsVisible = true;
                        }
                    }
                }
            }
            else
            {
                bool CanEnable = LastEnabled + OnTime + UseCooldown <= Functions.GetUnixTime();

                if (CanEnable)
                {
                    // ----- Can enable demat -----
                    if (((EnableDisableInvisibility.InBounds && Functions.GetKey(KeyCode.Mouse0)) || Functions.GetKey(UseKey)) && PlayerController.LocalPlayer.Moveable)
                    {
                        // ----- User pressed key -----
                        LastEnabled = Functions.GetUnixTime();

                        PlayerController ctrl = PlayerController.LocalPlayer;
                        IsEnabled = true;

                        EnableDisableInvisibility.SpriteRenderer.color = new Color(0.75f, 0.75f, 0.75f, 0.75f);

                        RpcManager.SendRpc(ImpostorInvisibility.ImpostorInvisibilityRpc, new byte[] { 2, ctrl.PlayerId, Convert.ToByte(IsEnabled) });

                        if (IsEnabled)
                        {
                            InvisiblePlayers.Add(ctrl.PlayerId);
                        }
                        else if (InvisiblePlayers.Contains(ctrl.PlayerId))
                        {
                            InvisiblePlayers.Remove(ctrl.PlayerId);

                            var player = PlayerController.FromPlayerId(ctrl.PlayerId);
                            player.SetOpacity(1);

                            if (!player.PlayerControl.inVent)
                            {
                                player.IsVisible = true;
                            }
                        }
                    }
                    else
                    {
                        // ----- Display can press key -----
                        toDisplay += $"Use [11c5edff]{ UseKey }[] to activate.";
                        EnableDisableInvisibility.SpriteRenderer.color = new Color(1, 1, 1);
                        InvisibilityTextRenderer.gameObject.SetActive(false);
                    }
                }
                else
                {
                    // ----- Cannot enable demat -----
                    toDisplay += $"Cooldown: [11c5edff]{ (UseCooldown + OnTime) - (Functions.GetUnixTime() - LastEnabled) }s[]";

                    InvisibilityTextRenderer.Text  = $"{ (UseCooldown + OnTime) - (Functions.GetUnixTime() - LastEnabled) }";
                    InvisibilityTextRenderer.Color = new Color(1, 1, 1);
                }
            }

            string curText = PlayerHudManager.TaskText;

            if (!curText.Contains(Delimiter))
            {
                PlayerHudManager.TaskText = toDisplay + Delimiter + PlayerHudManager.TaskText;
            }
            else if (!curText.Contains(toDisplay))
            {
                string toReplace = curText.Split(new string[] { Delimiter }, StringSplitOptions.None)[0];

                PlayerHudManager.TaskText = curText.Replace(toReplace, toDisplay);
            }
        }
예제 #13
0
        public void initUserView(string title, CustomButton.ButtonType bt, Client o, Server s)
        {
            CustomButton newUser = new CustomButton(title);

            newUser.buttonType = bt;
            switch (bt)
            {
            case CustomButton.ButtonType.CREATED_GROUP:
                newUser.server = s;
                break;

            default:
                newUser.client = o;
                Console.WriteLine(o.ipEndPoint.Port);
                ClientMessage cm = new ClientMessage(newUser.client.clientSocket, username, this);
                newUser.ClientMessage = cm;
                break;
            }


            selectedUser   = newUser;
            newUser.Click += new RoutedEventHandler((object se, RoutedEventArgs e) => {
                chatTitle.Text = title;
                if (newUser.buttonType == CustomButton.ButtonType.CREATED_GROUP)
                {
                    chatCode.Text = newUser.server.groupCode;
                }
                else
                {
                    chatCode.Text = "";
                }
                selectedUser = newUser;
                chatStackPanel.Children.Clear();
                foreach (string m in selectedUser.Messages)
                {
                    wrapMessage("", m);
                }
            });

            Grid grid = new Grid();
            ColumnDefinitionCollection colums = grid.ColumnDefinitions;
            ColumnDefinition           col1   = new ColumnDefinition();
            ColumnDefinition           col2   = new ColumnDefinition();

            colums.Add(col1);
            colums.Add(col2);

            //BitmapImage src = new BitmapImage(new Uri("./assets/img/profile.png"));
            //ImageSource src = System.Windows.Media.ImageSource();
            //Image img = new Image() { Source = "./assets/img/profile.png" };

            TextBlock text = new TextBlock()
            {
                Text = title
            };

            Border userBorder = new Border();

            userBorder.Effect = new System.Windows.Media.Effects.DropShadowEffect()
            {
                BlurRadius = 8, Opacity = 0.1, ShadowDepth = 2, Direction = 270
            };
            userBorder.Child      = newUser;
            userBorder.Margin     = new System.Windows.Thickness(3);
            userBorder.Background = new System.Windows.Media.SolidColorBrush()
            {
                Color = Color.FromRgb(236, 240, 255)
            };
            userBorder.CornerRadius = new System.Windows.CornerRadius(4);
            usersStack.Children.Add(userBorder);
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mPoweredByBSGrid = (Grid)target;
                break;

            case 2:
                this.mBSIconAndNameGrid = (Grid)target;
                break;

            case 3:
                this.mProductTextGrid = (Grid)target;
                break;

            case 4:
                this.mVersionLabel = (Label)target;
                break;

            case 5:
                this.mUpdateInfoGrid = (Grid)target;
                break;

            case 6:
                this.bodyLabel = (Label)target;
                break;

            case 7:
                this.mLabelVersion = (Label)target;
                break;

            case 8:
                this.mDetailedChangeLogs = (Hyperlink)target;
                this.mDetailedChangeLogs.RequestNavigate += new RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
                break;

            case 9:
                this.mCheckUpdateBtn        = (CustomButton)target;
                this.mCheckUpdateBtn.Click += new RoutedEventHandler(this.mCheckUpdateBtn_Click);
                break;

            case 10:
                this.mStatusLabel = (TextBlock)target;
                break;

            case 11:
                this.mCheckingGrid = (Grid)target;
                break;

            case 12:
                this.ContactInfoGrid = (Grid)target;
                break;

            case 13:
                this.mWebsiteLabel = (Label)target;
                break;

            case 14:
                ((Hyperlink)target).RequestNavigate += new RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
                break;

            case 15:
                this.mSupportLabel = (Label)target;
                break;

            case 16:
                ((Hyperlink)target).RequestNavigate += new RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
                break;

            case 17:
                this.mSupportMailLabel = (Label)target;
                break;

            case 18:
                this.mSupportEMailHyperlink = (Hyperlink)target;
                this.mSupportEMailHyperlink.RequestNavigate += new RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
                break;

            case 19:
                this.mTermsOfUse = (TextBlock)target;
                break;

            case 20:
                this.mTermsOfUseLink = (Hyperlink)target;
                this.mTermsOfUseLink.RequestNavigate += new RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
                this.mTermsOfUseLink.Loaded          += new RoutedEventHandler(this.mTermsOfUseLink_Loaded);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
예제 #15
0
        static StackLayout ListTemplate(List <Dustbins> _Dustbin)
        {
            StackLayout _Value = new StackLayout()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding           = new Thickness(0, 5, 0, 0)
            };

            //for (int i = 0; i < 20;i++)
            //{
            foreach (Dustbins _Obj in _Dustbin)
            {
                var grid = new Grid();
                grid.RowDefinitions.Add(new RowDefinition {
                    Height = new GridLength(1, GridUnitType.Star)
                });
                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(3, GridUnitType.Star)
                });
                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(1, GridUnitType.Star)
                });
                grid.Children.Add(new StackLayout
                {
                    Children =
                    {
                        new Label {
                            Text     = _Obj.LocationName,
                            FontSize = 15
                        },
                        new Label {
                            Text     = "Business Dustbin",
                            FontSize = 13
                        }
                    }
                }, 0, 0);

                String _ListColor = "ListGreen.png";
                String _ColorVal  = "ef677d";

                if (_Obj.Percentage < 50)
                {
                    _ColorVal = "8dc63f";
                }
                if (_Obj.Percentage >= 50)
                {
                    _ColorVal = "f76e3d";
                }

                if (_Obj.Percentage >= 80)
                {
                    _ColorVal = "ef677d";
                }

                CustomButton _DonateBtn = new CustomButton();
                _DonateBtn.Text            = _Obj.Percentage + "%";
                _DonateBtn.WidthRequest    = 120;
                _DonateBtn.Margin          = new Thickness(0, 5, 0, 0);
                _DonateBtn.BackgroundColor = Xamarin.Forms.Color.FromHex(_ColorVal);
                _DonateBtn.Clicked        += Redeem_Clicked;

                grid.Children.Add(new StackLayout
                {
                    //Margin = 5,
                    //BackgroundColor = _ColorStatus,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        _DonateBtn
                    }
                }, 1, 0);

                StackLayout _SL = new StackLayout()
                {
                    ClassId       = "test",
                    HeightRequest = 60,
                    //BackgroundColor = Color.White,
                    Orientation = StackOrientation.Horizontal,
                    //Padding = 5,
                };

                RelativeLayout layout = new RelativeLayout();
                layout.HeightRequest = 60;
                layout.Children.Add(new Image()
                {
                    Source = ImageSource.FromFile(_ListColor)
                },
                                    Constraint.Constant(0),
                                    Constraint.Constant(0),
                                    Constraint.RelativeToParent((parent) => { return(parent.Width); }),
                                    Constraint.RelativeToParent((parent) => { return(parent.Height); }));

                layout.Children.Add(grid,
                                    Constraint.Constant(25),
                                    Constraint.Constant(7),
                                    Constraint.RelativeToParent((parent) => { return(parent.Width - 35); }),
                                    Constraint.RelativeToParent((parent) => { return(parent.Height); }));

                _SL.Children.Add(layout);

                _Value.Children.Add(
                    _SL
                    );
            }

            return(_Value);
        }
예제 #16
0
        private void ActualizeSingleToDoRow(GridExtended grid, ToDos toDos)
        {
            grid.Children.Clear();
            grid.DataObject             = new ToDos4Grid(toDos);
            grid.FocusElementInEditMode = 2;

            TextBlock labelNummer = new TextBlock
            {
                Text       = toDos.Nummer.ToString(),
                Visibility = Visibility.Collapsed
            };

            grid.Add2Children(labelNummer, true);

            TextBlock labelBezeichnung = new TextBlock
            {
                Text = toDos.Bezeichnung,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Center,
                Foreground          = Layout.WindowForeground
            };

            Grid.SetColumn(labelBezeichnung, 0);
            Grid.SetColumnSpan(labelBezeichnung, 5);
            grid.Add2Children(labelBezeichnung);

            if (this.core.GetKategorie(toDos.Kategorie_Nr) == "Kaufen")
            {
                TextBlock labelKosten = new TextBlock
                {
                    Text = toDos.Kosten.ToString("C"),
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Foreground          = Layout.WindowForeground
                };

                Grid.SetColumn(labelKosten, 5);
                Grid.SetColumnSpan(labelKosten, 2);
                grid.Add2Children(labelKosten);

                BaseCheckBox chkErledigt = new BaseCheckBox
                {
                    IsChecked           = toDos.ProzentErledigt == 100,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center
                };
                chkErledigt.CheckedChanged += ChkErledigt_CheckedChanged;

                Grid.SetColumn(chkErledigt, 7);
                Grid.SetColumnSpan(chkErledigt, 2);
                grid.Add2Children(chkErledigt);
            }
            else if (this.core.GetKategorie(toDos.Kategorie_Nr) == "Machen")
            {
                //TODO: create custom user control to handle custom type Time properly
                TextBlock labelZeit = new TextBlock
                {
                    Text = toDos.Zeit.ToString(),
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Foreground          = Layout.WindowForeground
                };

                Grid.SetColumn(labelZeit, 5);
                Grid.SetColumnSpan(labelZeit, 2);
                grid.Add2Children(labelZeit);

                ComboBox comboProzentErledigt = new ComboBox
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Foreground          = Layout.WindowForeground
                };
                comboProzentErledigt.SelectionChanged += ComboProzentErledigt_SelectionChanged;

                for (int i = 0; i <= 100; i = i + 5)
                {
                    comboProzentErledigt.Items.Add(new ComboBoxItem {
                        Content = i + "%"
                    });
                    if (i == toDos.ProzentErledigt)
                    {
                        comboProzentErledigt.SelectedIndex = comboProzentErledigt.Items.Count - 1;
                    }
                }

                Grid.SetColumn(comboProzentErledigt, 7);
                Grid.SetColumnSpan(comboProzentErledigt, 2);
                grid.Add2Children(comboProzentErledigt);
            }

            CustomButton buttonDelToDo = new CustomButton
            {
                Text                = "",
                ImageSource         = ResourceConstants.DelIcon,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center
            };

            buttonDelToDo.Click += DelTodo_Click;
            Grid.SetColumn(buttonDelToDo, 9);
            grid.Children.Add(buttonDelToDo);
        }
예제 #17
0
 /// <summary>
 /// Removes all custom buttons.
 /// </summary>
 public void ClearCustomButtons()
 {
     activeCustomButton = null;
       customButtons.Clear();
       ComputeButtonOffsets();
 }
예제 #18
0
        private void frmEditOrderPrice_Load(object sender, EventArgs e)
        {
            //this.Top = Screen.PrimaryScreen.WorkingArea.Size.Height / 2 - (this.Height / 2);
            //this.Left = Screen.PrimaryScreen.WorkingArea.Size.Width / 2 - (this.Width / 2);
            //lbl_Titie.Text = "Welcom to AB SD Cafeteria Office Module";
            int xPos   = 2;
            int yPos   = 2;
            int iLines = 0;

            //////////////////////////////////////////////////////
            // Declare and assign number of buttons = 20
            //System.Windows.Forms.Button[] btnArray = new System.Windows.Forms.Button[30];
            CustomButton[] btnNums = new CustomButton[13];
            //////////////////////////////////////////////////////
            // Create (20) Buttons:
            for (int i = 0; i < 13; i++)
            {
                // Initialize one variable
                //btnArray[i] = new System.Windows.Forms.Button();
                btnNums[i] = new CustomButton();
            }
            int n        = 0;
            int iSpace   = 2;
            int btWidth  = pnlNums.Width - (iSpace * 3);
            int btHeight = pnlNums.Height - (iSpace * 5);

            while (n < 13)
            {
                btnNums[n].Tag    = n + 1;        // Tag of button
                btnNums[n].Width  = btWidth / 3;  // Width of button
                btnNums[n].Height = btHeight / 5; // Height of button
                btnNums[n].Font   = new Font("Arial", 28, FontStyle.Bold);
                //btnArray[n].BackColor = Color.LightSteelBlue;
                btnNums[n].ForeColor    = Color.WhiteSmoke;
                btnNums[n].CornerRadius = 30;
                //btnNums[n].RoundCorners = Corners.TopLeft | Corners.TopRight | Corners.BottomLeft;
                btnNums[n].RoundCorners = Corners.All;
                //btnArray[n].AutoSize = true;
                /////////////////////////////////////////////////////
                // 4 Buttons in one line
                /////////////////////////////////////////////////////
                if (n >= 3) // Location of second line of buttons:
                {
                    if (n % 3 == 0)
                    {
                        xPos = 2;
                        yPos = yPos + btnNums[n].Height + iSpace;
                        iLines++;
                    }
                }
                if (n + 1 == 13)
                {
                    btnNums[n].Width = btWidth;
                }
                btnNums[n].BackColor = btColor[2];
                // Location of button:
                btnNums[n].Left = xPos;
                btnNums[n].Top  = yPos;
                // Add buttons to a Panel:
                pnlNums.Controls.Add(btnNums[n]);        // Let panel hold the Buttons
                xPos = xPos + btnNums[n].Width + iSpace; // Left of next button
                                                         // Write English Character:

                /* ****************************************************************
                 *  Menu item button text
                 * //**************************************************************** */

                //btnArray[n].Text = ((char)(n + 65)).ToString() + (n+1).ToString();
                btnNums[n].Text = (n + 1).ToString();
                if (n + 1 == 10)
                {
                    btnNums[n].Text      = "OK";
                    btnNums[n].BackColor = Color.ForestGreen;
                    btnNums[n].ForeColor = Color.White;
                }
                if (n + 1 == 11)
                {
                    btnNums[n].Text = "0";
                }
                if (n + 1 == 12)
                {
                    btnNums[n].Text      = "DEL";
                    btnNums[n].BackColor = Color.Maroon;
                    btnNums[n].ForeColor = Color.White;
                }
                if (n + 1 == 13)
                {
                    btnNums[n].Text      = "EXIT";
                    btnNums[n].BackColor = Color.Gray;
                    btnNums[n].ForeColor = Color.White;
                }
                // the Event of click Button
                btnNums[n].Click += new System.EventHandler(ClickNumberButton);
                n++;
            }
            txt_NewPrice.Focus();
            pnlNums.Enabled = true; // not need now to this button now

            this.StartPosition = FormStartPosition.CenterScreen;
            this.BringToFront();
            this.TopMost = true;
            this.TopMost = false;
        }
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.listIcons = new System.Windows.Forms.ImageList(this.components);
     this.splitParent = new System.Windows.Forms.SplitContainer();
     this.tableTop = new System.Windows.Forms.TableLayoutPanel();
     this.lblCurrentUserName = new System.Windows.Forms.Label();
     this.treeFolders = new System.Windows.Forms.TreeView();
     this.chkQuickStartTip = new System.Windows.Forms.CheckBox();
     this.splitChild = new System.Windows.Forms.SplitContainer();
     this.tableMiddle = new System.Windows.Forms.TableLayoutPanel();
     this.flowPanel = new System.Windows.Forms.FlowLayoutPanel();
     this.lblDownloading = new System.Windows.Forms.Label();
     this.contextmenu = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.menuitemSortBy = new System.Windows.Forms.ToolStripMenuItem();
     this.menuitemShowHidePreview = new System.Windows.Forms.ToolStripMenuItem();
     this.inputSearch = new System.Windows.Forms.TextBox();
     this.tableBottom = new System.Windows.Forms.TableLayoutPanel();
     this.contextmenuSortBy = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.menuitemFilterFields = new System.Windows.Forms.ToolStripMenuItem();
     this.searchOptionsContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.lblLoadingFolders = new System.Windows.Forms.Label();
     this.lblLoadingItems = new System.Windows.Forms.Label();
     this.lblSortBy = new System.Windows.Forms.Label();
     this.tooltip = new System.Windows.Forms.ToolTip(this.components);
     this.flowLoadingFolders = new System.Windows.Forms.FlowLayoutPanel();
     this.flowLoadingItems = new System.Windows.Forms.FlowLayoutPanel();
     this.btnReload = new MSWordWizCite.Classes.CustomButton();
     this.btnLogout = new MSWordWizCite.Classes.CustomButton();
     this.btnTemplate = new MSWordWizCite.Classes.CustomButton();
     this.btnCite = new MSWordWizCite.Classes.CustomButton();
     this.btnStyle = new MSWordWizCite.Classes.CustomButton();
     this.btnRefresh = new MSWordWizCite.Classes.CustomButton();
     this.btnRefList = new MSWordWizCite.Classes.CustomButton();
     this.btnHighlight = new MSWordWizCite.Classes.CustomButton();
     this.btnShowHidePreview = new MSWordWizCite.Classes.CustomButton();
     this.btnSortBy = new MSWordWizCite.Classes.CustomButton();
     this.btnSearch = new MSWordWizCite.Classes.CustomButton();
     this.btnMore = new MSWordWizCite.Classes.CustomButton();
     this.ctrlPreview = new MSWordWizCite.Controls.PreviewControl();
     this.cmbViews = new MSWordWizCite.Classes.CustomComboBoxControl();
     this.cmbSortBy = new MSWordWizCite.Classes.CustomComboBoxControl();
     ((System.ComponentModel.ISupportInitialize)(this.splitParent)).BeginInit();
     this.splitParent.Panel1.SuspendLayout();
     this.splitParent.Panel2.SuspendLayout();
     this.splitParent.SuspendLayout();
     this.tableTop.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.splitChild)).BeginInit();
     this.splitChild.Panel1.SuspendLayout();
     this.splitChild.Panel2.SuspendLayout();
     this.splitChild.SuspendLayout();
     this.tableMiddle.SuspendLayout();
     this.flowPanel.SuspendLayout();
     this.contextmenu.SuspendLayout();
     this.tableBottom.SuspendLayout();
     this.flowLoadingFolders.SuspendLayout();
     this.flowLoadingItems.SuspendLayout();
     this.SuspendLayout();
     //
     // listIcons
     //
     this.listIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
     this.listIcons.ImageSize = new System.Drawing.Size(16, 16);
     this.listIcons.TransparentColor = System.Drawing.Color.Transparent;
     //
     // splitParent
     //
     this.splitParent.Dock = System.Windows.Forms.DockStyle.Fill;
     this.splitParent.Location = new System.Drawing.Point(0, 0);
     this.splitParent.Name = "splitParent";
     this.splitParent.Orientation = System.Windows.Forms.Orientation.Horizontal;
     //
     // splitParent.Panel1
     //
     this.splitParent.Panel1.Controls.Add(this.tableTop);
     //
     // splitParent.Panel2
     //
     this.splitParent.Panel2.Controls.Add(this.splitChild);
     this.splitParent.Size = new System.Drawing.Size(350, 738);
     this.splitParent.SplitterDistance = 341;
     this.splitParent.TabIndex = 0;
     this.splitParent.TabStop = false;
     //
     // tableTop
     //
     this.tableTop.AutoSize = true;
     this.tableTop.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.tableTop.ColumnCount = 5;
     this.tableTop.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tableTop.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 28F));
     this.tableTop.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 28F));
     this.tableTop.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 28F));
     this.tableTop.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 28F));
     this.tableTop.Controls.Add(this.lblCurrentUserName, 0, 0);
     this.tableTop.Controls.Add(this.btnReload, 3, 0);
     this.tableTop.Controls.Add(this.btnLogout, 4, 0);
     this.tableTop.Controls.Add(this.treeFolders, 0, 1);
     this.tableTop.Controls.Add(this.btnTemplate, 2, 0);
     this.tableTop.Controls.Add(this.chkQuickStartTip, 1, 0);
     this.tableTop.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tableTop.Location = new System.Drawing.Point(0, 0);
     this.tableTop.Name = "tableTop";
     this.tableTop.RowCount = 1;
     this.tableTop.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
     this.tableTop.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tableTop.Size = new System.Drawing.Size(350, 341);
     this.tableTop.TabIndex = 0;
     //
     // lblCurrentUserName
     //
     this.lblCurrentUserName.Anchor = System.Windows.Forms.AnchorStyles.Left;
     this.lblCurrentUserName.AutoSize = true;
     this.lblCurrentUserName.Cursor = System.Windows.Forms.Cursors.Hand;
     this.lblCurrentUserName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblCurrentUserName.Location = new System.Drawing.Point(3, 7);
     this.lblCurrentUserName.Name = "lblCurrentUserName";
     this.lblCurrentUserName.Size = new System.Drawing.Size(59, 13);
     this.lblCurrentUserName.TabIndex = 0;
     this.lblCurrentUserName.Text = "First Last";
     //
     // treeFolders
     //
     this.treeFolders.BackColor = System.Drawing.SystemColors.Window;
     this.treeFolders.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.tableTop.SetColumnSpan(this.treeFolders, 5);
     this.treeFolders.Dock = System.Windows.Forms.DockStyle.Fill;
     this.treeFolders.HideSelection = false;
     this.treeFolders.Location = new System.Drawing.Point(3, 31);
     this.treeFolders.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
     this.treeFolders.Name = "treeFolders";
     this.treeFolders.ShowLines = false;
     this.treeFolders.Size = new System.Drawing.Size(344, 310);
     this.treeFolders.TabIndex = 4;
     this.treeFolders.TabStop = false;
     this.treeFolders.KeyUp += new System.Windows.Forms.KeyEventHandler(this.treeFolders_KeyUp);
     //
     // chkQuickStartTip
     //
     this.chkQuickStartTip.Anchor = System.Windows.Forms.AnchorStyles.None;
     this.chkQuickStartTip.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.chkQuickStartTip.Checked = true;
     this.chkQuickStartTip.CheckState = System.Windows.Forms.CheckState.Checked;
     this.chkQuickStartTip.Location = new System.Drawing.Point(241, 3);
     this.chkQuickStartTip.Name = "chkQuickStartTip";
     this.chkQuickStartTip.Size = new System.Drawing.Size(22, 22);
     this.chkQuickStartTip.TabIndex = 6;
     this.chkQuickStartTip.TabStop = false;
     this.chkQuickStartTip.UseVisualStyleBackColor = true;
     //
     // splitChild
     //
     this.splitChild.Dock = System.Windows.Forms.DockStyle.Fill;
     this.splitChild.Location = new System.Drawing.Point(0, 0);
     this.splitChild.Name = "splitChild";
     this.splitChild.Orientation = System.Windows.Forms.Orientation.Horizontal;
     //
     // splitChild.Panel1
     //
     this.splitChild.Panel1.Controls.Add(this.tableMiddle);
     //
     // splitChild.Panel2
     //
     this.splitChild.Panel2.Controls.Add(this.tableBottom);
     this.splitChild.Size = new System.Drawing.Size(350, 393);
     this.splitChild.SplitterDistance = 181;
     this.splitChild.TabIndex = 0;
     this.splitChild.TabStop = false;
     //
     // tableMiddle
     //
     this.tableMiddle.AutoSize = true;
     this.tableMiddle.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.tableMiddle.ColumnCount = 4;
     this.tableMiddle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tableMiddle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
     this.tableMiddle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
     this.tableMiddle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
     this.tableMiddle.Controls.Add(this.flowPanel, 0, 0);
     this.tableMiddle.Controls.Add(this.btnShowHidePreview, 2, 0);
     this.tableMiddle.Controls.Add(this.btnSortBy, 3, 0);
     this.tableMiddle.Controls.Add(this.inputSearch, 0, 4);
     this.tableMiddle.Controls.Add(this.btnSearch, 2, 4);
     this.tableMiddle.Controls.Add(this.btnMore, 3, 4);
     this.tableMiddle.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tableMiddle.Location = new System.Drawing.Point(0, 0);
     this.tableMiddle.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
     this.tableMiddle.Name = "tableMiddle";
     this.tableMiddle.RowCount = 5;
     this.tableMiddle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
     this.tableMiddle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tableMiddle.RowStyles.Add(new System.Windows.Forms.RowStyle());
     this.tableMiddle.RowStyles.Add(new System.Windows.Forms.RowStyle());
     this.tableMiddle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F));
     this.tableMiddle.Size = new System.Drawing.Size(350, 181);
     this.tableMiddle.TabIndex = 0;
     this.tableMiddle.TabStop = true;
     //
     // flowPanel
     //
     this.flowPanel.AutoSize = true;
     this.tableMiddle.SetColumnSpan(this.flowPanel, 2);
     this.flowPanel.Controls.Add(this.btnCite);
     this.flowPanel.Controls.Add(this.btnStyle);
     this.flowPanel.Controls.Add(this.btnRefresh);
     this.flowPanel.Controls.Add(this.btnRefList);
     this.flowPanel.Controls.Add(this.btnHighlight);
     this.flowPanel.Controls.Add(this.lblDownloading);
     this.flowPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.flowPanel.Location = new System.Drawing.Point(0, 0);
     this.flowPanel.Margin = new System.Windows.Forms.Padding(0);
     this.flowPanel.Name = "flowPanel";
     this.flowPanel.Size = new System.Drawing.Size(290, 28);
     this.flowPanel.TabIndex = 5;
     //
     // lblDownloading
     //
     this.lblDownloading.AutoSize = true;
     this.lblDownloading.Location = new System.Drawing.Point(153, 0);
     this.lblDownloading.Name = "lblDownloading";
     this.lblDownloading.Padding = new System.Windows.Forms.Padding(0, 9, 0, 0);
     this.lblDownloading.Size = new System.Drawing.Size(83, 21);
     this.lblDownloading.TabIndex = 5;
     this.lblDownloading.Text = "Downloading ... ";
     this.lblDownloading.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.lblDownloading.Visible = false;
     //
     // contextmenu
     //
     this.contextmenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.menuitemSortBy,
     this.menuitemShowHidePreview});
     this.contextmenu.Name = "contextmenu";
     this.contextmenu.Size = new System.Drawing.Size(215, 48);
     //
     // menuitemSortBy
     //
     this.menuitemSortBy.Name = "menuitemSortBy";
     this.menuitemSortBy.Size = new System.Drawing.Size(214, 22);
     this.menuitemSortBy.Text = "Sort";
     //
     // menuitemShowHidePreview
     //
     this.menuitemShowHidePreview.Name = "menuitemShowHidePreview";
     this.menuitemShowHidePreview.Size = new System.Drawing.Size(214, 22);
     this.menuitemShowHidePreview.Text = "Show/Hide item preview";
     //
     // inputSearch
     //
     this.inputSearch.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.tableMiddle.SetColumnSpan(this.inputSearch, 2);
     this.inputSearch.Dock = System.Windows.Forms.DockStyle.Fill;
     this.inputSearch.ForeColor = System.Drawing.SystemColors.GrayText;
     this.inputSearch.Location = new System.Drawing.Point(3, 159);
     this.inputSearch.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
     this.inputSearch.Name = "inputSearch";
     this.inputSearch.Size = new System.Drawing.Size(284, 22);
     this.inputSearch.TabIndex = 1;
     this.inputSearch.Text = "Find items ...";
     //
     // tableBottom
     //
     this.tableBottom.AutoSize = true;
     this.tableBottom.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.tableBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     this.tableBottom.Controls.Add(this.ctrlPreview, 0, 0);
     this.tableBottom.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tableBottom.Location = new System.Drawing.Point(0, 0);
     this.tableBottom.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
     this.tableBottom.Name = "tableBottom";
     this.tableBottom.RowStyles.Add(new System.Windows.Forms.RowStyle());
     this.tableBottom.Size = new System.Drawing.Size(350, 208);
     this.tableBottom.TabIndex = 0;
     //
     // contextmenuSortBy
     //
     this.contextmenuSortBy.Name = "contextmenuSortBy";
     this.contextmenuSortBy.Size = new System.Drawing.Size(61, 4);
     //
     // menuitemFilterFields
     //
     this.menuitemFilterFields.Name = "menuitemFilterFields";
     this.menuitemFilterFields.Size = new System.Drawing.Size(189, 22);
     this.menuitemFilterFields.Text = "Filter options";
     //
     // searchOptionsContextMenu
     //
     this.searchOptionsContextMenu.Name = "searchOptionsContextMenu";
     this.searchOptionsContextMenu.Size = new System.Drawing.Size(61, 4);
     //
     // lblLoadingFolders
     //
     this.lblLoadingFolders.AutoSize = true;
     this.lblLoadingFolders.Location = new System.Drawing.Point(3, 0);
     this.lblLoadingFolders.Name = "lblLoadingFolders";
     this.lblLoadingFolders.Size = new System.Drawing.Size(94, 12);
     this.lblLoadingFolders.TabIndex = 0;
     this.lblLoadingFolders.Text = "Loading folders ... ";
     this.lblLoadingFolders.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblLoadingItems
     //
     this.lblLoadingItems.Location = new System.Drawing.Point(3, 0);
     this.lblLoadingItems.Name = "lblLoadingItems";
     this.lblLoadingItems.Size = new System.Drawing.Size(160, 23);
     this.lblLoadingItems.TabIndex = 0;
     //
     // lblSortBy
     //
     this.lblSortBy.Anchor = System.Windows.Forms.AnchorStyles.Left;
     this.lblSortBy.AutoSize = true;
     this.lblSortBy.Location = new System.Drawing.Point(-25, 67);
     this.lblSortBy.Margin = new System.Windows.Forms.Padding(0);
     this.lblSortBy.Name = "lblSortBy";
     this.lblSortBy.Size = new System.Drawing.Size(26, 13);
     this.lblSortBy.TabIndex = 0;
     this.lblSortBy.Text = "Sort";
     this.lblSortBy.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // flowLoadingFolders
     //
     this.flowLoadingFolders.BackColor = System.Drawing.Color.Red;
     this.flowLoadingFolders.Controls.Add(this.lblLoadingFolders);
     this.flowLoadingFolders.Location = new System.Drawing.Point(0, 0);
     this.flowLoadingFolders.Name = "flowLoadingFolders";
     this.flowLoadingFolders.Size = new System.Drawing.Size(200, 100);
     this.flowLoadingFolders.TabIndex = 0;
     //
     // flowLoadingItems
     //
     this.flowLoadingItems.BackColor = System.Drawing.Color.Green;
     this.flowLoadingItems.Controls.Add(this.lblLoadingItems);
     this.flowLoadingItems.Location = new System.Drawing.Point(0, 0);
     this.flowLoadingItems.Name = "flowLoadingItems";
     this.flowLoadingItems.Size = new System.Drawing.Size(200, 100);
     this.flowLoadingItems.TabIndex = 0;
     //
     // btnReload
     //
     this.btnReload.Anchor = System.Windows.Forms.AnchorStyles.Right;
     this.btnReload.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnReload.FlatAppearance.BorderSize = 0;
     this.btnReload.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnReload.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnReload.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnReload.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnReload.Image = global::MSWordWizCite.Properties.Resources.transfer;
     this.btnReload.Location = new System.Drawing.Point(297, 3);
     this.btnReload.Name = "btnReload";
     this.btnReload.Size = new System.Drawing.Size(22, 22);
     this.btnReload.TabIndex = 2;
     this.btnReload.TabStop = false;
     this.btnReload.Click += new System.EventHandler(this.btnReload_Clicked);
     //
     // btnLogout
     //
     this.btnLogout.Anchor = System.Windows.Forms.AnchorStyles.Right;
     this.btnLogout.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnLogout.FlatAppearance.BorderSize = 0;
     this.btnLogout.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnLogout.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnLogout.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnLogout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnLogout.Image = global::MSWordWizCite.Properties.Resources.logout;
     this.btnLogout.Location = new System.Drawing.Point(325, 3);
     this.btnLogout.Name = "btnLogout";
     this.btnLogout.Size = new System.Drawing.Size(22, 22);
     this.btnLogout.TabIndex = 3;
     this.btnLogout.TabStop = false;
     this.btnLogout.Click += new System.EventHandler(this.btnLogout_Clicked);
     //
     // btnTemplate
     //
     this.btnTemplate.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnTemplate.FlatAppearance.BorderSize = 0;
     this.btnTemplate.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnTemplate.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnTemplate.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnTemplate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnTemplate.Image = global::MSWordWizCite.Properties.Resources.ThesisType;
     this.btnTemplate.Location = new System.Drawing.Point(269, 3);
     this.btnTemplate.Name = "btnTemplate";
     this.btnTemplate.Size = new System.Drawing.Size(22, 22);
     this.btnTemplate.TabIndex = 5;
     this.btnTemplate.UseVisualStyleBackColor = true;
     this.btnTemplate.Click += new System.EventHandler(this.btnTemplate_Click);
     //
     // btnCite
     //
     this.btnCite.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnCite.FlatAppearance.BorderSize = 0;
     this.btnCite.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnCite.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnCite.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnCite.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnCite.Image = global::MSWordWizCite.Properties.Resources.CitationInsert;
     this.btnCite.Location = new System.Drawing.Point(3, 3);
     this.btnCite.Name = "btnCite";
     this.btnCite.Size = new System.Drawing.Size(24, 22);
     this.btnCite.TabIndex = 0;
     this.btnCite.TabStop = false;
     //
     // btnStyle
     //
     this.btnStyle.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnStyle.FlatAppearance.BorderSize = 0;
     this.btnStyle.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnStyle.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnStyle.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnStyle.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnStyle.Image = global::MSWordWizCite.Properties.Resources.CitationStyleChange;
     this.btnStyle.Location = new System.Drawing.Point(33, 3);
     this.btnStyle.Name = "btnStyle";
     this.btnStyle.Size = new System.Drawing.Size(24, 22);
     this.btnStyle.TabIndex = 1;
     this.btnStyle.TabStop = false;
     this.btnStyle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // btnRefresh
     //
     this.btnRefresh.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnRefresh.FlatAppearance.BorderSize = 0;
     this.btnRefresh.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnRefresh.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnRefresh.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnRefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnRefresh.Image = global::MSWordWizCite.Properties.Resources.FolderRefresh2;
     this.btnRefresh.Location = new System.Drawing.Point(63, 3);
     this.btnRefresh.Name = "btnRefresh";
     this.btnRefresh.Size = new System.Drawing.Size(24, 22);
     this.btnRefresh.TabIndex = 2;
     this.btnRefresh.TabStop = false;
     //
     // btnRefList
     //
     this.btnRefList.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnRefList.FlatAppearance.BorderSize = 0;
     this.btnRefList.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnRefList.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnRefList.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnRefList.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnRefList.Image = global::MSWordWizCite.Properties.Resources.ReferenceLocate;
     this.btnRefList.Location = new System.Drawing.Point(93, 3);
     this.btnRefList.Name = "btnRefList";
     this.btnRefList.Size = new System.Drawing.Size(24, 22);
     this.btnRefList.TabIndex = 4;
     this.btnRefList.TabStop = false;
     //
     // btnHighlight
     //
     this.btnHighlight.Enabled = false;
     this.btnHighlight.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnHighlight.FlatAppearance.BorderSize = 0;
     this.btnHighlight.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnHighlight.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnHighlight.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnHighlight.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnHighlight.Image = global::MSWordWizCite.Properties.Resources.Highlight;
     this.btnHighlight.Location = new System.Drawing.Point(123, 3);
     this.btnHighlight.Name = "btnHighlight";
     this.btnHighlight.Size = new System.Drawing.Size(24, 22);
     this.btnHighlight.TabIndex = 3;
     this.btnHighlight.TabStop = false;
     this.btnHighlight.Visible = false;
     //
     // btnShowHidePreview
     //
     this.btnShowHidePreview.Anchor = System.Windows.Forms.AnchorStyles.Right;
     this.btnShowHidePreview.Cursor = System.Windows.Forms.Cursors.Hand;
     this.btnShowHidePreview.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnShowHidePreview.FlatAppearance.BorderSize = 0;
     this.btnShowHidePreview.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnShowHidePreview.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnShowHidePreview.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnShowHidePreview.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnShowHidePreview.Image = global::MSWordWizCite.Properties.Resources.preview;
     this.btnShowHidePreview.Location = new System.Drawing.Point(293, 3);
     this.btnShowHidePreview.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
     this.btnShowHidePreview.Name = "btnShowHidePreview";
     this.btnShowHidePreview.Size = new System.Drawing.Size(24, 22);
     this.btnShowHidePreview.TabIndex = 6;
     this.btnShowHidePreview.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // btnSortBy
     //
     this.btnSortBy.Anchor = System.Windows.Forms.AnchorStyles.Right;
     this.btnSortBy.Cursor = System.Windows.Forms.Cursors.Hand;
     this.btnSortBy.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnSortBy.FlatAppearance.BorderSize = 0;
     this.btnSortBy.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnSortBy.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnSortBy.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnSortBy.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnSortBy.Image = global::MSWordWizCite.Properties.Resources.sort_asc;
     this.btnSortBy.Location = new System.Drawing.Point(323, 3);
     this.btnSortBy.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
     this.btnSortBy.Name = "btnSortBy";
     this.btnSortBy.Size = new System.Drawing.Size(24, 22);
     this.btnSortBy.TabIndex = 6;
     this.btnSortBy.TabStop = false;
     this.btnSortBy.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     this.btnSortBy.Click += new System.EventHandler(this.btnSortBy_Click);
     //
     // btnSearch
     //
     this.btnSearch.BackgroundImage = global::MSWordWizCite.Properties.Resources.Filter;
     this.btnSearch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
     this.btnSearch.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnSearch.FlatAppearance.BorderSize = 0;
     this.btnSearch.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnSearch.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnSearch.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnSearch.Image = global::MSWordWizCite.Properties.Resources.ArrowUp;
     this.btnSearch.ImageAlign = System.Drawing.ContentAlignment.BottomRight;
     this.btnSearch.Location = new System.Drawing.Point(290, 159);
     this.btnSearch.Margin = new System.Windows.Forms.Padding(0);
     this.btnSearch.Name = "btnSearch";
     this.btnSearch.Size = new System.Drawing.Size(30, 19);
     this.btnSearch.TabIndex = 4;
     this.btnSearch.TabStop = false;
     //
     // btnMore
     //
     this.btnMore.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(115)))), ((int)(((byte)(170)))), ((int)(((byte)(115)))));
     this.btnMore.FlatAppearance.BorderSize = 0;
     this.btnMore.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnMore.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(216)))), ((int)(((byte)(188)))));
     this.btnMore.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(225)))), ((int)(((byte)(205)))));
     this.btnMore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.btnMore.Image = global::MSWordWizCite.Properties.Resources.more_icon;
     this.btnMore.Location = new System.Drawing.Point(323, 159);
     this.btnMore.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
     this.btnMore.Name = "btnMore";
     this.btnMore.Size = new System.Drawing.Size(24, 19);
     this.btnMore.TabIndex = 7;
     this.btnMore.TabStop = false;
     //
     // ctrlPreview
     //
     this.ctrlPreview.AutoScroll = true;
     this.ctrlPreview.AutoSize = true;
     this.ctrlPreview.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.ctrlPreview.BackColor = System.Drawing.SystemColors.Window;
     this.ctrlPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.ctrlPreview.Dock = System.Windows.Forms.DockStyle.Fill;
     this.ctrlPreview.Location = new System.Drawing.Point(3, 3);
     this.ctrlPreview.Name = "ctrlPreview";
     this.ctrlPreview.Size = new System.Drawing.Size(344, 202);
     this.ctrlPreview.TabIndex = 6;
     this.ctrlPreview.TabStop = false;
     //
     // cmbViews
     //
     this.cmbViews.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.cmbViews.IntegralHeight = false;
     this.cmbViews.Location = new System.Drawing.Point(-67, 3);
     this.cmbViews.MaximumSize = new System.Drawing.Size(80, 0);
     this.cmbViews.MinimumSize = new System.Drawing.Size(65, 0);
     this.cmbViews.Name = "cmbViews";
     this.cmbViews.Size = new System.Drawing.Size(65, 20);
     this.cmbViews.TabIndex = 3;
     this.cmbViews.TabStop = false;
     //
     // cmbSortBy
     //
     this.cmbSortBy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.cmbSortBy.IntegralHeight = false;
     this.cmbSortBy.Location = new System.Drawing.Point(-59, 43);
     this.cmbSortBy.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
     this.cmbSortBy.MaximumSize = new System.Drawing.Size(75, 0);
     this.cmbSortBy.MinimumSize = new System.Drawing.Size(60, 0);
     this.cmbSortBy.Name = "cmbSortBy";
     this.cmbSortBy.Size = new System.Drawing.Size(60, 20);
     this.cmbSortBy.TabIndex = 2;
     this.cmbSortBy.TabStop = false;
     //
     // MasterControl
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.AutoSize = true;
     this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.Controls.Add(this.splitParent);
     this.DoubleBuffered = true;
     this.MinimumSize = new System.Drawing.Size(350, 738);
     this.Name = "MasterControl";
     this.Size = new System.Drawing.Size(350, 738);
     this.Load += new System.EventHandler(this.MasterControl_Load);
     this.splitParent.Panel1.ResumeLayout(false);
     this.splitParent.Panel1.PerformLayout();
     this.splitParent.Panel2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.splitParent)).EndInit();
     this.splitParent.ResumeLayout(false);
     this.tableTop.ResumeLayout(false);
     this.tableTop.PerformLayout();
     this.splitChild.Panel1.ResumeLayout(false);
     this.splitChild.Panel1.PerformLayout();
     this.splitChild.Panel2.ResumeLayout(false);
     this.splitChild.Panel2.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.splitChild)).EndInit();
     this.splitChild.ResumeLayout(false);
     this.tableMiddle.ResumeLayout(false);
     this.tableMiddle.PerformLayout();
     this.flowPanel.ResumeLayout(false);
     this.flowPanel.PerformLayout();
     this.contextmenu.ResumeLayout(false);
     this.tableBottom.ResumeLayout(false);
     this.tableBottom.PerformLayout();
     this.flowLoadingFolders.ResumeLayout(false);
     this.flowLoadingFolders.PerformLayout();
     this.flowLoadingItems.ResumeLayout(false);
     this.ResumeLayout(false);
 }
예제 #20
0
 private void OnChartButtonClicked(CustomButton button)
 {
     //selectionScreen.StartCoroutine(OpenPDF());
     Application.OpenURL(button.getId());
 }
예제 #21
0
 public abstract void Render(Graphics graphics, Rectangle clipRectangle, CustomButton button);
예제 #22
0
 private void OnSelectionButtonClicked(CustomButton button)
 {
     signalBus.Fire(new SelectionSceneOpenSignal(button.getId(), button.getName()));
 }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mScrollBar = (ScrollViewer)target;
                break;

            case 2:
                this.mProfileLoader = (Border)target;
                break;

            case 3:
                this.mNoInternetWarning = (Border)target;
                break;

            case 4:
                this.mChildGrid = (Grid)target;
                break;

            case 5:
                this.mChooseProfile          = (CustomRadioButton)target;
                this.mChooseProfile.Checked += new RoutedEventHandler(this.Profile_Checked);
                break;

            case 6:
                this.mPredefinedProfilesComboBox = (CustomComboBox)target;
                this.mPredefinedProfilesComboBox.SelectionChanged += new SelectionChangedEventHandler(this.mPredefinedProfilesComboBox_SelectionChanged);
                break;

            case 7:
                this.mCustomProfile          = (CustomRadioButton)target;
                this.mCustomProfile.Checked += new RoutedEventHandler(this.Profile_Checked);
                break;

            case 8:
                this.mCustomProfileGrid = (Grid)target;
                break;

            case 9:
                this.mManufacturerTextBox = (CustomTextBox)target;
                break;

            case 10:
                this.mBrandTextBox = (CustomTextBox)target;
                break;

            case 11:
                this.mModelNumberTextBox = (CustomTextBox)target;
                break;

            case 12:
                this.mTryAgainBtnGrid = (Grid)target;
                break;

            case 13:
                ((ButtonBase)target).Click += new RoutedEventHandler(this.TryAgainBtn_Click);
                break;

            case 14:
                this.mMobileOperatorGrid = (Grid)target;
                break;

            case 15:
                this.mMobileOpertorText = (TextBlock)target;
                break;

            case 16:
                this.mMobileNetworkSetupText = (TextBlock)target;
                break;

            case 17:
                this.mMobileOperatorsCombobox = (CustomComboBox)target;
                this.mMobileOperatorsCombobox.SelectionChanged += new SelectionChangedEventHandler(this.MobileOperatorsCombobox_SelectionChanged);
                break;

            case 18:
                this.mRootAccessGrid = (Grid)target;
                break;

            case 19:
                this.mEnableRootAccessCheckBox        = (CustomCheckbox)target;
                this.mEnableRootAccessCheckBox.Click += new RoutedEventHandler(this.mEnableRootAccessCheckBox_Click);
                break;

            case 20:
                this.mInfoIcon = (CustomPictureBox)target;
                break;

            case 21:
                this.mSaveChangesBtn        = (CustomButton)target;
                this.mSaveChangesBtn.Click += new RoutedEventHandler(this.SaveChangesBtn_Click);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
예제 #24
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 2:
                this.mBorder = (Border)target;
                break;

            case 3:
                ((UIElement)target).MouseLeftButtonDown += new MouseButtonEventHandler(this.TitleMouseButonDown);
                break;

            case 4:
                this.CloseBtn = (CustomPictureBox)target;
                this.CloseBtn.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.CloseBtn_MouseLeftButtonUp);
                break;

            case 5:
                this.label = (TextBlock)target;
                break;

            case 6:
                this.mGifGrid = (StackPanel)target;
                break;

            case 7:
                this.mLoadingImage = (Image)target;
                break;

            case 8:
                this.mCategoryStackPanel = (StackPanel)target;
                break;

            case 9:
                this.mCategoryTextBlock = (TextBlock)target;
                break;

            case 10:
                this.mCategoryComboBox = (CustomComboBox)target;
                this.mCategoryComboBox.PreviewMouseDown += new MouseButtonEventHandler(this.mCategoryComboBox_PreviewMouseDown);
                this.mCategoryComboBox.SelectionChanged += new SelectionChangedEventHandler(this.CategoryChanged);
                break;

            case 11:
                this.mSubCategoryStackPanel = (StackPanel)target;
                break;

            case 12:
                this.mSubCategoryTextBlock = (TextBlock)target;
                break;

            case 13:
                this.mSubCategoryCombobox = (CustomComboBox)target;
                this.mSubCategoryCombobox.PreviewMouseDown += new MouseButtonEventHandler(this.mSubCategoryCombobox_PreviewMouseDown);
                this.mSubCategoryCombobox.SelectionChanged += new SelectionChangedEventHandler(this.SubCategoryChanged);
                break;

            case 14:
                this.mAppDetailsTextBlock = (TextBlock)target;
                break;

            case 15:
                this.mAppNameTitle = (TextBlock)target;
                break;

            case 16:
                this.mAppListComboBox = (CustomComboBox)target;
                this.mAppListComboBox.PreviewMouseDown += new MouseButtonEventHandler(this.mAppListComboBox_PreviewMouseDown);
                break;

            case 17:
                this.mAppNameGrid = (Grid)target;
                break;

            case 18:
                this.mAppNameTextBox = (CustomTextBox)target;
                break;

            case 19:
                this.mDescribeProblemTextBlock = (TextBlock)target;
                break;

            case 20:
                this.mDescribeProblemTextBox = (CustomTextBox)target;
                this.mDescribeProblemTextBox.GotKeyboardFocus += new KeyboardFocusChangedEventHandler(this.DescribeProblemTextBox_GotKeyboardFocus);
                break;

            case 21:
                this.mChooseButton = (CustomButton)target;
                this.mChooseButton.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.mChooseButton_PreviewMouseLeftButtonUp);
                break;

            case 22:
                this.mAttachedFilesListBox = (ListBox)target;
                break;

            case 23:
                this.mEmailTextBlock = (TextBlock)target;
                break;

            case 24:
                this.mEmailTextBox = (CustomTextBox)target;
                this.mEmailTextBox.GotKeyboardFocus += new KeyboardFocusChangedEventHandler(this.EmailTextBox_GotKeyboardFocus);
                break;

            case 25:
                this.mAlIOemsCheckbox            = (CustomCheckbox)target;
                this.mAlIOemsCheckbox.Unchecked += new RoutedEventHandler(this.mAllInstancesCheckbox_Unchecked);
                break;

            case 26:
                this.mHelpIcon            = (CustomPictureBox)target;
                this.mHelpIcon.MouseDown += new MouseButtonEventHandler(this.CustomPictureBox_MouseDown);
                break;

            case 27:
                this.mStartAllOemsCheckbox = (CustomCheckbox)target;
                break;

            case 28:
                this.mBtn = (CustomButton)target;
                this.mBtn.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.mSubmitBtn_PreviewMouseLeftButtonUp);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
예제 #25
0
        public static void shifterShift(byte targetId)
        {
            PlayerControl oldShifter = Shifter.shifter;
            PlayerControl player     = Helpers.playerById(targetId);

            if (player == null || oldShifter == null)
            {
                return;
            }

            Shifter.futureShift = null;
            Shifter.clearAndReload();

            // Suicide (exile) when impostor or impostor variants
            if (player.IDOFAMCIJKE.CIDDOFDJHJH || player == Jackal.jackal || player == Sidekick.sidekick)
            {
                oldShifter.Exiled();
                return;
            }

            // Switch shield
            if (Medic.shielded != null && Medic.shielded == player)
            {
                Medic.shielded.LNMJKMLHMIM.material.SetFloat("_Outline", 0f);
                Medic.shielded = oldShifter;
            }
            else if (Medic.shielded != null && Medic.shielded == oldShifter)
            {
                Medic.shielded.LNMJKMLHMIM.material.SetFloat("_Outline", 0f);
                Medic.shielded = player;
            }

            // Shift role
            if (Jester.jester != null && Jester.jester == player)
            {
                Jester.jester = oldShifter;
            }
            else if (Mayor.mayor != null && Mayor.mayor == player)
            {
                Mayor.mayor = oldShifter;
            }
            else if (Engineer.engineer != null && Engineer.engineer == player)
            {
                Engineer.engineer = oldShifter;
            }
            else if (Sheriff.sheriff != null && Sheriff.sheriff == player)
            {
                Sheriff.sheriff = oldShifter;
            }
            else if (Lighter.lighter != null && Lighter.lighter == player)
            {
                Lighter.lighter = oldShifter;
            }
            else if (Detective.detective != null && Detective.detective == player)
            {
                Detective.detective = oldShifter;
            }
            else if (TimeMaster.timeMaster != null && TimeMaster.timeMaster == player)
            {
                TimeMaster.timeMaster = oldShifter;
            }
            else if (Medic.medic != null && Medic.medic == player)
            {
                Medic.medic = oldShifter;
            }
            else if (Swapper.swapper != null && Swapper.swapper == player)
            {
                Swapper.swapper = oldShifter;
            }
            else if (Lovers.lover1 != null && Lovers.lover1 == player)
            {
                Lovers.lover1 = oldShifter;
            }
            else if (Lovers.lover2 != null && Lovers.lover2 == player)
            {
                Lovers.lover2 = oldShifter;
            }
            else if (Seer.seer != null && Seer.seer == player)
            {
                Seer.seer = oldShifter;
            }
            else if (Hacker.hacker != null && Hacker.hacker == player)
            {
                Hacker.hacker = oldShifter;
            }
            else if (Child.child != null && Child.child == player)
            {
                Child.child = oldShifter;
            }
            else if (Tracker.tracker != null && Tracker.tracker == player)
            {
                Tracker.tracker = oldShifter;
            }
            else if (Snitch.snitch != null && Snitch.snitch == player)
            {
                Snitch.snitch = oldShifter;
            }
            else if (Spy.spy != null && Spy.spy == player)
            {
                Spy.spy = oldShifter;
            }
            else     // Crewmate
            {
            }

            // Set cooldowns to max for both players
            if (PlayerControl.LocalPlayer == oldShifter || PlayerControl.LocalPlayer == player)
            {
                CustomButton.ResetAllCooldowns();
            }
        }
        private void Init()
        {
            Grid coverGrid = new Grid {
                RowSpacing = 0
            };

            MainGrid.Children.Add(coverGrid, 0, 0); // 메인 그리드 추가

            #region 주문번호
            CustomLabel order_numLabel = new CustomLabel
            {
                Text            = "주문 번호 : " + purchaseList.SH_PURCHACE_INDEX.ToString(),
                Size            = 18,
                TextColor       = Color.Black,
                Margin          = new Thickness(15, 0, 0, 0),
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 40
            });
            coverGrid.Children.Add(order_numLabel, 0, 0);
            #endregion

            BoxView borderLine1 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine1, 0, 1);

            #region 상품 이름
            Grid nameGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView nameLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout nameCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel nameLabel = new CustomLabel
            {
                Text              = "상품 이름",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_nameLabel = new CustomLabel
            {
                Text            = proList[0].SH_PUR_PRODUCT_NAME + " 외 " + proList.Count + "개",
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            nameGrid.Children.Add(nameLine, 0, 0);
            nameGrid.Children.Add(nameCover, 0, 0);
            nameCover.Children.Add(nameLabel);
            nameGrid.Children.Add(input_nameLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(nameGrid, 0, 2);
            BoxView borderLine2 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine2, 0, 3);
            #endregion


            #region 배송비 선불/착불
            Grid delivery_priceGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView delivery_priceLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout delivery_priceCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel delivery_priceLabel = new CustomLabel
            {
                Text              = "배송비",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_delivery_priceLabel = new CustomLabel
            {
                Text            = pdList[0].SH_PUR_DELIVERY_PAY.ToString("N0") + "원 / " + pdList[0].SH_PUR_DELIVERY_OPTION,
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            delivery_priceGrid.Children.Add(delivery_priceLine, 0, 0);
            delivery_priceGrid.Children.Add(delivery_priceCover, 0, 0);
            delivery_priceCover.Children.Add(delivery_priceLabel);
            delivery_priceGrid.Children.Add(input_delivery_priceLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(delivery_priceGrid, 0, 4);
            BoxView borderLine3 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine3, 0, 5);
            #endregion

            #region 배송지
            Grid delivery_adressGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView delivery_adressLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout delivery_adressCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel delivery_adressLabel = new CustomLabel
            {
                Text              = "배송지",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_delivery_adressLabel = new CustomLabel
            {
                Text            = pdList[0].SH_PUR_DELIVERY_ADRESS,
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            delivery_adressGrid.Children.Add(delivery_adressLine, 0, 0);
            delivery_adressGrid.Children.Add(delivery_adressCover, 0, 0);
            delivery_adressCover.Children.Add(delivery_adressLabel);
            delivery_adressGrid.Children.Add(input_delivery_adressLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(delivery_adressGrid, 0, 6);
            BoxView borderLine4 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine4, 0, 7);
            #endregion


            #region 배송 연락번호
            Grid delivery_phoneGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView delivery_phoneLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout delivery_phoneCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel delivery_phoneLabel = new CustomLabel
            {
                Text              = "연락처",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_delivery_phoneLabel = new CustomLabel
            {
                Text            = pdList[0].SH_PUR_DELIVERY_PHONE,
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            delivery_phoneGrid.Children.Add(delivery_phoneLine, 0, 0);
            delivery_phoneGrid.Children.Add(delivery_phoneCover, 0, 0);
            delivery_phoneCover.Children.Add(delivery_phoneLabel);
            delivery_phoneGrid.Children.Add(input_delivery_phoneLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(delivery_phoneGrid, 0, 8);
            BoxView borderLine5 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine5, 0, 9);
            #endregion


            #region 배송 요청사항
            Grid delivery_detailGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView delivery_detailLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout delivery_detailCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel delivery_detaileLabel = new CustomLabel
            {
                Text              = "배송요청사항",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_delivery_detailLabel = new CustomLabel
            {
                Text            = pdList[0].SH_PUR_DELIVERY_DETAIL,
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            delivery_detailGrid.Children.Add(delivery_detailLine, 0, 0);
            delivery_detailGrid.Children.Add(delivery_detailCover, 0, 0);
            delivery_detailCover.Children.Add(delivery_detaileLabel);
            delivery_detailGrid.Children.Add(input_delivery_detailLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(delivery_detailGrid, 0, 10);

            BoxView borderLine6 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine6, 0, 11);
            #endregion

            #region 결제방식
            string testOption = "";

            if (purchaseList.SH_PAY_METHOD == "card")
            {
                testOption = "신용카드";
            }
            Grid pay_optionGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView pay_optionLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout pay_optionCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel pay_optionLabel = new CustomLabel
            {
                Text              = "결제방식",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_pay_optionLabel = new CustomLabel
            {
                Text            = testOption,
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            pay_optionGrid.Children.Add(pay_optionLine, 0, 0);
            pay_optionGrid.Children.Add(pay_optionCover, 0, 0);
            pay_optionCover.Children.Add(pay_optionLabel);
            pay_optionGrid.Children.Add(input_pay_optionLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(pay_optionGrid, 0, 12);

            BoxView borderLine7 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine7, 0, 13);
            #endregion

            #region 결제방식에 따른 레이블(카드, 은행, 핸드폰 등)
            Grid pay_bank_phone_Grid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(3, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(7, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView pay_bank_phone_Line = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout pay_bank_phone_Cover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel pay_bank_phone_Label = new CustomLabel
            {
                Text              = "",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_bank_phone_Label = new CustomLabel
            {
                Text            = "",
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            pay_bank_phone_Grid.Children.Add(pay_bank_phone_Line, 0, 0);
            pay_bank_phone_Grid.Children.Add(pay_bank_phone_Cover, 0, 0);
            pay_bank_phone_Cover.Children.Add(pay_bank_phone_Label);
            pay_bank_phone_Grid.Children.Add(input_bank_phone_Label, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(pay_bank_phone_Grid, 0, 14);

            BoxView borderLine8 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine8, 0, 15);
            #endregion

            int payoption_row = 16;


            if (purchaseList.SH_PAY_METHOD == "card")
            {
                pay_bank_phone_Label.Text   = "결제번호";
                input_bank_phone_Label.Text = purchaseList.SH_IMP_UID;
            }
            //List<SH_Pay_Card> card = SH_DB.PostSearchPayCardToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString());
            //input_bank_phone_Label.Text = card[0].SH_PAY_CARD_KINDS;
            //}
            //else if (ppList[0].SH_PUR_PAY_OPTION == "Business")
            //{
            //    pay_bank_phone_Label.Text = "결제은행";
            //    List<SH_Pay_Business> business = SH_DB.PostSearchPayBusinessToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString());
            //    input_bank_phone_Label.Text = business[0].SH_PAY_BUSINESS_BANK;

            //    #region 사업자 등록번호
            //    Grid pay_num_Grid = new Grid
            //    {
            //        ColumnDefinitions =
            //        {
            //            new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) },
            //            new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) },
            //        },
            //        RowSpacing = 0,
            //    };
            //    BoxView pay_num_Line = new BoxView { BackgroundColor = Color.LightGray };
            //    StackLayout pay_num_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 };
            //    CustomLabel pay_num_Label = new CustomLabel
            //    {
            //        Text = "사업자등록번호",
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //        HorizontalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    CustomLabel input_num_Label = new CustomLabel
            //    {
            //        Text = business[0].SH_PAY_BUSINESS_NUM,
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    pay_num_Grid.Children.Add(pay_num_Line, 0, 0);
            //    pay_num_Grid.Children.Add(pay_num_Cover, 0, 0);
            //    pay_num_Cover.Children.Add(pay_num_Label);
            //    pay_num_Grid.Children.Add(input_num_Label, 1, 0);

            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
            //    coverGrid.Children.Add(pay_num_Grid, 0, payoption_row++); // 17

            //    BoxView borderLine9 = new BoxView { BackgroundColor = Color.LightGray };
            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 });
            //    coverGrid.Children.Add(borderLine9, 0, payoption_row++); // 18
            //    #endregion

            //    #region 사업자 등록이름
            //    Grid pay_name_Grid = new Grid
            //    {
            //        ColumnDefinitions =
            //        {
            //            new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) },
            //            new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) },
            //        },
            //        RowSpacing = 0,
            //    };
            //    BoxView pay_name_Line = new BoxView { BackgroundColor = Color.LightGray };
            //    StackLayout pay_name_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 };
            //    CustomLabel pay_name_Label = new CustomLabel
            //    {
            //        Text = "사업자이름",
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //        HorizontalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    CustomLabel input_name_Label = new CustomLabel
            //    {
            //        Text = business[0].SH_PAY_BUSINESS_NAME,
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    pay_name_Grid.Children.Add(pay_name_Line, 0, 0);
            //    pay_name_Grid.Children.Add(pay_name_Cover, 0, 0);
            //    pay_name_Cover.Children.Add(pay_name_Label);
            //    pay_name_Grid.Children.Add(input_name_Label, 1, 0);

            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
            //    coverGrid.Children.Add(pay_name_Grid, 0, payoption_row++); // 19

            //    BoxView borderLine10 = new BoxView { BackgroundColor = Color.LightGray };
            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 });
            //    coverGrid.Children.Add(borderLine10, 0, payoption_row++); // 20
            //    #endregion
            //}
            //else if (ppList[0].SH_PUR_PAY_OPTION == "Personal")
            //{
            //    pay_bank_phone_Label.Text = "결제은행";
            //    List<SH_Pay_Personal> personal = SH_DB.PostSearchPayPersonalToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString());
            //    input_bank_phone_Label.Text = personal[0].SH_PAY_PERSONAL_BANK;

            //    #region 개인 현금영수증 번호
            //    Grid pay_num_Grid = new Grid
            //    {
            //        ColumnDefinitions =
            //        {
            //            new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) },
            //            new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) },
            //        },
            //        RowSpacing = 0,
            //    };
            //    BoxView pay_num_Line = new BoxView { BackgroundColor = Color.LightGray };
            //    StackLayout pay_num_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 };
            //    CustomLabel pay_num_Label = new CustomLabel
            //    {
            //        Text = "현금영수증번호",
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //        HorizontalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    CustomLabel input_num_Label = new CustomLabel
            //    {
            //        Text = personal[0].SH_PAY_PERSONAL_NUM,
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    pay_num_Grid.Children.Add(pay_num_Line, 0, 0);
            //    pay_num_Grid.Children.Add(pay_num_Cover, 0, 0);
            //    pay_num_Cover.Children.Add(pay_num_Label);
            //    pay_num_Grid.Children.Add(input_num_Label, 1, 0);

            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
            //    coverGrid.Children.Add(pay_num_Grid, 0, payoption_row++); // 17

            //    BoxView borderLine9 = new BoxView { BackgroundColor = Color.LightGray };
            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 });
            //    coverGrid.Children.Add(borderLine9, 0, payoption_row++); // 18
            //    #endregion

            //    #region 개인 이름
            //    Grid pay_name_Grid = new Grid
            //    {
            //        ColumnDefinitions =
            //        {
            //            new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) },
            //            new ColumnDefinition { Width = new GridLength(7, GridUnitType.Star) },
            //        },
            //        RowSpacing = 0,
            //    };
            //    BoxView pay_name_Line = new BoxView { BackgroundColor = Color.LightGray };
            //    StackLayout pay_name_Cover = new StackLayout { BackgroundColor = Color.White, Margin = 1 };
            //    CustomLabel pay_name_Label = new CustomLabel
            //    {
            //        Text = "이름",
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //        HorizontalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    CustomLabel input_name_Label = new CustomLabel
            //    {
            //        Text = personal[0].SH_PAY_PERSONAL_NAME,
            //        Size = 14,
            //        TextColor = Color.DarkGray,
            //        VerticalOptions = LayoutOptions.CenterAndExpand,
            //    };
            //    pay_name_Grid.Children.Add(pay_name_Line, 0, 0);
            //    pay_name_Grid.Children.Add(pay_name_Cover, 0, 0);
            //    pay_name_Cover.Children.Add(pay_name_Label);
            //    pay_name_Grid.Children.Add(input_name_Label, 1, 0);

            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
            //    coverGrid.Children.Add(pay_name_Grid, 0, payoption_row++); // 19

            //    BoxView borderLine10 = new BoxView { BackgroundColor = Color.LightGray };
            //    coverGrid.RowDefinitions.Add(new RowDefinition { Height = 1 });
            //    coverGrid.Children.Add(borderLine10, 0, payoption_row++); // 20
            //    #endregion
            //}
            //else if (ppList[0].SH_PUR_PAY_OPTION == "Phone")
            //{
            //    pay_bank_phone_Label.Text = "통신사";
            //    List<SH_Pay_Phone> phone = SH_DB.PostSearchPayPhoneToIndex(ppList[0].SH_PUR_PAY_INDEX.ToString());
            //    input_bank_phone_Label.Text = phone[0].SH_PAY_PHONE_KINDS;
            //}


            #region 결제금액
            Grid pay_priceGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView pay_priceLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout pay_priceCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel pay_priceLabel = new CustomLabel
            {
                Text              = "결제금액",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_pay_priceLabel = new CustomLabel
            {
                Text            = purchaseList.SH_AMOUNT.ToString("N0"),
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            pay_priceGrid.Children.Add(pay_priceLine, 0, 0);
            pay_priceGrid.Children.Add(pay_priceCover, 0, 0);
            pay_priceCover.Children.Add(pay_priceLabel);
            pay_priceGrid.Children.Add(input_pay_priceLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(pay_priceGrid, 0, payoption_row++);

            BoxView borderLine11 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine11, 0, payoption_row++);
            #endregion

            #region 사용된 포인트
            Grid pay_pointGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView pay_pointLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout pay_pointCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel pay_pointLabel = new CustomLabel
            {
                Text              = "사용포인트",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_pay_pointLabel = new CustomLabel
            {
                Text            = purchaseList.SH_USE_POINT.ToString() + " point",
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            pay_pointGrid.Children.Add(pay_pointLine, 0, 0);
            pay_pointGrid.Children.Add(pay_pointCover, 0, 0);
            pay_pointCover.Children.Add(pay_pointLabel);
            pay_pointGrid.Children.Add(input_pay_pointLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(pay_pointGrid, 0, payoption_row++);

            BoxView borderLine12 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine12, 0, payoption_row++);
            #endregion

            #region 결제상태
            Grid pay_stateGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                },
                RowSpacing = 0,
            };
            BoxView pay_stateLine = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout pay_stateCover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel pay_stateLabel = new CustomLabel
            {
                Text              = "결제상태",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_pay_stateLabel = new CustomLabel
            {
                Text            = purchaseList.SH_STATUS,
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            pay_stateGrid.Children.Add(pay_stateLine, 0, 0);
            pay_stateGrid.Children.Add(pay_stateCover, 0, 0);
            pay_stateCover.Children.Add(pay_stateLabel);
            pay_stateGrid.Children.Add(input_pay_stateLabel, 1, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(pay_stateGrid, 0, payoption_row++);

            BoxView borderLine13 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine13, 0, payoption_row++);
            #endregion


            #region 운송장번호
            Grid deliveryNumberGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = 100
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = 100
                    },
                },
                RowSpacing = 0,
            };
            BoxView deliveryNumber_Line = new BoxView {
                BackgroundColor = Color.LightGray
            };
            StackLayout deliveryNumber_Cover = new StackLayout {
                BackgroundColor = Color.White, Margin = 1
            };
            CustomLabel deliveryNumber_Label = new CustomLabel
            {
                Text              = "운송장번호",
                Size              = 14,
                TextColor         = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomLabel input_deliveryNumber_Label = new CustomLabel
            {
                Text            = "123", // default
                Size            = 14,
                TextColor       = Color.DarkGray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            CustomButton deliveryLookup_Button = new CustomButton
            {
                Text              = "배송조회",
                Size              = 14,
                TextColor         = Color.White,
                BackgroundColor   = Color.DarkGray,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };
            deliveryLookup_Button.Clicked += (sender, args) =>
            {
                if (input_deliveryNumber_Label.Text == "")     // 운송장 번호가 없을경우
                {
                    DisplayAlert("알림", "송장번호가 존재하지 않습니다!", "확인");
                    return;
                }
                else
                {
                    Navigation.PushAsync(new DeliveryLookup(input_deliveryNumber_Label.Text));
                }
            };

            deliveryNumberGrid.Children.Add(deliveryNumber_Line, 0, 0);
            deliveryNumberGrid.Children.Add(deliveryNumber_Cover, 0, 0);
            deliveryNumber_Cover.Children.Add(deliveryNumber_Label);
            deliveryNumberGrid.Children.Add(input_deliveryNumber_Label, 1, 0);
            deliveryNumberGrid.Children.Add(deliveryLookup_Button, 2, 0);

            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            coverGrid.Children.Add(deliveryNumberGrid, 0, payoption_row++);

            BoxView borderLine14 = new BoxView {
                BackgroundColor = Color.LightGray
            };
            coverGrid.RowDefinitions.Add(new RowDefinition {
                Height = 1
            });
            coverGrid.Children.Add(borderLine14, 0, payoption_row++);
            #endregion
        }
예제 #27
0
 private void OnEnable()
 {
     mono = (CustomButton)target;
 }
예제 #28
0
 public void addButton(CustomButton button)
 {
     buttons.Add(button);
     this.guiCustomized = true;
 }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                ((FrameworkElement)target).Loaded += new RoutedEventHandler(this.MainWindow_Loaded);
                break;

            case 2:
                this.mTitleIcon = (CustomPictureBox)target;
                break;

            case 3:
                this.mTitle            = (TextBlock)target;
                this.mTitle.MouseDown += new MouseButtonEventHandler(this.TitleBar_MouseDown);
                break;

            case 4:
                this.mMinimizeButton = (CustomPictureBox)target;
                this.mMinimizeButton.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.MinimizeButton_MouseLeftButtonUp);
                break;

            case 5:
                this.mCrossButton = (CustomPictureBox)target;
                this.mCrossButton.MouseLeftButtonUp += new MouseButtonEventHandler(this.CloseButton_MouseLeftButtonUp);
                break;

            case 6:
                this.mBodyPanel = (StackPanel)target;
                break;

            case 7:
                this.mBodyText = (TextBlock)target;
                break;

            case 8:
                this.mProgressGrid = (Grid)target;
                break;

            case 9:
                this.mProgressStatus = (TextBlock)target;
                break;

            case 10:
                this.mProgressPercent = (TextBlock)target;
                break;

            case 11:
                this.mProgressBar = (BlueProgressBar)target;
                break;

            case 12:
                this.mButtonGrid = (Grid)target;
                break;

            case 13:
                this.mCancelBtn        = (CustomButton)target;
                this.mCancelBtn.Click += new RoutedEventHandler(this.Btn_Click);
                break;

            case 14:
                this.mBtn        = (CustomButton)target;
                this.mBtn.Click += new RoutedEventHandler(this.Launch_Click);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
예제 #30
0
 public void addButton(string action, string type, string path)
 {
     CustomButton cb = new CustomButton(action, type, path);
     addButton(cb);
 }
예제 #31
0
        public static void Postfix(HudManager __instance)
        {
            // Engineer Repair
            engineerRepairButton = new CustomButton(
                () => {
                engineerRepairButton.Timer = 0f;

                MessageWriter usedRepairWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerUsedRepair, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(usedRepairWriter);
                RPCProcedure.engineerUsedRepair();

                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixLights)
                    {
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerFixLights, Hazel.SendOption.Reliable, -1);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.engineerFixLights();
                    }
                    else if (task.TaskType == TaskTypes.RestoreOxy)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 0 | 64);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 1 | 64);
                    }
                    else if (task.TaskType == TaskTypes.ResetReactor)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 16);
                    }
                    else if (task.TaskType == TaskTypes.ResetSeismic)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Laboratory, 16);
                    }
                    else if (task.TaskType == TaskTypes.FixComms)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 0);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 1);
                    }
                    else if (task.TaskType == TaskTypes.StopCharles)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 0 | 16);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 1 | 16);
                    }
                }
            },
                () => { return(Engineer.engineer != null && Engineer.engineer == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => {
                bool sabotageActive = false;
                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixLights || task.TaskType == TaskTypes.RestoreOxy || task.TaskType == TaskTypes.ResetReactor || task.TaskType == TaskTypes.ResetSeismic || task.TaskType == TaskTypes.FixComms || task.TaskType == TaskTypes.StopCharles)
                    {
                        sabotageActive = true;
                    }
                }
                return(sabotageActive && !Engineer.usedRepair && PlayerControl.LocalPlayer.AMDJMEEHNIG);
            },
                () => {},
                Engineer.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Janitor Clean
            janitorCleanButton = new CustomButton(
                () => {
                foreach (Collider2D collider2D in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.GetTruePosition(), PlayerControl.LocalPlayer.MaxReportDistance, Constants.NFGGONLDDAN))
                {
                    if (collider2D.tag == "DeadBody")
                    {
                        DeadBody component = collider2D.GetComponent <DeadBody>();
                        if (component && !component.Reported)
                        {
                            Vector2 truePosition  = PlayerControl.LocalPlayer.GetTruePosition();
                            Vector2 truePosition2 = component.NCMFGFMFDJB;
                            if (Vector2.Distance(truePosition2, truePosition) <= PlayerControl.LocalPlayer.MaxReportDistance && PlayerControl.LocalPlayer.AMDJMEEHNIG && !PhysicsHelpers.GCFCONMBBOF(truePosition, truePosition2, Constants.DHLPLBPJNBA, false))
                            {
                                GameData.OFKOJOKOOAK OFKOJOKOOAK = GameData.Instance.GetPlayerById(component.ParentId);

                                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JanitorClean, Hazel.SendOption.Reliable, -1);
                                writer.Write(OFKOJOKOOAK.GMBAIPNOKLP);
                                AmongUsClient.Instance.FinishRpcImmediately(writer);
                                RPCProcedure.janitorClean(OFKOJOKOOAK.GMBAIPNOKLP);
                                janitorCleanButton.Timer = janitorCleanButton.MaxTimer;

                                break;
                            }
                        }
                    }
                }
            },
                () => { return(Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(__instance.ReportButton.renderer.color == Palette.MKAFGNEBHKC && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { janitorCleanButton.Timer = janitorCleanButton.MaxTimer; },
                Janitor.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Sheriff Kill
            sheriffKillButton = new CustomButton(
                () => {
                if (Medic.shielded != null && Medic.shielded == Sheriff.currentTarget)
                {
                    MessageWriter attemptWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.Reliable, -1);
                    AmongUsClient.Instance.FinishRpcImmediately(attemptWriter);
                    RPCProcedure.shieldedMurderAttempt();
                    return;
                }

                byte targetId = 0;
                if ((Sheriff.currentTarget.IDOFAMCIJKE.CIDDOFDJHJH && (Sheriff.currentTarget != Child.child || Child.isGrownUp())) ||
                    Sheriff.currentTarget == Jackal.jackal ||
                    Sheriff.currentTarget == Sidekick.sidekick ||
                    (Sheriff.spyCanDieToSheriff && Spy.spy != null && Spy.spy == Sheriff.currentTarget) ||
                    (Sheriff.jesterCanDieToSheriff && Jester.jester != null && Jester.jester == Sheriff.currentTarget))
                {
                    targetId = Sheriff.currentTarget.PlayerId;
                }
                else
                {
                    targetId = PlayerControl.LocalPlayer.PlayerId;
                }
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SheriffKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.sheriffKill(targetId);

                sheriffKillButton.Timer = sheriffKillButton.MaxTimer;
                Sheriff.currentTarget   = null;
            },
                () => { return(Sheriff.sheriff != null && Sheriff.sheriff == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Sheriff.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { sheriffKillButton.Timer = sheriffKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Time Master Rewind Time
            timeMasterShieldButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TimeMasterShield, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.timeMasterShield();
            },
                () => { return(TimeMaster.timeMaster != null && TimeMaster.timeMaster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                timeMasterShieldButton.Timer          = timeMasterShieldButton.MaxTimer;
                timeMasterShieldButton.isEffectActive = false;
                timeMasterShieldButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                TimeMaster.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                true,
                TimeMaster.shieldDuration,
                () => { timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer; }
                );

            // Medic Shield
            medicShieldButton = new CustomButton(
                () => {
                medicShieldButton.Timer = 0f;

                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MedicSetShielded, Hazel.SendOption.Reliable, -1);
                writer.Write(Medic.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.medicSetShielded(Medic.currentTarget.PlayerId);
            },
                () => { return(Medic.medic != null && Medic.medic == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(!Medic.usedShield && Medic.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {},
                Medic.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );


            // Shifter shift
            shifterShiftButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetFutureShifted, Hazel.SendOption.Reliable, -1);
                writer.Write(Shifter.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.setFutureShifted(Shifter.currentTarget.PlayerId);
            },
                () => { return(Shifter.shifter != null && Shifter.shifter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Shifter.currentTarget && Shifter.futureShift == null && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { },
                Shifter.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Morphling morph
            morphlingButton = new CustomButton(
                () => {
                if (Morphling.sampledTarget != null)
                {
                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MorphlingMorph, Hazel.SendOption.Reliable, -1);
                    writer.Write(Morphling.sampledTarget.PlayerId);
                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                    RPCProcedure.morphlingMorph(Morphling.sampledTarget.PlayerId);
                    Morphling.sampledTarget        = null;
                    morphlingButton.EffectDuration = 10f;
                }
                else if (Morphling.currentTarget != null)
                {
                    Morphling.sampledTarget        = Morphling.currentTarget;
                    morphlingButton.Sprite         = Morphling.getMorphSprite();
                    morphlingButton.EffectDuration = 1f;
                }
            },
                () => { return(Morphling.morphling != null && Morphling.morphling == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return((Morphling.currentTarget || Morphling.sampledTarget) && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                morphlingButton.Timer          = morphlingButton.MaxTimer;
                morphlingButton.Sprite         = Morphling.getSampleSprite();
                morphlingButton.isEffectActive = false;
                morphlingButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
                Morphling.sampledTarget = null;
            },
                Morphling.getSampleSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                true,
                10f,
                () => {
                if (Morphling.sampledTarget == null)
                {
                    morphlingButton.Timer  = morphlingButton.MaxTimer;
                    morphlingButton.Sprite = Morphling.getSampleSprite();
                }
            }
                );

            // Camouflager camouflage
            camouflagerButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CamouflagerCamouflage, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.camouflagerCamouflage();
            },
                () => { return(Camouflager.camouflager != null && Camouflager.camouflager == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                camouflagerButton.Timer          = camouflagerButton.MaxTimer;
                camouflagerButton.isEffectActive = false;
                camouflagerButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Camouflager.getButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                true,
                10f,
                () => { camouflagerButton.Timer = camouflagerButton.MaxTimer; }
                );

            // Hacker button
            hackerButton = new CustomButton(
                () => {
                Hacker.hackerTimer = Hacker.duration;
            },
                () => { return(Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                hackerButton.Timer          = hackerButton.MaxTimer;
                hackerButton.isEffectActive = false;
                hackerButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Hacker.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                true,
                0f,
                () => {
                hackerButton.Timer = hackerButton.MaxTimer;
            }
                );

            // Tracker button
            trackerButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TrackerUsedTracker, Hazel.SendOption.Reliable, -1);
                writer.Write(Tracker.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.trackerUsedTracker(Tracker.currentTarget.PlayerId);
            },
                () => { return(Tracker.tracker != null && Tracker.tracker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG && Tracker.currentTarget != null && !Tracker.usedTracker); },
                () => { },
                Tracker.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            vampireKillButton = new CustomButton(
                () => {
                if (Helpers.handleMurderAttempt(Vampire.currentTarget))
                {
                    if (Vampire.targetNearGarlic)
                    {
                        PlayerControl.LocalPlayer.RpcMurderPlayer(Vampire.currentTarget);
                        vampireKillButton.HasEffect = false;     // Block effect on this click
                        vampireKillButton.Timer     = vampireKillButton.MaxTimer;
                    }
                    else
                    {
                        Vampire.bitten = Vampire.currentTarget;
                        // Notify players about bitten
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
                        writer.Write(Vampire.bitten.PlayerId);
                        writer.Write(0);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.vampireSetBitten(Vampire.bitten.PlayerId, 0);

                        PlayerControl.LocalPlayer.StartCoroutine(Effects.LDACHPMFOIF(Vampire.delay, new Action <float>((p) => {    // Delayed action
                            if (p == 1f)
                            {
                                if (Vampire.bitten != null && !Vampire.bitten.IDOFAMCIJKE.FGNJJFABIHJ && Helpers.handleMurderAttempt(Vampire.bitten))
                                {
                                    // Perform kill
                                    MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
                                    AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                                    RPCProcedure.vampireTryKill();
                                }
                                else
                                {
                                    // Notify players about clearing bitten
                                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
                                    writer.Write(byte.MaxValue);
                                    writer.Write(byte.MaxValue);
                                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                                    RPCProcedure.vampireSetBitten(byte.MaxValue, byte.MaxValue);
                                }
                            }
                        })));

                        vampireKillButton.HasEffect = true;     // Trigger effect on this click
                    }
                }
                else
                {
                    vampireKillButton.HasEffect = false;     // Block effect if no action was fired
                }
            },
                () => { return(Vampire.vampire != null && Vampire.vampire == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => {
                if (Vampire.targetNearGarlic && Vampire.canKillNearGarlics)
                {
                    vampireKillButton.killButtonManager.renderer.sprite = __instance.KillButton.renderer.sprite;
                }
                else
                {
                    vampireKillButton.killButtonManager.renderer.sprite = Vampire.getButtonSprite();
                }
                return(Vampire.currentTarget != null && PlayerControl.LocalPlayer.AMDJMEEHNIG && (!Vampire.targetNearGarlic || Vampire.canKillNearGarlics));
            },
                () => {
                vampireKillButton.Timer          = vampireKillButton.MaxTimer;
                vampireKillButton.isEffectActive = false;
                vampireKillButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Vampire.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                false,
                0f,
                () => {
                vampireKillButton.Timer = vampireKillButton.MaxTimer;
            }
                );

            garlicButton = new CustomButton(
                () => {
                Vampire.localPlacedGarlic = true;
                var pos     = PlayerControl.LocalPlayer.transform.position;
                byte[] buff = new byte[sizeof(float) * 2];
                Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
                Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));

                MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PlaceGarlic, Hazel.SendOption.Reliable);
                writer.WriteBytesAndSize(buff);
                writer.EndMessage();
                RPCProcedure.placeGarlic(buff);
            },
                () => { return(!Vampire.localPlacedGarlic && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ && Vampire.garlicsActive); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG && !Vampire.localPlacedGarlic); },
                () => { },
                Vampire.getGarlicButtonSprite(),
                Vector3.zero,
                __instance,
                true
                );


            // Jackal Sidekick Button
            jackalSidekickButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalCreatesSidekick, Hazel.SendOption.Reliable, -1);
                writer.Write(Jackal.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.jackalCreatesSidekick(Jackal.currentTarget.PlayerId);
            },
                () => { return(Jackal.canCreateSidekick && Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.currentTarget != null && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { jackalSidekickButton.Timer = jackalSidekickButton.MaxTimer; },
                Jackal.getSidekickButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance
                );

            // Jackal Kill
            jackalKillButton = new CustomButton(
                () => {
                if (!Helpers.handleMurderAttempt(Jackal.currentTarget))
                {
                    return;
                }
                byte targetId            = Jackal.currentTarget.PlayerId;
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.jackalKill(targetId);
                jackalKillButton.Timer = jackalKillButton.MaxTimer;
                Jackal.currentTarget   = null;
            },
                () => { return(Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Jackal.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { jackalKillButton.Timer = jackalKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Sidekick Kill
            sidekickKillButton = new CustomButton(
                () => {
                if (!Helpers.handleMurderAttempt(Sidekick.currentTarget))
                {
                    return;
                }
                byte targetId            = Sidekick.currentTarget.PlayerId;
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.sidekickKill(targetId);

                sidekickKillButton.Timer = sidekickKillButton.MaxTimer;
                Sidekick.currentTarget   = null;
            },
                () => { return(Sidekick.canKill && Sidekick.sidekick != null && Sidekick.sidekick == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(Sidekick.currentTarget && PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => { sidekickKillButton.Timer = sidekickKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance
                );

            // Lighter light
            lighterButton = new CustomButton(
                () => {
                Lighter.lighterTimer = Lighter.duration;
            },
                () => { return(Lighter.lighter != null && Lighter.lighter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG); },
                () => {
                lighterButton.Timer          = lighterButton.MaxTimer;
                lighterButton.isEffectActive = false;
                lighterButton.killButtonManager.TimerText.Color = Palette.MKAFGNEBHKC;
            },
                Lighter.getButtonSprite(),
                new Vector3(-1.3f, 0f, 0f),
                __instance,
                true,
                Lighter.duration,
                () => { lighterButton.Timer = lighterButton.MaxTimer; }
                );

            // Eraser erase button
            eraserButton = new CustomButton(
                () => {
                eraserButton.MaxTimer += 10;
                eraserButton.Timer     = eraserButton.MaxTimer;

                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetFutureErased, Hazel.SendOption.Reliable, -1);
                writer.Write(Eraser.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.setFutureErased(Eraser.currentTarget.PlayerId);
            },
                () => { return(Eraser.eraser != null && Eraser.eraser == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.IDOFAMCIJKE.FGNJJFABIHJ); },
                () => { return(PlayerControl.LocalPlayer.AMDJMEEHNIG && Eraser.currentTarget != null); },
                () => { eraserButton.Timer = eraserButton.MaxTimer; },
                Eraser.getButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance
                );

            // Set the default (or settings from the previous game) timers/durations when spawning the buttons
            setCustomButtonCooldowns();
        }
예제 #32
0
 public void CloseCard(CustomButton button)
 {
     button.ShowClosedCardImage();
 }
예제 #33
0
        /// <summary>
        /// Adds a new custom button to the header with the given image.
        /// </summary>
        /// <returns>
        /// The index of the button in the list of custom buttons. Can be used in the click handler.
        /// </returns>
        public int AddCustomButton(int width, int height, Bitmap bitmap, bool active)
        {
            CustomButton button = new CustomButton(bitmap, new Rectangle(0, 0, width, height));
              customButtons.Add(button);
              if (active)
            activeCustomButton = button;
              ComputeButtonOffsets();

              return customButtons.Count - 1;
        }
예제 #34
0
        private void CreateDesignSurface(int n)
        {
            //- step.0
            //- create a DesignSurface and put it inside a Form in DesignTime
            DesignSurfaceExt.DesignSurfaceExt surface = new DesignSurfaceExt.DesignSurfaceExt();
            //-
            //-
            //- store for later use
            _listOfDesignSurface.Add(surface);
            //-
            //-
            //- step.1
            //- choose an alignment mode...
            switch (n)
            {
            case 1:
                surface.UseSnapLines();
                break;

            case 2:
                surface.UseGrid(new System.Drawing.Size(16, 16));
                break;

            case 3:
                surface.UseGridWithoutSnapping(new System.Drawing.Size(32, 32));
                break;

            case 4:
                surface.UseNoGuides();
                break;

            default:
                Console.WriteLine("Invalid selection");
                break;
            }

            //-
            //-
            //- step.2
            //- create the Root compoment, in these cases a Form
            try
            {
                Form rootComponent = null;
                switch (n)
                {
                case 1:
                {
                    rootComponent           = surface.CreateRootComponent <Form>(new Size(400, 400));
                    rootComponent.BackColor = Color.Gray;
                    rootComponent.Text      = "Root Component hosted by the DesignSurface N.1";
                    //- step.3
                    //- create some Controls at DesignTime
                    TextBox      t1 = surface.CreateControl <TextBox>(new Size(200, 23), new Point(172, 12));
                    Button       b1 = surface.CreateControl <Button>(new Size(200, 40), new Point(172, 63));
                    CustomButton b2 = surface.CreateControl <CustomButton>(new Size(200, 40), new Point(100, 200));
                    b1.Text      = "I'm the first Button";
                    b2.Text      = "I'm the second Button";
                    b1.BackColor = Color.LightGray;
                    b2.BackColor = Color.LightGreen;

                    RadioButton rb1 = surface.CreateControl <RadioButton>(new Size(120, 22), new Point(12, 21));
                    rb1.Text = "Check me!";
                    RadioButton rb2 = surface.CreateControl <RadioButton>(new Size(120, 22), new Point(12, 50));
                    rb2.Text    = "No, check me!";
                    rb2.Checked = true;

                    Panel pnl = surface.CreateControl <Panel>(new Size(130, 100), new Point(12, 21));
                    pnl.BackColor = Color.Aquamarine;
                    rb1.Parent    = pnl;
                    rb2.Parent    = pnl;

                    PictureBox pb1 = surface.CreateControl <PictureBox>(new Size(64, 64), new Point(24, 166));
                    pb1.Image = new Icon("painter.ico").ToBitmap();

                    ContextMenuStrip cm1 = surface.CreateComponent <ContextMenuStrip>();
                }

                break;

                case 2:
                {
                    rootComponent           = surface.CreateRootComponent <Form>(new Size(640, 480));
                    rootComponent.BackColor = Color.Yellow;
                    rootComponent.Text      = "Root Component hosted by the DesignSurface N.2";
                    //- step.3
                    //- create some Controls at DesignTime
                    TextBox t1 = surface.CreateControl <TextBox>(new Size(200, 20), new Point(10, 10));
                    Button  b1 = surface.CreateControl <Button>(new Size(200, 40), new Point(10, 40));
                    Label   l1 = surface.CreateControl <Label>(new Size(200, 120), new Point(48, 100));
                    t1.Text      = "I'm a TextBox";
                    b1.Text      = "I'm a Button";
                    b1.BackColor = Color.Coral;
                    l1.Text      = "I'm a Label";
                    l1.BackColor = Color.Coral;

                    ComboBox cb1 = surface.CreateControl <ComboBox>(new Size(200, 20), new Point(288, 16));
                    cb1.Items.AddRange(new string[] { "a1", "b2", "c3" });
                    cb1.SelectedIndex = 1;

                    ListBox lb1 = surface.CreateControl <ListBox>(new Size(200, 130), new Point(288, 100));
                    lb1.Items.AddRange(new string[] { "a1", "b2", "c3" });

                    TreeView tv1 = surface.CreateControl <TreeView>(new Size(290, 160), new Point(20, 220));
                }

                break;

                case 3:
                {
                    rootComponent           = surface.CreateRootComponent <Form>(new Size(800, 600));
                    rootComponent.BackColor = Color.YellowGreen;
                    rootComponent.Text      = "Root Component hosted by the DesignSurface N.3";
                    //- step.3
                    //- create some Controls at DesignTime
                    Button b1 = surface.CreateControl <Button>(new Size(200, 40), new Point(10, 10));
                    Button b2 = surface.CreateControl <Button>(new Size(200, 40), new Point(100, 100));
                    Button b3 = surface.CreateControl <Button>(new Size(200, 40), new Point(22, 22));
                    b1.Text = "I'm the first Button";
                    b2.Text = "I'm the second Button";
                    b3.Text = "I'm the third Button (belonging to the BroupBox)";
                    GroupBox gb = surface.CreateControl <GroupBox>(new Size(300, 180), new Point(100, 200));
                    b3.Parent    = gb;
                    b3.BackColor = Color.LightGray;

                    ListView  lb1 = surface.CreateControl <ListView>(new Size(290, 160), new Point(320, 30));
                    ImageList im1 = surface.CreateComponent <ImageList>();
                }

                break;

                case 4:
                {
                    rootComponent           = surface.CreateRootComponent <Form>(new Size(320, 200));
                    rootComponent.BackColor = Color.Orange;
                    rootComponent.Text      = "Root Component hosted by the DesignSurface N.4";          //- step.1
                                                                                                         //- step.3
                                                                                                         //- create some Controls at DesignTime
                    Button b1 = surface.CreateControl <Button>(new Size(200, 40), new Point(10, 10));
                    Button b2 = surface.CreateControl <Button>(new Size(200, 40), new Point(100, 100));
                    b1.Text      = "I'm the first Button";
                    b2.Text      = "I'm the second Button";
                    b1.BackColor = Color.Gold;
                    b2.BackColor = Color.LightGreen;

                    Timer      tm11 = surface.CreateComponent <Timer>();
                    FontDialog fd1  = surface.CreateComponent <FontDialog>();
                }

                break;

                default:
                    Console.WriteLine("Invalid selection");
                    break;
                }

                //-
                //-
                //- step.4
                //- display the DesignSurface
                Control view = surface.GetView();
                if (null == view)
                {
                    return;
                }
                //- change some properties
                view.Text = "Test Form N. " + n.ToString();
                view.Dock = DockStyle.Fill;
                //- Note these assignments
                switch (n)
                {
                case 1:
                    view.Parent = tabPage1;
                    break;

                case 2:
                    view.Parent = tabPage2;
                    break;

                case 3:
                    view.Parent = tabPage3;
                    break;

                case 4:
                    view.Parent = tabPage4;
                    break;

                default:
                    Console.WriteLine("Invalid selection");
                    break;
                }
            }//end_try
            catch (Exception)
            {
                Console.WriteLine(Name + " the DesignSurface N. " + n.ToString() + " has generated errors during loading!");
                return;
            }//end_catch
        }
예제 #35
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            bool handled = false;

              if (e.Button == MouseButtons.Left)
              {
            // Check for the tab popup. The bounding rectangle is only set if there are tabs.
            if (popupButtonBounds.Contains(new Point(e.X, e.Y)))
            {
              handled = true;
              tabMenu.Show(this, new Point(popupButtonBounds.X, popupButtonBounds.Y + popupButtonBounds.Height));
            }

            // Change the expanded state only when header is not hidden
            if (!handled && !disableExpansion && DisplayMode != CollapsingPanelDisplayMode.TabsOnly &&
              DisplayMode != CollapsingPanelDisplayMode.NoHeader
              && e.Y < headerHeight)
            {
              if (e.X <= 10 + 12)
              {
            if (!disableExpansionIcon)
              Expanded = !Expanded;
            handled = true;
              }
              else
              {
            int offsetX = Width;

            // Test for - button hit.
            if (displayTabActionButtons)
            {
              offsetX -= Resources.collapsing_panel_header_tab_del.Width;
              if (e.X > offsetX && TabDelButtonClicked != null)
              {
                TabDelButtonClicked(this, new EventArgs());
                handled = true;
              }
              else
              {
                // + button hit.
                offsetX -= Resources.collapsing_panel_header_tab_add.Width;
                if (e.X > offsetX && TabAddButtonClicked != null)
                {
                  TabAddButtonClicked(this, new EventArgs());
                  SelectedTabIndex = cachedTabWidths.Count;
                  handled = true;
                }
              }
              ScrollIntoView(selectedTabIndex);
            }

            if (!handled)
            {
              // Any custom button.
              if (CustomButtonClicked != null)
              {
                for (int index = customButtons.Count - 1; index >= 0; index--)
                {
                  CustomButton button = customButtons[index];
                  offsetX -= button.boundingBox.Width;
                  if (e.X > offsetX)
                  {
                    if (activeCustomButton != null)
                      Invalidate(activeCustomButton.boundingBox);

                    activeCustomButton = button;
                    CustomButtonClicked(this, index);
                    handled = true;
                    Invalidate(activeCustomButton.boundingBox);

                    break;
                  }
                }
              }
            }
              }
            }

            if (!handled)
            {
              // Was a tab hit?
              int tabFound = GetTabAtPosition(e.X, e.Y);
              if (tabFound > -1)
              {
            SelectedTabIndex = tabFound;
            handled = true;
              }
            }
              }

              if (!handled)
            base.OnMouseClick(e);
        }
예제 #36
0
        private static void ProcessWholeSaleOrder()
        {
            UPCNumber             upcNumber    = new UPCNumber();
            SerialNumberGenerator serialNumber = SerialNumberGenerator.Instance;

            _serialNumber = serialNumber.NextSerial;
            AbstractGadget myMediumGadgetCP = new GadgetMedium(WidgetColor.Painted, GadgetColor.Painted, GadgetPower.Solar, _serialNumber, upcNumber.UPCMedium);

            myMediumGadgetCP = new CustomButton(myMediumGadgetCP, 5, GadgetType.Custom);
            myMediumGadgetCP = new CustomSwitches(myMediumGadgetCP, 4, GadgetType.Custom);


            _serialNumber = serialNumber.NextSerial;
            AbstractGadget myMediumGadgetCPL = new GadgetMedium(WidgetColor.Plated, GadgetColor.Plated, GadgetPower.Battery, _serialNumber, upcNumber.UPCMedium);

            myMediumGadgetCPL = new CustomButton(myMediumGadgetCPL, 7, GadgetType.Custom);
            myMediumGadgetCPL = new CustomSwitches(myMediumGadgetCPL, 5, GadgetType.Custom);

            _serialNumber = serialNumber.NextSerial;
            AbstractGadget myMediumGadgetCUP = new GadgetMedium(_serialNumber, upcNumber.UPCMedium);

            myMediumGadgetCUP = new CustomButton(myMediumGadgetCUP, 4, GadgetType.Custom);
            myMediumGadgetCUP = new CustomSwitches(myMediumGadgetCUP, 7, GadgetType.Custom);


            _serialNumber = serialNumber.NextSerial;
            AbstractGadget myLargeGadgetCP = new GadgetLarge(WidgetColor.Painted, GadgetColor.Painted, GadgetPower.Generator, _serialNumber, upcNumber.UPCLarge);

            myLargeGadgetCP = new CustomButton(myLargeGadgetCP, 5, GadgetType.Custom);
            myLargeGadgetCP = new CustomSwitches(myLargeGadgetCP, 4, GadgetType.Custom);
            myLargeGadgetCP = new CustomLights(myLargeGadgetCP, 8, GadgetType.Custom);


            _serialNumber = serialNumber.NextSerial;
            AbstractGadget myLargeGadgetCPL = new GadgetLarge(WidgetColor.Plated, GadgetColor.Plated, GadgetPower.Solar, _serialNumber, upcNumber.UPCLarge);

            myLargeGadgetCPL = new CustomButton(myLargeGadgetCPL, 7, GadgetType.Custom);
            myLargeGadgetCPL = new CustomSwitches(myLargeGadgetCPL, 5, GadgetType.Custom);
            myLargeGadgetCPL = new CustomLights(myLargeGadgetCPL, 3, GadgetType.Custom);


            _serialNumber = serialNumber.NextSerial;
            AbstractGadget myLargeGadgetCUP = new GadgetLarge(_serialNumber, upcNumber.UPCLarge);

            myLargeGadgetCUP = new CustomButton(myLargeGadgetCUP, 6, GadgetType.Custom);
            myLargeGadgetCUP = new CustomSwitches(myLargeGadgetCUP, 3, GadgetType.Custom);
            myLargeGadgetCUP = new CustomLights(myLargeGadgetCUP, 5, GadgetType.Custom);


            ArrayList Order1 = new ArrayList();

            Order1.Add(myMediumGadgetCP);
            Order1.Add(myMediumGadgetCPL);
            Order1.Add(myMediumGadgetCUP);
            Order1.Add(myLargeGadgetCP);
            Order1.Add(myLargeGadgetCPL);
            Order1.Add(myLargeGadgetCUP);


            CustomOutput customReceipt = new CustomOutput(Order1);
        }
예제 #37
0
        /// <summary>
        /// Shows the dialog. After the dialog is created, the <see cref="Opened"/>
        /// event occurs which allows to customize the dialog. When the dialog is closed, the
        /// <see cref="Closing"/> event occurs.
        /// 
        /// Starting with the <see cref="Opened"/>, you can call methods on the active task dialog
        /// to update its state until the <see cref="Closing"/> event occurs.
        /// </summary>
        /// <param name="owner">The window handle of the owner</param>
        public void Show(IntPtr hwndOwner)
        {
            // Recursive Show() is not possible because we would use the same callback delegate..
            if (currentOwnerHwnd.HasValue)
                throw new InvalidOperationException("Cannot recursively show the same task dialog instance.");

            CheckButtonConfig();
            PrepareButtonConfig(out currentCustomButtons, out currentRadioButtons);

            currentOwnerHwnd = hwndOwner;
            TaskDialogConfig config;
            CreateConfig(out config);
            try
            {
                int ret = 0;
                int resultButtonID, resultRadioButtonID;
                try
                {
                    ret = TaskDialogIndirect(ref config, out resultButtonID, out resultRadioButtonID,
                        out resultVerificationFlagChecked);
                }
                // Only catch exceptions if the hWnd of the task dialog is not set, otherwise the exception
                // must have occured in the callback.
                // Note: If a exception occurs here when hwndDialog is not 0, it means the TaskDialogIndirect
                // run the event loop and called a WndProc e.g. from a window, whose event handler threw an 
                // exception. In that case we cannot catch and marshal it to a HResult, so the CLR will 
                // manipulate the managed stack so that it doesn't contain the transition to and from native
                // code. However, the TaskDialog still calls our TaskDialogCallbackProc (by dispatching
                // messages to the WndProc) when the current event handler from WndProc returns, but the GC might
                // already have collected the delegate to it which will cause a NRE/AccessViolation.

                // This is OK because the same issue occurs when using a Messagebox with WPF or WinForms:
                // If do MessageBox.Show() wrapped in a try/catch on a button click, and before calling .Show()
                // create and start a timer which stops and throws an exception on its Tick event,
                // the application will crash with an AccessViolationException as soon as you close the MessageBox.
                catch (Exception ex) when (hwndDialog == IntPtr.Zero &&
                    (ex is DllNotFoundException || ex is EntryPointNotFoundException))
                {
                    // Show a regular messagebox instead. This should only happen if we debug and for some
                    // reason the VS host process doesn't use our manifest.
                    StringBuilder msgContent = new StringBuilder();
                    if (MainInstruction != null)
                        msgContent.Append(MainInstruction + "\n\n");
                    if (Content != null)
                        msgContent.Append(Content + "\n\n");
                    if (ExpandedInformation != null)
                        msgContent.Append(ExpandedInformation + "\n\n");
                    MessageBox.Show(msgContent.ToString(), Title, MessageBoxButton.OK);

                    resultButtonID = (int)TaskDialogResult.Ok;
                    resultRadioButtonID = 0;
                }
                // Marshal.ThrowExceptionForHR will use the IErrorInfo on the current thread if it exists, ignoring
                // the error code. Therefore we only call it if the HResult is not OK to avoid incorrect
                // exceptions being thrown.
                // However, if the HResult indicates an error we need to use the IErrorInfo because the exception might
                // be a managed exception thorwn in the callback and translated to a HResult by
                // Marshal.GetHRForException(Exception).
                if (ret != HResultOk)
                    Marshal.ThrowExceptionForHR(ret);

                // Set the result fields
                CustomButton myResultCustomButton = null;
                if (currentCustomButtons?.TryGetValue(resultButtonID, out myResultCustomButton) == true)
                {
                    resultCustomButton = myResultCustomButton;
                    resultCommonButtonID = 0;
                }
                else
                {
                    resultCommonButtonID = (TaskDialogResult)resultButtonID;
                    resultCustomButton = null;
                }

                // Note that even if we have radio buttons, it could be that the user didn't select one.
                if (!(currentRadioButtons?.TryGetValue(resultRadioButtonID, out resultRadioButton) == true))
                    resultRadioButton = null;

            }
            finally
            {
                // Clear the handles and free the memory.
                currentOwnerHwnd = null;
                DisposeConfig(ref config);

                ClearButtonConfig(currentCustomButtons, currentRadioButtons);
                currentCustomButtons = null;
                currentRadioButtons = null;

                // We need to ensure the callback delegate is not garbage-collected as long as TaskDialogIndirect
                // doesn't return, by calling GC.KeepAlive().
                // 
                // This is not an exaggeration, as the comment for GC.KeepAlive() says the following:
                // The JIT is very aggressive about keeping an 
                // object's lifetime to as small a window as possible, to the point
                // where a 'this' pointer isn't considered live in an instance method
                // unless you read a value from the instance.
                GC.KeepAlive(callbackProcDelegate);
            }
        }
예제 #38
0
        private void CriarPaginaAndroid()
        {
            var alturaTela     = Height;
            var alturaHeader   = alturaTela * .20f;
            var alturaFooter   = alturaTela * .08f;
            var spacingContent = alturaTela * .0f;

            logoHeader = new Image
            {
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Center,
                Aspect            = Aspect.AspectFill
            };
            header = new Frame
            {
                OutlineColor      = COR_PAGE_HEADER_FOOTER,
                BackgroundColor   = COR_PAGE_HEADER_FOOTER,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                HeightRequest     = alturaHeader,
                WidthRequest      = alturaHeader,
                Padding           = new Thickness(-5),
            };
            header.Content = logoHeader;

            // instancia de objetos da pagina que nao precisam de size request relativo ao tamanho da pagina
            var txtFooter = new Label
            {
                Text                    = TXT_PAGE_FOOTER,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.Center
            };

            var btnVoltarPesquisa = new CustomButton
            {
                Text              = "Voltar à votação",
                FontSize          = FONTE_TEXTO_LABELS,
                FontFamily        = FAMILIA_TEXTO_LABELS,
                FontAttributes    = ATRIBUTOS_TEXTO_LABELS,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                TextColor         = COR_TEXTO_LABELS,
                BorderRadius      = 20,
                HeightRequest     = FONTE_TEXTO_LABELS + 30,
                //WidthRequest = larguraBody / 2,
                CorBackgroundCustomRed   = 30,
                CorBackgroundCustomGreen = 30,
                CorBackgroundCustomBlue  = 30
            };

            btnVoltarPesquisa.Clicked += async(sender, eventArgs) => await Navigation.PopAsync();

            var btnConfirmarPesquisa = new CustomButton
            {
                Text              = "Confirmar",
                FontSize          = FONTE_TEXTO_LABELS,
                FontFamily        = FAMILIA_TEXTO_LABELS,
                FontAttributes    = ATRIBUTOS_TEXTO_LABELS,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                TextColor         = COR_TEXTO_LABELS,
                BorderRadius      = 20,
                HeightRequest     = FONTE_TEXTO_LABELS + 30,
                //WidthRequest = larguraBody / 2,
                CorBackgroundCustomRed   = 30,
                CorBackgroundCustomGreen = 30,
                CorBackgroundCustomBlue  = 30
            };

            btnConfirmarPesquisa.Clicked += async(sender, eventArgs) =>
            {
                await Navigation.PushAsync(new AgradecimentoPage());

                Navigation.RemovePage(_votarEstampaPage);
                Navigation.RemovePage(this);
            };

            btnsContainer = new StackLayout
            {
                Padding           = new Thickness(20, 0),
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Spacing           = 20f,
                Children          =
                {
                    btnVoltarPesquisa, btnConfirmarPesquisa
                }
            };

            imageAgradecimento = new Image
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Aspect            = Aspect.AspectFill
            };

            var containerEstampa = new StackLayout
            {
                Padding           = new Thickness(0),
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Children          = { imageAgradecimento }
            };

            var txtContainerFooter = new Frame
            {
                OutlineColor    = COR_PAGE_HEADER_FOOTER,
                BackgroundColor = COR_PAGE_HEADER_FOOTER,

                VerticalOptions = LayoutOptions.EndAndExpand,
                Content         = txtFooter
            };

            var footer = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Children    =
                {
                    btnsContainer,
                },
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding           = new Thickness(0, 10, 0, 0),
                HeightRequest     = alturaFooter
            };



            // set conteudo da página
            Content = new StackLayout
            {
                Padding     = new Thickness(-4),
                Orientation = StackOrientation.Vertical,
                Spacing     = spacingContent,
                Children    =
                {
                    header, containerEstampa, footer
                }
            };
        }
예제 #39
0
 public override void Render(Graphics graphics, Rectangle clipRectangle, CustomButton button)
 {
     Color border;
     Color background;
     Color foreground;
     if(button.Enabled)
     {
         if(button.IsPressed)
         {
             border		= ColorTable.PressedBorder;
             background	= ColorTable.PressedBackground;
             foreground	= ColorTable.Foreground;
         }
         else if(button.Focused || button.IsMouseOver)
         {
             border		= ColorTable.HoverBorder;
             background	= ColorTable.HoverBackground;
             foreground	= ColorTable.Foreground;
         }
         else
         {
             border		= ColorTable.Border;
             background	= ColorTable.Background;
             foreground	= ColorTable.Foreground;
         }
     }
     else
     {
         border		= ColorTable.DisabledBorder;
         background	= ColorTable.DisabledBackground;
         foreground	= ColorTable.DisabledForeground;
     }
     using(var brush = new SolidBrush(background))
     {
         graphics.FillRectangle(brush, clipRectangle);
     }
     var bounds = new Rectangle(Point.Empty, button.Size);
     TextRenderer.DrawText(graphics, button.Text, button.Font, bounds, foreground);
     using(var pen = new Pen(border))
     {
         bounds.Width -= 1;
         bounds.Height -= 1;
         graphics.DrawRectangle(pen, bounds);
     }
 }
        Widget _buildHeadTop(IEvent eventObj)
        {
            Widget shareWidget = new CustomButton(
                onPressed: () => ActionSheetUtils.showModalActionSheet(new ShareView(
                                                                           projectType: ProjectType.iEvent,
                                                                           onPressed: type => {
                AnalyticsManager.ClickShare(type, "Event", "Event_" + eventObj.id, eventObj.title);

                var linkUrl =
                    $"{Config.apiAddress}/events/{eventObj.id}";
                if (type == ShareType.clipBoard)
                {
                    this.widget.actionModel.copyText(linkUrl);
                    CustomDialogUtils.showToast("复制链接成功", Icons.check_circle_outline);
                }
                else
                {
                    var imageUrl = CImageUtils.SizeTo200ImageUrl(eventObj.avatar);
                    CustomDialogUtils.showCustomDialog(
                        child: new CustomLoadingDialog()
                        );
                    this.widget.actionModel.shareToWechat(type, eventObj.title, eventObj.shortDescription,
                                                          linkUrl,
                                                          imageUrl, null).Then(CustomDialogUtils.hiddenCustomDialog)
                    .Catch(_ => CustomDialogUtils.hiddenCustomDialog());
                }
            })),
                child: new Container(
                    color: CColors.Transparent,
                    child: new Icon(Icons.share, size: 24,
                                    color: this._showNavBarShadow ? CColors.White : CColors.Icon))
                );

            Widget titleWidget = new Container();

            if (this._isHaveTitle)
            {
                titleWidget = new Text(
                    eventObj.title,
                    style: CTextStyle.PXLargeMedium,
                    maxLines: 1,
                    overflow: TextOverflow.ellipsis,
                    textAlign: TextAlign.center
                    );
            }

            return(new AnimatedContainer(
                       height: 44 + this._topPadding,
                       duration: TimeSpan.Zero,
                       padding: EdgeInsets.only(left: 8, right: 8, top: this._topPadding),
                       decoration: new BoxDecoration(
                           CColors.White,
                           border: new Border(
                               bottom: new BorderSide(this._isHaveTitle ? CColors.Separator2 : CColors.Transparent)),
                           gradient: this._showNavBarShadow
                        ? new LinearGradient(
                               colors: new List <Color> {
                new Color(0x80000000),
                new Color(0x0)
            },
                               begin: Alignment.topCenter,
                               end: Alignment.bottomCenter
                               )
                        : null
                           ),
                       child: new Row(
                           mainAxisAlignment: MainAxisAlignment.spaceBetween,
                           children: new List <Widget> {
                new CustomButton(
                    onPressed: () => this.widget.actionModel.mainRouterPop(),
                    child: new Icon(
                        Icons.arrow_back,
                        size: 24,
                        color: this._showNavBarShadow ? CColors.White : CColors.Icon
                        )
                    ),
                new Expanded(
                    child: new Stack(
                        fit: StackFit.expand,
                        children: new List <Widget> {
                    new PositionedTransition(
                        rect: this._animation,
                        child: titleWidget
                        )
                }
                        )
                    ),
                shareWidget
            }
                           )
                       ));
        }
예제 #41
0
        public static void Postfix(HudManager __instance)
        {
            // Engineer Repair
            engineerRepairButton = new CustomButton(
                () => {
                engineerRepairButton.Timer = 0f;

                MessageWriter usedRepairWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerUsedRepair, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(usedRepairWriter);
                RPCProcedure.engineerUsedRepair();

                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixLights)
                    {
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.EngineerFixLights, Hazel.SendOption.Reliable, -1);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.engineerFixLights();
                    }
                    else if (task.TaskType == TaskTypes.RestoreOxy)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 0 | 64);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 1 | 64);
                    }
                    else if (task.TaskType == TaskTypes.ResetReactor)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 16);
                    }
                    else if (task.TaskType == TaskTypes.ResetSeismic)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Laboratory, 16);
                    }
                    else if (task.TaskType == TaskTypes.FixComms)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 0);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 1);
                    }
                    else if (task.TaskType == TaskTypes.StopCharles)
                    {
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 0 | 16);
                        ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 1 | 16);
                    }
                }
            },
                () => { return(Engineer.engineer != null && Engineer.engineer == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => {
                bool sabotageActive = false;
                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixLights || task.TaskType == TaskTypes.RestoreOxy || task.TaskType == TaskTypes.ResetReactor || task.TaskType == TaskTypes.ResetSeismic || task.TaskType == TaskTypes.FixComms || task.TaskType == TaskTypes.StopCharles)
                    {
                        sabotageActive = true;
                    }
                }
                return(sabotageActive && !Engineer.usedRepair && PlayerControl.LocalPlayer.CanMove);
            },
                () => {},
                Engineer.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );

            // Janitor Clean
            janitorCleanButton = new CustomButton(
                () => {
                foreach (Collider2D collider2D in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.GetTruePosition(), PlayerControl.LocalPlayer.MaxReportDistance, Constants.PlayersOnlyMask))
                {
                    if (collider2D.tag == "DeadBody")
                    {
                        DeadBody component = collider2D.GetComponent <DeadBody>();
                        if (component && !component.Reported)
                        {
                            Vector2 truePosition  = PlayerControl.LocalPlayer.GetTruePosition();
                            Vector2 truePosition2 = component.TruePosition;
                            if (Vector2.Distance(truePosition2, truePosition) <= PlayerControl.LocalPlayer.MaxReportDistance && PlayerControl.LocalPlayer.CanMove && !PhysicsHelpers.AnythingBetween(truePosition, truePosition2, Constants.ShipAndObjectsMask, false))
                            {
                                GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);

                                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CleanBody, Hazel.SendOption.Reliable, -1);
                                writer.Write(playerInfo.PlayerId);
                                AmongUsClient.Instance.FinishRpcImmediately(writer);
                                RPCProcedure.cleanBody(playerInfo.PlayerId);
                                janitorCleanButton.Timer = janitorCleanButton.MaxTimer;

                                break;
                            }
                        }
                    }
                }
            },
                () => { return(Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(__instance.ReportButton.renderer.color == Palette.EnabledColor && PlayerControl.LocalPlayer.CanMove); },
                () => { janitorCleanButton.Timer = janitorCleanButton.MaxTimer; },
                Janitor.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );

            // Sheriff Kill
            sheriffKillButton = new CustomButton(
                () => {
                if (Medic.shielded != null && Medic.shielded == Sheriff.currentTarget)
                {
                    MessageWriter attemptWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShieldedMurderAttempt, Hazel.SendOption.Reliable, -1);
                    AmongUsClient.Instance.FinishRpcImmediately(attemptWriter);
                    RPCProcedure.shieldedMurderAttempt();
                    return;
                }

                byte targetId = 0;
                if ((Sheriff.currentTarget.Data.IsImpostor && (Sheriff.currentTarget != Child.child || Child.isGrownUp())) ||
                    (Sheriff.spyCanDieToSheriff && Spy.spy == Sheriff.currentTarget) ||
                    (Sheriff.canKillNeutrals && (Arsonist.arsonist == Sheriff.currentTarget || Jester.jester == Sheriff.currentTarget || Jackal.jackal == Sheriff.currentTarget || Sidekick.sidekick == Sheriff.currentTarget)))
                {
                    targetId = Sheriff.currentTarget.PlayerId;
                }
                else
                {
                    targetId = PlayerControl.LocalPlayer.PlayerId;
                }
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SheriffKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.sheriffKill(targetId);

                sheriffKillButton.Timer = sheriffKillButton.MaxTimer;
                Sheriff.currentTarget   = null;
            },
                () => { return(Sheriff.sheriff != null && Sheriff.sheriff == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(Sheriff.currentTarget && PlayerControl.LocalPlayer.CanMove); },
                () => { sheriffKillButton.Timer = sheriffKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );

            // Time Master Rewind Time
            timeMasterShieldButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TimeMasterShield, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.timeMasterShield();
            },
                () => { return(TimeMaster.timeMaster != null && TimeMaster.timeMaster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(PlayerControl.LocalPlayer.CanMove); },
                () => {
                timeMasterShieldButton.Timer          = timeMasterShieldButton.MaxTimer;
                timeMasterShieldButton.isEffectActive = false;
                timeMasterShieldButton.killButtonManager.TimerText.color = Palette.EnabledColor;
            },
                TimeMaster.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q,
                true,
                TimeMaster.shieldDuration,
                () => { timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer; }
                );

            // Medic Shield
            medicShieldButton = new CustomButton(
                () => {
                medicShieldButton.Timer = 0f;

                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MedicSetShielded, Hazel.SendOption.Reliable, -1);
                writer.Write(Medic.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.medicSetShielded(Medic.currentTarget.PlayerId);
            },
                () => { return(Medic.medic != null && Medic.medic == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(!Medic.usedShield && Medic.currentTarget && PlayerControl.LocalPlayer.CanMove); },
                () => {},
                Medic.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );


            // Shifter shift
            shifterShiftButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetFutureShifted, Hazel.SendOption.Reliable, -1);
                writer.Write(Shifter.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.setFutureShifted(Shifter.currentTarget.PlayerId);
            },
                () => { return(Shifter.shifter != null && Shifter.shifter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(Shifter.currentTarget && Shifter.futureShift == null && PlayerControl.LocalPlayer.CanMove); },
                () => { },
                Shifter.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );

            // Morphling morph
            morphlingButton = new CustomButton(
                () => {
                if (Morphling.sampledTarget != null)
                {
                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.MorphlingMorph, Hazel.SendOption.Reliable, -1);
                    writer.Write(Morphling.sampledTarget.PlayerId);
                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                    RPCProcedure.morphlingMorph(Morphling.sampledTarget.PlayerId);
                    Morphling.sampledTarget        = null;
                    morphlingButton.EffectDuration = Morphling.duration;
                }
                else if (Morphling.currentTarget != null)
                {
                    Morphling.sampledTarget        = Morphling.currentTarget;
                    morphlingButton.Sprite         = Morphling.getMorphSprite();
                    morphlingButton.EffectDuration = 1f;
                }
            },
                () => { return(Morphling.morphling != null && Morphling.morphling == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return((Morphling.currentTarget || Morphling.sampledTarget) && PlayerControl.LocalPlayer.CanMove); },
                () => {
                morphlingButton.Timer          = morphlingButton.MaxTimer;
                morphlingButton.Sprite         = Morphling.getSampleSprite();
                morphlingButton.isEffectActive = false;
                morphlingButton.killButtonManager.TimerText.color = Palette.EnabledColor;
                Morphling.sampledTarget = null;
            },
                Morphling.getSampleSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F,
                true,
                Morphling.duration,
                () => {
                if (Morphling.sampledTarget == null)
                {
                    morphlingButton.Timer  = morphlingButton.MaxTimer;
                    morphlingButton.Sprite = Morphling.getSampleSprite();
                }
            }
                );

            // Camouflager camouflage
            camouflagerButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CamouflagerCamouflage, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.camouflagerCamouflage();
            },
                () => { return(Camouflager.camouflager != null && Camouflager.camouflager == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(PlayerControl.LocalPlayer.CanMove); },
                () => {
                camouflagerButton.Timer          = camouflagerButton.MaxTimer;
                camouflagerButton.isEffectActive = false;
                camouflagerButton.killButtonManager.TimerText.color = Palette.EnabledColor;
            },
                Camouflager.getButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F,
                true,
                Camouflager.duration,
                () => { camouflagerButton.Timer = camouflagerButton.MaxTimer; }
                );

            // Hacker button
            hackerButton = new CustomButton(
                () => {
                Hacker.hackerTimer = Hacker.duration;
            },
                () => { return(Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(PlayerControl.LocalPlayer.CanMove); },
                () => {
                hackerButton.Timer          = hackerButton.MaxTimer;
                hackerButton.isEffectActive = false;
                hackerButton.killButtonManager.TimerText.color = Palette.EnabledColor;
            },
                Hacker.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q,
                true,
                0f,
                () => {
                hackerButton.Timer = hackerButton.MaxTimer;
            }
                );

            // Tracker button
            trackerButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.TrackerUsedTracker, Hazel.SendOption.Reliable, -1);
                writer.Write(Tracker.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.trackerUsedTracker(Tracker.currentTarget.PlayerId);
            },
                () => { return(Tracker.tracker != null && Tracker.tracker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(PlayerControl.LocalPlayer.CanMove && Tracker.currentTarget != null && !Tracker.usedTracker); },
                () => { },
                Tracker.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );

            vampireKillButton = new CustomButton(
                () => {
                if (Helpers.handleMurderAttempt(Vampire.currentTarget))
                {
                    if (Vampire.targetNearGarlic)
                    {
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1);
                        writer.Write(Vampire.vampire.PlayerId);
                        writer.Write(Vampire.currentTarget.PlayerId);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.uncheckedMurderPlayer(Vampire.vampire.PlayerId, Vampire.currentTarget.PlayerId);

                        vampireKillButton.HasEffect = false;     // Block effect on this click
                        vampireKillButton.Timer     = vampireKillButton.MaxTimer;
                    }
                    else
                    {
                        Vampire.bitten = Vampire.currentTarget;
                        // Notify players about bitten
                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
                        writer.Write(Vampire.bitten.PlayerId);
                        writer.Write(0);
                        AmongUsClient.Instance.FinishRpcImmediately(writer);
                        RPCProcedure.vampireSetBitten(Vampire.bitten.PlayerId, 0);

                        HudManager.Instance.StartCoroutine(Effects.Lerp(Vampire.delay, new Action <float>((p) => {    // Delayed action
                            if (p == 1f)
                            {
                                if (Vampire.bitten != null && !Vampire.bitten.Data.IsDead && Helpers.handleMurderAttempt(Vampire.bitten))
                                {
                                    // Perform kill
                                    MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
                                    AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                                    RPCProcedure.vampireTryKill();
                                }
                                else
                                {
                                    // Notify players about clearing bitten
                                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1);
                                    writer.Write(byte.MaxValue);
                                    writer.Write(byte.MaxValue);
                                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                                    RPCProcedure.vampireSetBitten(byte.MaxValue, byte.MaxValue);
                                }
                            }
                        })));

                        vampireKillButton.HasEffect = true;     // Trigger effect on this click
                    }
                }
                else
                {
                    vampireKillButton.HasEffect = false;     // Block effect if no action was fired
                }
            },
                () => { return(Vampire.vampire != null && Vampire.vampire == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => {
                if (Vampire.targetNearGarlic && Vampire.canKillNearGarlics)
                {
                    vampireKillButton.killButtonManager.renderer.sprite = __instance.KillButton.renderer.sprite;
                }
                else
                {
                    vampireKillButton.killButtonManager.renderer.sprite = Vampire.getButtonSprite();
                }
                return(Vampire.currentTarget != null && PlayerControl.LocalPlayer.CanMove && (!Vampire.targetNearGarlic || Vampire.canKillNearGarlics));
            },
                () => {
                vampireKillButton.Timer          = vampireKillButton.MaxTimer;
                vampireKillButton.isEffectActive = false;
                vampireKillButton.killButtonManager.TimerText.color = Palette.EnabledColor;
            },
                Vampire.getButtonSprite(),
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q,
                false,
                0f,
                () => {
                vampireKillButton.Timer = vampireKillButton.MaxTimer;
            }
                );

            garlicButton = new CustomButton(
                () => {
                Vampire.localPlacedGarlic = true;
                var pos     = PlayerControl.LocalPlayer.transform.position;
                byte[] buff = new byte[sizeof(float) * 2];
                Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
                Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));

                MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PlaceGarlic, Hazel.SendOption.Reliable);
                writer.WriteBytesAndSize(buff);
                writer.EndMessage();
                RPCProcedure.placeGarlic(buff);
            },
                () => { return(!Vampire.localPlacedGarlic && !PlayerControl.LocalPlayer.Data.IsDead && Vampire.garlicsActive); },
                () => { return(PlayerControl.LocalPlayer.CanMove && !Vampire.localPlacedGarlic); },
                () => { },
                Vampire.getGarlicButtonSprite(),
                Vector3.zero,
                __instance,
                null,
                true
                );


            // Jackal Sidekick Button
            jackalSidekickButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalCreatesSidekick, Hazel.SendOption.Reliable, -1);
                writer.Write(Jackal.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.jackalCreatesSidekick(Jackal.currentTarget.PlayerId);
            },
                () => { return(Jackal.canCreateSidekick && Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.currentTarget != null && PlayerControl.LocalPlayer.CanMove); },
                () => { jackalSidekickButton.Timer = jackalSidekickButton.MaxTimer; },
                Jackal.getSidekickButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F
                );

            // Jackal Kill
            jackalKillButton = new CustomButton(
                () => {
                if (!Helpers.handleMurderAttempt(Jackal.currentTarget))
                {
                    return;
                }
                byte targetId            = Jackal.currentTarget.PlayerId;
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JackalKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.jackalKill(targetId);
                jackalKillButton.Timer = jackalKillButton.MaxTimer;
                Jackal.currentTarget   = null;
            },
                () => { return(Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(Jackal.currentTarget && PlayerControl.LocalPlayer.CanMove); },
                () => { jackalKillButton.Timer = jackalKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );

            // Sidekick Kill
            sidekickKillButton = new CustomButton(
                () => {
                if (!Helpers.handleMurderAttempt(Sidekick.currentTarget))
                {
                    return;
                }
                byte targetId            = Sidekick.currentTarget.PlayerId;
                MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickKill, Hazel.SendOption.Reliable, -1);
                killWriter.Write(targetId);
                AmongUsClient.Instance.FinishRpcImmediately(killWriter);
                RPCProcedure.sidekickKill(targetId);

                sidekickKillButton.Timer = sidekickKillButton.MaxTimer;
                Sidekick.currentTarget   = null;
            },
                () => { return(Sidekick.canKill && Sidekick.sidekick != null && Sidekick.sidekick == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(Sidekick.currentTarget && PlayerControl.LocalPlayer.CanMove); },
                () => { sidekickKillButton.Timer = sidekickKillButton.MaxTimer; },
                __instance.KillButton.renderer.sprite,
                new Vector3(-1.3f, 0, 0),
                __instance,
                KeyCode.Q
                );

            // Lighter light
            lighterButton = new CustomButton(
                () => {
                Lighter.lighterTimer = Lighter.duration;
            },
                () => { return(Lighter.lighter != null && Lighter.lighter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(PlayerControl.LocalPlayer.CanMove); },
                () => {
                lighterButton.Timer          = lighterButton.MaxTimer;
                lighterButton.isEffectActive = false;
                lighterButton.killButtonManager.TimerText.color = Palette.EnabledColor;
            },
                Lighter.getButtonSprite(),
                new Vector3(-1.3f, 0f, 0f),
                __instance,
                KeyCode.Q,
                true,
                Lighter.duration,
                () => { lighterButton.Timer = lighterButton.MaxTimer; }
                );

            // Eraser erase button
            eraserButton = new CustomButton(
                () => {
                eraserButton.MaxTimer += 10;
                eraserButton.Timer     = eraserButton.MaxTimer;

                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetFutureErased, Hazel.SendOption.Reliable, -1);
                writer.Write(Eraser.currentTarget.PlayerId);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.setFutureErased(Eraser.currentTarget.PlayerId);
            },
                () => { return(Eraser.eraser != null && Eraser.eraser == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(PlayerControl.LocalPlayer.CanMove && Eraser.currentTarget != null); },
                () => { eraserButton.Timer = eraserButton.MaxTimer; },
                Eraser.getButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F
                );

            placeJackInTheBoxButton = new CustomButton(
                () => {
                placeJackInTheBoxButton.Timer = placeJackInTheBoxButton.MaxTimer;

                var pos     = PlayerControl.LocalPlayer.transform.position;
                byte[] buff = new byte[sizeof(float) * 2];
                Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
                Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));

                MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PlaceJackInTheBox, Hazel.SendOption.Reliable);
                writer.WriteBytesAndSize(buff);
                writer.EndMessage();
                RPCProcedure.placeJackInTheBox(buff);
            },
                () => { return(Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead && !JackInTheBox.hasJackInTheBoxLimitReached()); },
                () => { return(PlayerControl.LocalPlayer.CanMove && !JackInTheBox.hasJackInTheBoxLimitReached()); },
                () => { placeJackInTheBoxButton.Timer = placeJackInTheBoxButton.MaxTimer; },
                Trickster.getPlaceBoxButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F
                );

            lightsOutButton = new CustomButton(
                () => {
                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.LightsOut, Hazel.SendOption.Reliable, -1);
                AmongUsClient.Instance.FinishRpcImmediately(writer);
                RPCProcedure.lightsOut();
            },
                () => { return(Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents); },
                () => { return(PlayerControl.LocalPlayer.CanMove && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents); },
                () => {
                lightsOutButton.Timer          = lightsOutButton.MaxTimer;
                lightsOutButton.isEffectActive = false;
                lightsOutButton.killButtonManager.TimerText.color = Palette.EnabledColor;
            },
                Trickster.getLightsOutButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F,
                true,
                Trickster.lightsOutDuration,
                () => { lightsOutButton.Timer = lightsOutButton.MaxTimer; }
                );
            // Cleaner Clean
            cleanerCleanButton = new CustomButton(
                () => {
                foreach (Collider2D collider2D in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.GetTruePosition(), PlayerControl.LocalPlayer.MaxReportDistance, Constants.PlayersOnlyMask))
                {
                    if (collider2D.tag == "DeadBody")
                    {
                        DeadBody component = collider2D.GetComponent <DeadBody>();
                        if (component && !component.Reported)
                        {
                            Vector2 truePosition  = PlayerControl.LocalPlayer.GetTruePosition();
                            Vector2 truePosition2 = component.TruePosition;
                            if (Vector2.Distance(truePosition2, truePosition) <= PlayerControl.LocalPlayer.MaxReportDistance && PlayerControl.LocalPlayer.CanMove && !PhysicsHelpers.AnythingBetween(truePosition, truePosition2, Constants.ShipAndObjectsMask, false))
                            {
                                GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);

                                MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CleanBody, Hazel.SendOption.Reliable, -1);
                                writer.Write(playerInfo.PlayerId);
                                AmongUsClient.Instance.FinishRpcImmediately(writer);
                                RPCProcedure.cleanBody(playerInfo.PlayerId);

                                Cleaner.cleaner.killTimer = cleanerCleanButton.Timer = cleanerCleanButton.MaxTimer;
                                break;
                            }
                        }
                    }
                }
            },
                () => { return(Cleaner.cleaner != null && Cleaner.cleaner == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(__instance.ReportButton.renderer.color == Palette.EnabledColor && PlayerControl.LocalPlayer.CanMove); },
                () => { cleanerCleanButton.Timer = cleanerCleanButton.MaxTimer; },
                Cleaner.getButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F
                );

            // Warlock curse
            warlockCurseButton = new CustomButton(
                () => {
                if (Warlock.curseVictim == null)
                {
                    // Apply Curse
                    Warlock.curseVictim       = Warlock.currentTarget;
                    warlockCurseButton.Sprite = Warlock.getCurseKillButtonSprite();
                    warlockCurseButton.Timer  = 1f;
                }
                else if (Warlock.curseVictim != null && Warlock.curseVictimTarget != null && Helpers.handleMurderAttempt(Warlock.curseVictimTarget))
                {
                    // Curse Kill
                    Warlock.curseKillTarget = Warlock.curseVictimTarget;

                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.WarlockCurseKill, Hazel.SendOption.Reliable, -1);
                    writer.Write(Warlock.curseKillTarget.PlayerId);
                    AmongUsClient.Instance.FinishRpcImmediately(writer);
                    RPCProcedure.warlockCurseKill(Warlock.curseKillTarget.PlayerId);

                    Warlock.curseVictim       = null;
                    Warlock.curseVictimTarget = null;
                    warlockCurseButton.Sprite = Warlock.getCurseButtonSprite();
                    Warlock.warlock.killTimer = warlockCurseButton.Timer = warlockCurseButton.MaxTimer;

                    if (Warlock.rootTime > 0)
                    {
                        PlayerControl.LocalPlayer.moveable = false;
                        PlayerControl.LocalPlayer.NetTransform.Halt();                                                // Stop current movement so the warlock is not just running straight into the next object
                        HudManager.Instance.StartCoroutine(Effects.Lerp(Warlock.rootTime, new Action <float>((p) => { // Delayed action
                            if (p == 1f)
                            {
                                PlayerControl.LocalPlayer.moveable = true;
                            }
                        })));
                    }
                }
            },
                () => { return(Warlock.warlock != null && Warlock.warlock == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => { return(((Warlock.curseVictim == null && Warlock.currentTarget != null) || (Warlock.curseVictim != null && Warlock.curseVictimTarget != null)) && PlayerControl.LocalPlayer.CanMove); },
                () => {
                warlockCurseButton.Timer  = warlockCurseButton.MaxTimer;
                warlockCurseButton.Sprite = Warlock.getCurseButtonSprite();
                Warlock.curseVictim       = null;
                Warlock.curseVictimTarget = null;
            },
                Warlock.getCurseButtonSprite(),
                new Vector3(-1.3f, 1.3f, 0f),
                __instance,
                KeyCode.F
                );

            // Security Guard button
            securityGuardButton = new CustomButton(
                () => {
                if (SecurityGuard.ventTarget != null)       // Seal vent
                {
                    MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SealVent, Hazel.SendOption.Reliable);
                    writer.WritePacked(SecurityGuard.ventTarget.Id);
                    writer.EndMessage();
                    RPCProcedure.sealVent(SecurityGuard.ventTarget.Id);
                    SecurityGuard.ventTarget = null;
                }
                else if (PlayerControl.GameOptions.MapId != 1)         // Place camera if there's no vent and it's not MiraHQ
                {
                    var pos     = PlayerControl.LocalPlayer.transform.position;
                    byte[] buff = new byte[sizeof(float) * 2];
                    Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
                    Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));

                    MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PlaceCamera, Hazel.SendOption.Reliable);
                    writer.WriteBytesAndSize(buff);
                    writer.EndMessage();
                    RPCProcedure.placeCamera(buff);
                }
                securityGuardButton.Timer = securityGuardButton.MaxTimer;
            },
                () => { return(SecurityGuard.securityGuard != null && SecurityGuard.securityGuard == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead && SecurityGuard.remainingScrews >= Mathf.Min(SecurityGuard.ventPrice, SecurityGuard.camPrice)); },
                () => {
                securityGuardButton.killButtonManager.renderer.sprite = (SecurityGuard.ventTarget == null && PlayerControl.GameOptions.MapId != 1) ? SecurityGuard.getPlaceCameraButtonSprite() : SecurityGuard.getCloseVentButtonSprite();
                if (securityGuardButtonScrewsText != null)
                {
                    securityGuardButtonScrewsText.text = $"{SecurityGuard.remainingScrews}/{SecurityGuard.totalScrews}";
                }

                if (SecurityGuard.ventTarget != null)
                {
                    return(SecurityGuard.remainingScrews >= SecurityGuard.ventPrice && PlayerControl.LocalPlayer.CanMove);
                }
                return(PlayerControl.GameOptions.MapId != 1 && SecurityGuard.remainingScrews >= SecurityGuard.camPrice && PlayerControl.LocalPlayer.CanMove);
            },
                () => { securityGuardButton.Timer = securityGuardButton.MaxTimer; },
                SecurityGuard.getPlaceCameraButtonSprite(),
                new Vector3(-1.3f, 0f, 0f),
                __instance,
                KeyCode.Q
                );

            // Security Guard button screws counter
            securityGuardButtonScrewsText      = GameObject.Instantiate(securityGuardButton.killButtonManager.TimerText, securityGuardButton.killButtonManager.TimerText.transform.parent);
            securityGuardButtonScrewsText.text = "";
            securityGuardButtonScrewsText.enableWordWrapping       = false;
            securityGuardButtonScrewsText.transform.localScale     = Vector3.one * 0.5f;
            securityGuardButtonScrewsText.transform.localPosition += new Vector3(-0.05f, 0.7f, 0);

            // Arsonist button
            arsonistButton = new CustomButton(
                () => {
                bool dousedEveryoneAlive = Arsonist.dousedEveryoneAlive();
                if (dousedEveryoneAlive)
                {
                    MessageWriter winWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ArsonistWin, Hazel.SendOption.Reliable, -1);
                    AmongUsClient.Instance.FinishRpcImmediately(winWriter);
                    RPCProcedure.arsonistWin();
                    arsonistButton.HasEffect = false;
                }
                else if (Arsonist.currentTarget != null)
                {
                    Arsonist.douseTarget     = Arsonist.currentTarget;
                    arsonistButton.HasEffect = true;
                }
            },
                () => { return(Arsonist.arsonist != null && Arsonist.arsonist == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead); },
                () => {
                bool dousedEveryoneAlive = Arsonist.dousedEveryoneAlive();
                if (dousedEveryoneAlive)
                {
                    arsonistButton.killButtonManager.renderer.sprite = Arsonist.getIgniteSprite();
                }

                if (arsonistButton.isEffectActive && Arsonist.douseTarget != Arsonist.currentTarget)
                {
                    Arsonist.douseTarget          = null;
                    arsonistButton.Timer          = 0f;
                    arsonistButton.isEffectActive = false;
                }

                return(PlayerControl.LocalPlayer.CanMove && (dousedEveryoneAlive || Arsonist.currentTarget != null));
            },
                () => {
                arsonistButton.Timer          = arsonistButton.MaxTimer;
                arsonistButton.isEffectActive = false;
                Arsonist.douseTarget          = null;
            },
                Arsonist.getDouseSprite(),
                new Vector3(-1.3f, 0f, 0f),
                __instance,
                KeyCode.Q,
                true,
                Arsonist.duration,
                () => {
                if (Arsonist.douseTarget != null)
                {
                    Arsonist.dousedPlayers.Add(Arsonist.douseTarget);
                }
                Arsonist.douseTarget = null;
                arsonistButton.Timer = Arsonist.dousedEveryoneAlive() ? 0 : arsonistButton.MaxTimer;

                foreach (PlayerControl p in Arsonist.dousedPlayers)
                {
                    if (Arsonist.dousedIcons.ContainsKey(p.PlayerId))
                    {
                        Arsonist.dousedIcons[p.PlayerId].setSemiTransparent(false);
                    }
                }
            }
                );

            // Set the default (or settings from the previous game) timers/durations when spawning the buttons
            setCustomButtonCooldowns();
        }
예제 #42
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                // 取得するRSSのURL
                string rss = "https://news.yahoo.co.jp/rss/topics/it.xml";

                //XElementのLoadメソッドにURLを渡して情報を取得する
                //XElementのリファレンス:https://docs.microsoft.com/ja-jp/dotnet/api/system.xml.linq.xelement?view=net-5.0
                XElement element = XElement.Load(rss);

                //"channel"エレメントを取得
                XElement channelElement = element.Element("channel");

                //RssInfoクラスのインスタンスを生成
                RssInfo rssInfo = new RssInfo();
                //ここではヘッダ情報を取得している
                //それぞれのメンバ変数へ取得したchannelエレメントの中から指定したエレメントの中身を取得
                rssInfo.Title       = channelElement.Element("title").Value;
                rssInfo.Description = channelElement.Element("description").Value;
                rssInfo.Link        = channelElement.Element("link").Value;
                rssInfo.PubDate     = channelElement.Element("pubDate").Value;

                //Itemエレメントを全て取得する
                //<Item>
                //  <item1>
                //</Item>
                //<Item>
                //  <item2>
                //</Item>
                //<item1><item2>が取得される
                IEnumerable <XElement> elementItems = channelElement.Elements("item");

                //ListをRssItemInfoクラス型で作成する
                List <RssItemInfo> rssItemInfos = new List <RssItemInfo>();
                //elementItemsの中身を一つずつ取得
                foreach (XElement elmItem in elementItems)
                {
                    RssItemInfo itemInfo = new RssItemInfo();
                    //それぞれのElementに含まれる値を取得してくる
                    itemInfo.Title       = elmItem.Element("title").Value;
                    itemInfo.Description = elmItem.Element("description").Value;
                    itemInfo.Link        = elmItem.Element("link").Value;
                    itemInfo.PubDate     = elmItem.Element("pubDate").Value;
                    rssItemInfos.Add(itemInfo);
                }

                //タイトルを取得して文字列型に格納
                string rsstext = "";
                foreach (var work in rssItemInfos)
                {
                    //タイトルを文字列結合してTextBlockへ反映
                    rsstext += work.Title + "\n";
                    //ボタンの拡張クラスを作って押すと別ウィンドウに情報を出すようにする
                    CustomButton bt = new CustomButton();
                    bt.Content  = work.Title;
                    bt.rii      = work;
                    bt.Height   = 100;
                    bt.FontSize = 36;
                    //クリックイベントのイベントハンドラを設定
                    bt.Click += new RoutedEventHandler(CustomButton_Click);
                    stack.Children.Add(bt);
                }
                //textblock.Text = rsstext;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }