Пример #1
0
 public FormControl(FormViewer viewer, FormField field)
 {
     _field        = field;
     _viewer       = viewer;
     IsVisible     = field.IsVisible;
     OriginalValue = _field.Value;
 }
Пример #2
0
        static public void EndPresentation()
        {
            if (formViewer.InvokeRequired)
            {
                formViewer.Invoke(new Action(() => formViewer.Close()));
            }
            else
            {
                formViewer.Close();
            }
            formViewer = null;

            if (Connection.CurrentGroup.settings.Download)
            {
                FormAlert formAlert1 = new FormAlert("Presentation finished", "Would you like to download slides?");
                if (formAlert1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    FormDownloadSlide formProgress = new FormDownloadSlide();
                    formProgress.ShowDialog();
                }
            }
            else
            {
                FormAlert formAlert2 = new FormAlert("Presentation finished", "Thank you for using ShareP!", true);
                formAlert2.ShowDialog();
            }
            if (Connection.FormMenu.InvokeRequired)
            {
                Connection.FormMenu.Invoke(new Action(() => Connection.FormMenu.OnViewerClosed()));
            }
            else
            {
                Connection.FormMenu.OnViewerClosed();
            }
        }
Пример #3
0
 static public void LoadViewer()
 {
     Notification.HideAll();
     formViewer = new FormViewer();
     formViewer.Show();
     formViewer.BringToFront();
     formViewer.LoadSlide(1);
 }
Пример #4
0
 static public void OnAppClosing()
 {
     if (IsWorking)
     {
         formViewer.Close();
     }
     formViewer = null;
 }
 /// <summary>
 /// ќткрыть внутри объект
 /// </summary>
 private void EditInsideObject()
 {
     if (isSelectedLV(listView_Local))
     {
         using (FormViewer frm_v = new FormViewer(listView_Local.SelectedItems[0].Tag.ToString()))
         {
             frm_v.ShowDialog();
         }
     }
 }
Пример #6
0
    protected override void Show(IDialogVisualizerService svc, IVisualizerObjectProvider Provider)
    {
        string inputString = (string)Provider.GetObject();

        using (FormViewer form = new FormViewer())
        {
            byte[] bytes = Convert.FromBase64String(inputString);
            form.DecodedText = System.Text.Encoding.UTF8.GetString(bytes);
            svc.ShowDialog(form);
        }
    }
Пример #7
0
        public ChildListRow(FormViewer formViewer, FormField field) : base(formViewer, field)
        {
            HorizontalOptions = new LayoutOptions(LayoutAlignment.Fill, true);

            var titleBar = new Grid()
            {
                BackgroundColor   = AppStyle.MenuBarBackground.ToXamFormsColor(),
                HeightRequest     = 48,
                HorizontalOptions = new LayoutOptions(LayoutAlignment.Fill, true)
            };

            titleBar.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Star
            });
            titleBar.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });

            _label = new Label()
            {
                FontSize        = 20,
                Margin          = new Thickness(10, 0, 0, 0),
                VerticalOptions = new LayoutOptions(LayoutAlignment.Center, false),
                TextColor       = AppStyle.MenuBarForeground.ToXamFormsColor(),
                Text            = field.Label
            };

            _addImage = new IconButton()
            {
                Margin          = new Thickness(0, 0, 20, 0),
                VerticalOptions = new LayoutOptions(LayoutAlignment.Center, false),
                IconKey         = "fa-plus",
                WidthRequest    = 48,
                HeightRequest   = 48,
                FontSize        = 22
            };
            _addImage.Clicked += _addImage_Clicked;
            _addImage.SetValue(Grid.ColumnProperty, 1);

            _childItemList = new StackLayout();

            titleBar.Children.Add(_label);
            titleBar.Children.Add(_addImage);

            Children.Add(titleBar);
            Children.Add(_childItemList);
        }
Пример #8
0
        public TextAreaRow(FormViewer formViewer, FormField field) : base(formViewer, field)
        {
            _header = new FormFieldHeader(field.Label);

            _editor = new Editor()
            {
                Text          = field.Value,
                HeightRequest = 120
            };
            _editor.TextChanged += _editor_TextChanged;

            Children.Add(_header);
            Children.Add(_editor);
            Margin = RowMargin;
        }
