Ejemplo n.º 1
0
        //**************************************************************
        // Function:	displayDestination
        // Purpose:		displays an index and destination field
        //            
        // Input:		Releaselink link - contains the link details
        //              int displayField - the field position on the form
        // Output:		None
        //*************************************************************/
        internal void displayDestination(ReleaseLink link, int displayField)
        {
            this.updateReleaseLink = false;
            TextBox textBox = this.destinationFieldsArray[displayField];
            textBox.Text = link.DisplayDestinationName;
            textBox.Visible = true;

            // check if mandatory
            Label label = this.mandatoryFieldsArray[displayField];
            if (link.Mandatory)
            {
                label.Visible = true;
            }
            else
            {
                label.Visible = false;
            }

            ComboBox comboBox = this.indexFieldsArray[displayField];
            comboBox.SelectedIndex = -1;
            // get the index options
            ArrayList options = link.IndexOptions;
            comboBox.Items.Clear();
            comboBox.Items.AddRange(options.ToArray());

            comboBox.Tag = link;
            comboBox.Visible = true;

            String indexValue = link.IndexFieldName;
            if (indexValue != null && !indexValue.Equals("") && options != null && options.Count > 0)
            {
                // find the selectedIndex position in the combobox options
                comboBox.SelectedIndex = options.IndexOf(indexValue);
            }

            this.updateReleaseLink = true;
        }
Ejemplo n.º 2
0
        // add a releaselink and the index options based on field type
        private ReleaseLink addReleaseLink(String displayDestName, String destination, String type, bool mandatory)
        {
            ReleaseLink releaseLink = new ReleaseLink(displayDestName, destination, type);
            try
            {

                // get the options based on field type
                ArrayList options = new ArrayList();
                options.Add("");
                foreach (AscentRelease.IndexField index in this.indexFields)
                {

                    if (ReleaseUtils.equalsType(index.Type, type))
                    {
                        // add
                        options.Add(index.Name);
                    }
                }
                releaseLink.IndexOptions = options;

                if (mandatory)
                {
                    releaseLink.Mandatory = true;
                }

                this.releaseLinks.Add(releaseLink);

            }
            catch (Exception ex)
            {

                Log log = new Log();
                log.ErrorLog(".\\log\\", "frmAlfrescoSetUp method addReleaseLink " + ex.Message, ex.StackTrace);

            }
            return releaseLink;
        }
Ejemplo n.º 3
0
        //**************************************************************
        // Function:	removeReleaseLinks
        // Purpose:		removes the releaseLinks passed in
        //            
        // Input:		ReleaseLink[] linksToRemove - the ReleaseLinks to be removed
        //
        // Output:		none
        //*************************************************************/
        private void removeReleaseLinks(ReleaseLink[] linksToRemove)
        {
            foreach (ReleaseLink link in linksToRemove)
            {
                this.releaseLinks.Remove(link);
            }
            int removeCount = linksToRemove.Length;
            this.destinationFieldCount = this.destinationFieldCount - removeCount;
            if (this.destinationFieldCount < MAX_FILEDS)
            {
                this.numFieldsDisplayed = this.destinationFieldCount;
                // need to remove and hide the extra fields
                for (int i = this.numFieldsDisplayed; i < MAX_FILEDS; i++)
                {
                    this.removeFields(i);
                }
                this.vScrollBar1.Visible = false;
            }

            this.displayDestinations(0);
        }