Exemple #1
0
        public MainControl()
        {
            InitializeComponent();
            lvcSettings = ListViewColumnsSettings.LoadSettings();

            this.Enter += MainControl_Enter;
        }
        public EntityPropertiesControl(EntityMetadata emd, ListViewColumnsSettings lvcSettings, ConnectionDetail connectionDetail)
        {
            InitializeComponent();

            if (new Version(connectionDetail.OrganizationVersion) < new Version(7, 1))
            {
                // Hide Keys tab if under CRM 2015 Update 1
                tabControl1.TabPages.Remove(tabPage7);
            }

            this.emd = emd;
            this.connectionDetail = connectionDetail;
            this.lvcSettings      = (ListViewColumnsSettings)lvcSettings.Clone();

            ListViewColumnHelper.AddColumnsHeader(attributeListView, typeof(AttributeMetadataInfo), ListViewColumnsSettings.AttributeFirstColumns, this.lvcSettings.AttributeSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(OneToManyListView, typeof(OneToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, this.lvcSettings.OtmRelSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(manyToOneListView, typeof(OneToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, this.lvcSettings.OtmRelSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(manyToManyListView, typeof(ManyToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, this.lvcSettings.MtmRelSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(privilegeListView, typeof(SecurityPrivilegeInfo), ListViewColumnsSettings.PrivFirstColumns, this.lvcSettings.PrivSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(keyListView, typeof(KeyMetadataInfo), ListViewColumnsSettings.KeyFirstColumns, this.lvcSettings.KeySelectedAttributes, new string[] { });

            attributesSplitContainer.Panel2Collapsed = true;
            manyToManySplitContainer.Panel2Collapsed = true;
            manyToOneSplitContainer.Panel2Collapsed  = true;
            oneToManySplitContainer.Panel2Collapsed  = true;
            privilegeSplitContainer.Panel2Collapsed  = true;
            keySplitContainer.Panel2Collapsed        = true;

            RefreshContent(emd);
        }
        public void RefreshColumns(ListViewColumnsSettings lvcUpdatedSettings)
        {
            if (lvcSettings.AttributeSelectedAttributes != lvcUpdatedSettings.AttributeSelectedAttributes)
            {
                lvcSettings.AttributeSelectedAttributes = (string[])lvcUpdatedSettings.AttributeSelectedAttributes.Clone();
                attributeListView.Columns.Clear();
                ListViewColumnHelper.AddColumnsHeader(attributeListView, typeof(AttributeMetadataInfo), ListViewColumnsSettings.AttributeFirstColumns, lvcSettings.AttributeSelectedAttributes, new string[] { });
                LoadAttributes(emd.Attributes);
            }

            if (lvcSettings.OtmRelSelectedAttributes != lvcUpdatedSettings.OtmRelSelectedAttributes)
            {
                lvcSettings.OtmRelSelectedAttributes = (string[])lvcUpdatedSettings.OtmRelSelectedAttributes.Clone();
                OneToManyListView.Columns.Clear();
                manyToOneListView.Columns.Clear();
                ListViewColumnHelper.AddColumnsHeader(OneToManyListView, typeof(OneToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, lvcSettings.OtmRelSelectedAttributes, new string[] { });
                ListViewColumnHelper.AddColumnsHeader(manyToOneListView, typeof(OneToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, lvcSettings.OtmRelSelectedAttributes, new string[] { });
                LoadOneToManyRelationships(emd.OneToManyRelationships);
                LoadManyToOneRelationships(emd.ManyToOneRelationships);
            }

            if (lvcSettings.MtmRelSelectedAttributes != lvcUpdatedSettings.MtmRelSelectedAttributes)
            {
                lvcSettings.MtmRelSelectedAttributes = (string[])lvcUpdatedSettings.MtmRelSelectedAttributes.Clone();
                manyToManyListView.Columns.Clear();
                ListViewColumnHelper.AddColumnsHeader(manyToManyListView, typeof(ManyToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, lvcSettings.MtmRelSelectedAttributes, new string[] { });
                LoadManyToManyRelationships(emd.ManyToManyRelationships);
            }

            if (lvcSettings.PrivSelectedAttributes != lvcUpdatedSettings.PrivSelectedAttributes)
            {
                lvcSettings.PrivSelectedAttributes = (string[])lvcUpdatedSettings.PrivSelectedAttributes.Clone();
                privilegeListView.Columns.Clear();
                ListViewColumnHelper.AddColumnsHeader(privilegeListView, typeof(SecurityPrivilegeInfo), ListViewColumnsSettings.PrivFirstColumns, lvcSettings.PrivSelectedAttributes, new string[] { });
                LoadPrivileges(emd.Privileges);
            }

            if (lvcSettings.KeySelectedAttributes != lvcUpdatedSettings.KeySelectedAttributes)
            {
                lvcSettings.KeySelectedAttributes = (string[])lvcUpdatedSettings.KeySelectedAttributes.Clone();
                keyListView.Columns.Clear();
                ListViewColumnHelper.AddColumnsHeader(keyListView, typeof(KeyMetadataInfo), ListViewColumnsSettings.KeyFirstColumns, lvcSettings.KeySelectedAttributes, new string[] { });
                LoadKeys(emd.Keys);
            }

            lvcSettings = lvcUpdatedSettings;
        }
Exemple #4
0
        public MainControl()
        {
            InitializeComponent();
            lvcSettings = ListViewColumnsSettings.LoadSettings();

            if (initialLoading)
            {
                // Loads listview header column for entities
                ListViewColumnHelper.AddColumnsHeader(entityListView, typeof(EntityMetadataInfo),
                                                      ListViewColumnsSettings.EntityFirstColumns, lvcSettings.EntitySelectedAttributes,
                                                      ListViewColumnsSettings.EntityAttributesToIgnore);

                initialLoading = false;
            }

            this.Enter += MainControl_Enter;
        }
Exemple #5
0
        void epc_OnColumnSettingsUpdated(object sender, ColumnSettingsUpdatedEventArgs e)
        {
            lvcSettings = (ListViewColumnsSettings)e.Settings.Clone();
            lvcSettings.SaveSettings();

            foreach (TabPage page in mainTabControl.TabPages)
            {
                if (page.TabIndex == 0)
                {
                    continue;
                }
                var ctrl = ((EntityPropertiesControl)page.Controls[0]);
                if (ctrl.Name != e.Control.Name)
                {
                    ctrl.RefreshColumns(lvcSettings);
                }
            }
        }
        public EntityPropertiesControl(EntityMetadata emd, ListViewColumnsSettings lvcSettings)
        {
            InitializeComponent();

            this.emd         = emd;
            this.lvcSettings = (ListViewColumnsSettings)lvcSettings.Clone();

            ListViewColumnHelper.AddColumnsHeader(attributeListView, typeof(AttributeMetadataInfo), ListViewColumnsSettings.AttributeFirstColumns, this.lvcSettings.AttributeSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(OneToManyListView, typeof(OneToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, this.lvcSettings.OtmRelSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(manyToOneListView, typeof(OneToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, this.lvcSettings.OtmRelSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(manyToManyListView, typeof(ManyToManyRelationshipMetadataInfo), ListViewColumnsSettings.RelFirstColumns, this.lvcSettings.MtmRelSelectedAttributes, new string[] { });
            ListViewColumnHelper.AddColumnsHeader(privilegeListView, typeof(SecurityPrivilegeInfo), ListViewColumnsSettings.PrivFirstColumns, this.lvcSettings.PrivSelectedAttributes, new string[] { });

            attributesSplitContainer.Panel2Collapsed = true;
            manyToManySplitContainer.Panel2Collapsed = true;
            manyToOneSplitContainer.Panel2Collapsed  = true;
            oneToManySplitContainer.Panel2Collapsed  = true;
            privilegeSplitContainer.Panel2Collapsed  = true;

            RefreshContent(emd);
        }
 public MainControl()
 {
     InitializeComponent();
     lvcSettings = ListViewColumnsSettings.LoadSettings();
 }