Пример #9
0
        public TextEditRow(FormViewer formViewer, FormField field) : base(formViewer, field)
        {
            _header = new FormFieldHeader(field.Label);

            _editor = new FormEntry()
            {
                Text      = field.Value,
                IsEnabled = field.IsUserEditable,
            };

            if (Device.RuntimePlatform == Device.Android)
            {
                _editor.HeightRequest = 40;
            }


            _editor.IsPassword = field.FieldType == FieldTypes.Password.ToString();

            _editor.TextChanged += _editor_TextChanged;

            FieldTypes fieldType;

            if (Enum.TryParse <FieldTypes>(field.FieldType, out fieldType))
            {
                switch (FieldType)
                {
                case FieldTypes.Key:
                    _editor.Keyboard = Keyboard.Plain;
                    break;

                case FieldTypes.Decimal:
                case FieldTypes.Integer:
                    _editor.Keyboard = Keyboard.Numeric;
                    _editor.HorizontalTextAlignment = TextAlignment.End;
                    break;
                }

                _validationMessage = new FormFieldValidationMessage(field.RequiredMessage);

                Children.Add(_header);
                Children.Add(_editor);
                Children.Add(_validationMessage);
                Margin = RowMargin;
            }
        }
Пример #10
0
        public CheckBoxRow(FormViewer formViewer, FormField field) : base(formViewer, field)
        {
            _header = new FormFieldHeader(field.Label);

            _switch          = new Switch();
            _switch.Toggled += _switch_Toggled;

            bool _isToggled = false;

            if (bool.TryParse(field.Value, out _isToggled))
            {
                _switch.IsToggled = _isToggled;
            }

            Children.Add(_header);
            Children.Add(_switch);
            Margin = RowMargin;
        }
Пример #11
0
        public SelectRow(FormViewer formViewer, FormField field) : base(formViewer, field)
        {
            _header            = new FormFieldHeader(field.Label);
            _validationMessage = new FormFieldValidationMessage(field.RequiredMessage);

            _picker = new Picker();

            if (field.Options != null)
            {
                var options = field.Options.Select(opt => opt.Label).ToList();
                if (!String.IsNullOrEmpty(field.Watermark))
                {
                    options.Insert(0, field.Watermark);
                }
                else
                {
                    options.Insert(0, "-select-");
                }

                _picker.IsEnabled     = field.IsEnabled;
                _picker.ItemsSource   = options;
                _picker.SelectedIndex = 0;
            }

            var selectedItem = field.Options.Where(opt => opt.Key == field.Value).FirstOrDefault();

            if (selectedItem != null)
            {
                var index = field.Options.IndexOf(selectedItem);
                _picker.SelectedIndex = index + 1;
            }
            else
            {
                _picker.SelectedIndex = 0;
            }

            Children.Add(_header);
            Children.Add(_picker);
            Children.Add(_validationMessage);

            _picker.SelectedIndexChanged += _picker_SelectedIndexChanged;
            Margin = RowMargin;
        }
Пример #12
0
        public EntityHeaderPicker(FormViewer formViewer, FormField field) : base(formViewer, field)
        {
            _header = new FormFieldHeader(field.Label);

            _linkLabel = new Label()
            {
                TextColor = Color.Blue
            };
            Children.Add(_header);

            Children.Add(_header);
            Children.Add(_linkLabel);

            var tapRecognizer = new TapGestureRecognizer();

            tapRecognizer.Tapped += TapRecognizer_Tapped;
            _linkLabel.GestureRecognizers.Add(tapRecognizer);

            Margin = RowMargin;

            Refresh();
        }
Пример #13
0
        private void buttonItem5_Click_1(object sender, EventArgs e)
        {
            FormViewer s = new FormViewer();

            s.ShowDialog();
        }
Пример #14
0
        //SPY
        private void spyToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            FormViewer s = new FormViewer();

            s.ShowDialog();
        }
Пример #15
0
 public ActionResult Index()
 {
     FormViewer.ExposeControllerContext(ControllerContext);
     return(View());
 }