コード例 #1
0
 /// <summary>Initializes a new instance of the <see cref="AllPropertiesDialog"/> class.
 /// Instantiates a user control for handling all properties.</summary>
 /// <param name="parentForm">A form in relation location of this form is set.</param>
 /// <param name="allPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains all properties.</param>
 /// <param name="shownPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains shown properties.</param>
 /// <param name="methodToLocalize">Delegate method to use for localization.</param>
 public AllPropertiesDialog(
     Form parentForm,
     ref PresentedPropertiesXml allPresentedPropertiesXmlInstance,
     ref PresentedPropertiesXml shownPresentedPropertiesXmlInstance,
     LocalisationDelegate methodToLocalize)
 {
     this.InitializeComponent();
     this.InitializeAllPropertiesDialog(parentForm, ref allPresentedPropertiesXmlInstance, ref shownPresentedPropertiesXmlInstance, methodToLocalize);
 }
コード例 #2
0
        /// <summary>Initializes a user control for handling all properties.</summary>
        /// <param name="newParentForm">A form in relation location of this form is set.</param>
        /// <param name="allPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains all properties.</param>
        /// <param name="shownPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains shown properties.</param>
        /// <param name="methodToLocalize">Delegate method to use for localization.</param>
        public void InitializeAllPropertiesDialog(
            Form newParentForm,
            ref PresentedPropertiesXml allPresentedPropertiesXmlInstance,
            ref PresentedPropertiesXml shownPresentedPropertiesXmlInstance,
            LocalisationDelegate methodToLocalize)
        {
            // Add quick search
            this.quickSearchUserCntrl = new QuickSearchForDGW();
            this.quickSearchUserCntrl.SetReferenceProperties(ref this.AllPropertiesDGW);
            var quickSearchUserCntrlControlHost = new ToolStripControlHost(this.quickSearchUserCntrl)
            {
                Alignment = ToolStripItemAlignment.Right
            };

            this.quickSearchUserCntrl.Width = 140;
            this.AllPropertiesToolStrip.SuspendLayout();
            this.AllPropertiesToolStrip.Items.Add(quickSearchUserCntrlControlHost);
            this.AllPropertiesToolStrip.ResumeLayout();

            if (methodToLocalize != null)
            {
                methodToLocalize(this);
                methodToLocalize(this.contextMenuStrip1);
                this.validationErrorLabel.Text = "albl_Change_default_property_name";
                methodToLocalize(this.validationErrorLabel);
            }

            this.AllPropertiesDGW.AutoGenerateColumns = false;

            this.AllPropertiesDGW.SelectionChanged += this.ShownPropertiesDGWSelectionChanged;
            this.AllPropertiesDGW.KeyDown          += this.AllPropertiesDGWKeyDown;
            this.AllPropertiesDGW.Sorted           += this.AllPropertiesDGWSorted;

            PresentedPropertiesManage.ChangeHiddenValuesByOtherFile(
                ref allPresentedPropertiesXmlInstance, ref shownPresentedPropertiesXmlInstance);
            allPresentedPropertiesXmlInstance.ForceReadFile();
            this.newShownPresentedPropertiesXmlInstance = shownPresentedPropertiesXmlInstance;
            this.allShownPresentedPropertiesXmlInstance = allPresentedPropertiesXmlInstance;
            this.AllPropertiesDGW.DataSource            = this.allShownPresentedPropertiesXmlInstance.PropertiesList;

            this.AllPropertiesDGW.ReadOnly              = false;
            this.AllPropertiesDGW.AllowUserToAddRows    = true;
            this.AllPropertiesDGW.AllowUserToDeleteRows = true;
            this.AllPropertiesDGW.SelectionMode         = DataGridViewSelectionMode.CellSelect;
            this.AllPropertiesDGW.Columns[0].ReadOnly   = false;
        }
