コード例 #1
0
        private void nextButton_Click(object sender, EventArgs e)
        {
            _pageIndex = PageSelection.SecondPage;
            if (_webApiSharedPortable)
            {
                EntitiesTypeSelection selection = GetEntitiesTypeSelection(clientServiceListView);
                switch (selection)
                {
                case EntitiesTypeSelection.ClientServiceEntities:
                    if (!portableDotNetListView.Items.Contains(_portableListViewItemItem))
                    {
                        portableDotNetListView.Items.Insert(1, _portableListViewItemItem);
                        portableDotNetListView.Items[1].EnsureVisible();
                        portableDotNetListView.Items[0].Focused  = true;
                        portableDotNetListView.Items[0].Selected = true;
                    }
                    break;

                case EntitiesTypeSelection.SharedEntities:
                    if (portableDotNetListView.Items.Contains(_portableListViewItemItem))
                    {
                        portableDotNetListView.Items.Remove(_portableListViewItemItem);
                        portableDotNetListView.Items[0].Focused  = true;
                        portableDotNetListView.Items[0].Selected = true;
                    }
                    break;
                }
            }
            SetPageState();
            portableDotNetListView.Focus();
            portableDotNetListView_SelectedIndexChanged(this, EventArgs.Empty);
        }
コード例 #2
0
        private void SetPageState()
        {
            if (_pageIndex == PageSelection.FirstPage)
            {
                if (_multiproject)
                {
                    clientServiceListView.Visible = true;
                }
                else
                {
                    serviceClientSharedListView.Visible = true;
                }
                portableDotNetListView.Visible = false;

                previousButton.Enabled = false;
                if (_multiproject)
                {
                    nextButton.Enabled   = true;
                    finishButton.Enabled = false;
                    AcceptButton         = nextButton;
                }
                else
                {
                    ListView entitiesTypeListView;
                    if (_multiproject)
                    {
                        entitiesTypeListView = clientServiceListView;
                    }
                    else
                    {
                        entitiesTypeListView = serviceClientSharedListView;
                    }
                    EntitiesTypeSelection selection = GetEntitiesTypeSelection(entitiesTypeListView);
                    if (selection == EntitiesTypeSelection.ServiceEntities)
                    {
                        nextButton.Enabled   = false;
                        finishButton.Enabled = true;
                        AcceptButton         = finishButton;
                    }
                    else
                    {
                        nextButton.Enabled   = true;
                        finishButton.Enabled = false;
                        AcceptButton         = nextButton;
                    }
                }
            }
            else
            {
                clientServiceListView.Visible       = false;
                serviceClientSharedListView.Visible = false;
                portableDotNetListView.Visible      = true;

                previousButton.Enabled = true;
                nextButton.Enabled     = false;
                finishButton.Enabled   = true;
                AcceptButton           = finishButton;
            }
        }
コード例 #3
0
        private void clientServiceListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            EntitiesTypeSelection selection = GetEntitiesTypeSelection(clientServiceListView);

            switch (selection)
            {
            case EntitiesTypeSelection.ClientServiceEntities:
                descriptionLabel.Text = Constants.Descriptions.ClientServiceEntities;
                break;

            case EntitiesTypeSelection.SharedEntities:
                descriptionLabel.Text = Constants.Descriptions.SharedEntities;
                break;
            }
            SetPageState();
        }
コード例 #4
0
        private EntitiesSelection ToSelectionType(EntitiesTypeSelection typeSelection)
        {
            switch (typeSelection)
            {
            case EntitiesTypeSelection.ClientServiceEntities:
                return(EntitiesSelection.ClientService);

            case EntitiesTypeSelection.ServiceEntities:
                return(EntitiesSelection.Service);

            case EntitiesTypeSelection.ClientEntities:
                return(EntitiesSelection.Client);

            case EntitiesTypeSelection.SharedEntities:
                return(EntitiesSelection.Shared);

            default:
                return(EntitiesSelection.None);
            }
        }
コード例 #5
0
 private EntitiesSelection ToSelectionType(EntitiesTypeSelection typeSelection)
 {
     switch (typeSelection)
     {
         case EntitiesTypeSelection.ClientServiceEntities:
             return EntitiesSelection.ClientService;
         case EntitiesTypeSelection.ServiceEntities:
             return EntitiesSelection.Service;
         case EntitiesTypeSelection.ClientEntities:
             return EntitiesSelection.Client;
         case EntitiesTypeSelection.SharedEntities:
             return EntitiesSelection.Shared;
         default:
             return EntitiesSelection.None;
     }
 }