public void Invoke()
        {
            var classPicker   = new ClassPicker(_snapshot.GetProject(GaugePackage.DTE));
            var selectedClass = string.Empty;

            classPicker.ShowModal();
            selectedClass = classPicker.SelectedClass;

            var containingLine = _trackingSpan.GetStartPoint(_snapshot).GetContainingLine();

            if (_project.GetStepImplementation(containingLine) != null || selectedClass == null)
            {
                return;
            }

            CodeClass    targetClass;
            CodeFunction implementationFunction;
            var          gotImplementation = _stepImplementationGenerator.TryGenerateMethodStub(selectedClass, containingLine,
                                                                                                out targetClass,
                                                                                                out implementationFunction);

            if (!gotImplementation)
            {
                return;
            }

            _project.RefreshImplementations();
            Project.NavigateToFunction(implementationFunction);
            _unimplementedStepTagger.MarkTagImplemented(_span);
            IsEnabled = false;
        }
Esempio n. 2
0
        void ReleaseDesignerOutlets()
        {
            if (ClassPicker != null)
            {
                ClassPicker.Dispose();
                ClassPicker = null;
            }

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

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

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

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

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

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

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

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

            if (TimeframePicker != null)
            {
                TimeframePicker.Dispose();
                TimeframePicker = null;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            UIImageView background = new UIImageView();

//assign our image file to the UIImageView
            background.Image = UIImage.FromBundle("new_home_bg1");

            //assign the UIImageView as the background view of the table
            this.TableView.BackgroundView = background;

            //set the textbox background to light gray
            this.TableView.BackgroundColor = UIColor.LightGray;

            //set the background of each table cell to clear
            foreach (var cell in this.TableView.VisibleCells)

            {
                cell.BackgroundColor = UIColor.Clear;
                cell.SelectionStyle  = UITableViewCellSelectionStyle.None;
            }

            var statusBarHeight = UIApplication.SharedApplication.StatusBarFrame.Height;

            MultiStepProcessHorizontalViewController parentViewController = this.ParentViewController as MultiStepProcessHorizontalViewController;
            var navigationController = parentViewController.ContainerViewController.NavigationController;
            var navBarHeight         = navigationController.NavigationBar.Bounds.Height;

            TableView.ContentInset = new UIEdgeInsets(statusBarHeight + navBarHeight, 0, 50, 0);

            ManufacturePicker.Alpha = 0f;
            DesigPickerView.Alpha   = 0f;

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                //ClassWidthConstraint.Constant = 150f;
                //ManufactureWidthConstraint.Constant = 150f;
                //DesigWidthConstraint.Constant = 150f;
            }

            ClassPicker.Model       = new ClassModel(this);
            TimeframePicker.Model   = new TimeframeModel();
            PurposePicker.Model     = new PurposeModel();
            SortOptionsPicker.Model = new SortOptionsModel();

            if (Settings.ClassificationId != 0)
            {
                int classIndex = Settings.ClassificationList.IndexOf(Settings.ClassificationList.FirstOrDefault(row => row.ClassificationId == Settings.ClassificationId));
                ClassPicker.Select(classIndex, 0, true);
                ClassPicker.Model.Selected(ClassPicker, classIndex, 0);
            }

            if (Settings.PurchaseTimeFrame != 0)
            {
                int classIndex = 0;
                if (Settings.PurchaseTimeFrame == 3)
                {
                    classIndex = 1;
                }
                if (Settings.PurchaseTimeFrame == 12)
                {
                    classIndex = 2;
                }
                TimeframePicker.Select(classIndex, 0, true);
                TimeframePicker.Model.Selected(TimeframePicker, classIndex, 0);
            }

            if (Settings.PurposeId != 0)
            {
                //Settings.LocationResponse.PurposeForFlying
                int purposeIndex = Settings.LocationResponse.PurposeForFlying.IndexOf(Settings.LocationResponse.PurposeForFlying.FirstOrDefault(row => row.FlyingPurposeId == Settings.PurposeId));
                PurposePicker.Select(purposeIndex, 0, true);
                PurposePicker.Model.Selected(PurposePicker, purposeIndex, 0);
            }

            HoursTextField.Text = Settings.Hours.ToString();

            if (Settings.SortOptions != string.Empty)
            {
                //SortOptionsList.Add("No Preference");
                //SortOptionsList.Add("Recently Updated");
                //SortOptionsList.Add("Price");
                //SortOptionsList.Add("Total Time");
                int sortIndex = 0;
                if (Settings.SortOptions == "No Preference")
                {
                    sortIndex = 0;
                }

                if (Settings.SortOptions == "Recently Updated")
                {
                    sortIndex = 1;
                }

                if (Settings.SortOptions == "Price")
                {
                    sortIndex = 2;
                }

                if (Settings.SortOptions == "Total Time")
                {
                    sortIndex = 3;
                }
                SortOptionsPicker.Select(sortIndex, 0, true);
                SortOptionsPicker.Model.Selected(SortOptionsPicker, sortIndex, 0);
            }

            //hide keyboard when touch anywhere
            HideKeyboardGesture = new UITapGestureRecognizer(() =>
            {
                View.EndEditing(true);
            });
        }