コード例 #3
0
        /// <summary>Initializes a new instance of the <see cref="PropertiesForm"/> class.
        /// Initializes a form to select showable properties.</summary>
        /// <param name="parentForm">A form in relation location of this form is set.</param>
        /// <param name="allPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains all properties.</param>
        /// <param name="shownPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains shown properties.</param>
        /// <param name="localizationMethod">Delegate method to use for localization.</param>
        /// <param name="showShownProperties">If true, shown properties are shown in separate panel as well as move properties buttons.</param>
        public PropertiesForm(
            Form parentForm,
            ref PresentedPropertiesXml allPresentedPropertiesXmlInstance,
            ref PresentedPropertiesXml shownPresentedPropertiesXmlInstance,
            LocalisationDelegate localizationMethod,
            bool showShownProperties)
        {
            this.InitializeComponent();

            this.StartPosition = FormStartPosition.Manual;

            if (parentForm != null)
            {
                this.TopMost  = parentForm.TopMost;
                this.Location = this.GetLocation(parentForm.Location);
            }
            else
            {
                this.Location = this.GetLocation(Screen.PrimaryScreen.WorkingArea.Location);
            }

            this.splitContainer1.Panel1Collapsed = !showShownProperties;
            this.allPropertiesDialog1.ShowIncludedColumn(!showShownProperties);

            this.ownAllPresentedPropertiesXmlInstance   = allPresentedPropertiesXmlInstance;
            this.ownShownPresentedPropertiesXmlInstance = shownPresentedPropertiesXmlInstance;

            this.allPropertiesDialog1.InitializeAllPropertiesDialog(
                parentForm,
                ref allPresentedPropertiesXmlInstance,
                ref shownPresentedPropertiesXmlInstance,
                localizationMethod);
            this.shownPropertiesDialog1.InitializeShownPropertiesDialog(
                parentForm,
                ref allPresentedPropertiesXmlInstance,
                ref shownPresentedPropertiesXmlInstance,
                localizationMethod);

            if (localizationMethod != null)
            {
                localizationMethod(this);
            }

            this.FormClosing += this.PropertiesFormFormClosing;
        }
        /// <summary>Initialises a user control for handling all properties.</summary>
        /// <param name="newParentForm">A form in relation location of this form is set.</param>
        /// <param name="allPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains all properties.</param>
        /// <param name="shownPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains shown properties.</param>
        /// <param name="methodToLocalize">Delegate method to use for localization.</param>
        public void InitializeShownPropertiesDialog(
            Form newParentForm,
            ref PresentedPropertiesXml allPresentedPropertiesXmlInstance,
            ref PresentedPropertiesXml shownPresentedPropertiesXmlInstance,
            LocalisationDelegate methodToLocalize)
        {
            if (methodToLocalize != null)
            {
                methodToLocalize(this);
            }

            this.ShownPropertiesDGW.AutoGenerateColumns = false;
            this.ShownPropertiesDGW.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;

            this.ShownPropertiesDGW.CellMouseClick   += this.ShownPropertiesDGWCellMouseClick;
            this.ShownPropertiesDGW.SelectionChanged += this.AllPropertiesDGWSelectionChanged;

            this.newShownPresentedPropertiesXmlInstance = shownPresentedPropertiesXmlInstance;
            this.allShownPresentedPropertiesXmlInstance = allPresentedPropertiesXmlInstance;
            this.ShownPropertiesDGW.DataSource          = this.newShownPresentedPropertiesXmlInstance.PropertiesList;

            // this.FormClosing += new FormClosingEventHandler(ShownPropertiesDialog_FormClosing);
        }
        /// <summary>Initializes a new instance of the <see cref="ShownPropertiesDialog"/> class.
        /// Instantiates a user control for handling all properties.</summary>
        /// <param name="parentForm">A form in relation location of this form is set.</param>
        /// <param name="allPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains all properties.</param>
        /// <param name="shownPresentedPropertiesXmlInstance">PresentedPropertiesXml instance which contains shown properties.</param>
        /// <param name="methodToLocalize">Delegate method to use for localization.</param>
        public ShownPropertiesDialog(
            Form parentForm,
            ref PresentedPropertiesXml allPresentedPropertiesXmlInstance,
            ref PresentedPropertiesXml shownPresentedPropertiesXmlInstance,
            LocalisationDelegate methodToLocalize)
        {
            this.InitializeComponent();

            if (methodToLocalize != null)
            {
                methodToLocalize(this);
            }

            this.ShownPropertiesDGW.AutoGenerateColumns = false;
            this.ShownPropertiesDGW.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;

            this.ShownPropertiesDGW.CellMouseClick   += this.ShownPropertiesDGWCellMouseClick;
            this.ShownPropertiesDGW.SelectionChanged += this.AllPropertiesDGWSelectionChanged;

            this.newShownPresentedPropertiesXmlInstance = shownPresentedPropertiesXmlInstance;
            this.allShownPresentedPropertiesXmlInstance = allPresentedPropertiesXmlInstance;
            this.ShownPropertiesDGW.DataSource          = this.newShownPresentedPropertiesXmlInstance.PropertiesList;
        }