Exemplo n.º 1
0
        /// <summary>
        /// Initiate and Bind the UCValue Expression Control, manage the Browse and VE buttons and configure the Extra functionality Handler.
        /// </summary>
        /// <param name="AIV">ActInputValue related to the Param configured under the Fields of the Action</param>
        /// <param name="isVENeeded">Determine whether the VE Button will be appeared or not</param>
        /// <param name="isBrowseNeeded">Determine whether the Browse Button will be appeared or not</param>
        /// <param name="browserType">Can be eBrowserType.File or eBrowserType.Folder</param>
        /// <param name="fileType">Type of the files for filter the Browser Dialog</param>
        /// <param name="extraBrowserSelectionHandler">To be used whenever extra functionality is needed after clicking OK or cancel at the Dialog window</param>
        public void Init(Context context, ActInputValue AIV, bool isVENeeded = true, bool isBrowseNeeded = false, eBrowserType browserType = eBrowserType.File, string fileType = "*", RoutedEventHandler extraBrowserSelectionHandler = null, string initialDirectory = null)
        {
            // If the VE is on stand alone form:
            this.obj      = AIV;
            this.AttrName = nameof(ActInputValue.Value);
            mContext      = context;
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ValueTextBox, TextBox.TextProperty, obj, AttrName);

            if (isBrowseNeeded)
            {
                mBrowserType            = browserType;
                LastCol.Width           = new GridLength(55);
                BrowseButton.Visibility = Visibility.Visible;
                this.fileType           = fileType;
                this.initialDirectory   = initialDirectory;

                BrowseButton.AddHandler(Button.ClickEvent, new RoutedEventHandler(BrowseButton_Click));

                if (extraBrowserSelectionHandler != null)
                {
                    BrowseButton.Click += extraBrowserSelectionHandler;
                }
            }
            if (!isVENeeded)
            {
                MidCol.Width = new GridLength(0);
                OpenExpressionEditorButton.Visibility = Visibility.Collapsed;
            }
        }
        public void Init(Context context, object obj, string AttrName, bool isVENeeded = true, bool isBrowseNeeded = false, eBrowserType browserType = eBrowserType.File, string fileType = "*", RoutedEventHandler extraBrowserSelectionHandler = null)
        {
            this.obj      = obj;
            this.AttrName = AttrName;
            mContext      = context;
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ValueTextBox, TextBox.TextProperty, obj, AttrName);

            if (isBrowseNeeded)
            {
                mBrowserType            = browserType;
                LastCol.Width           = new GridLength(55);
                BrowseButton.Visibility = Visibility.Visible;
                this.fileType           = fileType;

                BrowseButton.AddHandler(Button.ClickEvent, new RoutedEventHandler(BrowseButton_Click));

                if (extraBrowserSelectionHandler != null)
                {
                    BrowseButton.Click += extraBrowserSelectionHandler;
                }
            }

            if (!isVENeeded)
            {
                MidCol.Width = new GridLength(0);
                OpenExpressionEditorButton.Visibility = Visibility.Collapsed;
            }
        }
 //------<automated unit test for browsing>------------------------------
 private bool Test5()
 {
     try
     {
         if (endPoint_.port == 8082)
         {
             Console.WriteLine("**********Display collections of filenames based on queries defining categories********************");
             tbQueryContent.Text     = "NoSqlDb";
             ConditionComboBox.Text  = "Category";
             showFiles.SelectedIndex = 0;
         }
         else
         {
             Console.WriteLine("**********Display collections of filenames based on queries defining names********************");
             tbQueryContent.Text     = "Comm";
             ConditionComboBox.Text  = "FileName";
             showFiles.SelectedIndex = 0;
         }
         Console.WriteLine("  See the file name and metadata in the browse tab");
         Console.WriteLine("  You can also query by version and dependecies selecting items in the ComboBox");
         BrowseButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(false);
     }
     return(true);
 }
        protected void Grid_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Tab:
                e.SuppressKeyPress = true;

                if (e.Modifiers == Keys.None)
                {
                    BackButton.Focus();
                }
                else if (e.Modifiers == Keys.Shift)
                {
                    CancelCloseButton.Focus();
                }

                break;

            case Keys.Enter:
                e.SuppressKeyPress = true;
                BrowseButton.PerformClick();
                break;

            case Keys.Back:
                e.SuppressKeyPress = true;
                BackButton.PerformClick();
                break;
            }
        }
Exemplo n.º 5
0
 private void NameTextBoxLeave(object sender, EventArgs e)
 {
     if (NameTextBox.Text.Length > 0)
     {
         GroupFileDialog.FileName = NameTextBox.Text + ".xml";
         BrowseButton.Focus();
     }
 }
Exemplo n.º 6
0
        private void Box_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                Apply();
                e.SuppressKeyPress = true;
                break;

            case Keys.Escape:
                Varor.Select();
                if (Varor.Items.Count > 0 && Varor.SelectedItems.Count <= 0)
                {
                    Varor.Items[0].Selected = true;
                }
                e.SuppressKeyPress = true;
                break;

            case Keys.Up:
            case Keys.Down:
                for (int i = 0; i < textBoxes.Length; i++)
                {
                    if (textBoxes[i].Focused)
                    {
                        if (e.KeyCode == Keys.Up)
                        {
                            if (i != 0)
                            {
                                textBoxes[i - 1].Focus();
                            }
                            else
                            {
                                ApplyButton.Focus();
                            }
                        }
                        else
                        {
                            if (i != 2)
                            {
                                textBoxes[i + 1].Focus();
                            }
                            else
                            {
                                BrowseButton.Focus();
                            }
                        }
                        break;
                    }
                }
                break;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

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

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

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

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

            if (OpenFileButton != null)
            {
                OpenFileButton.Dispose();
                OpenFileButton = null;
            }
        }
Exemplo n.º 8
0
 public BrowseButtonEventArgs(BrowseButton button)
 {
     Button = button;
 }
Exemplo n.º 9
0
 public BrowseButtonEventArgs(BrowseButton button)
 {
     Button = button;
 }
Exemplo n.º 10
0
 //----< test for Browse >---------------------------------
 void testBrowse()
 {
     Descriptiontxtbox.Text = "Test File";
     BrowseButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent, BrowseButton));
 }
 protected void Grid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     BrowseButton.PerformClick();
 }