コード例 #1
0
        private static void InitializeSearch(object view, UITableViewSource source)
        {
            var searchbarAttribute = view.GetType().GetCustomAttribute <SearchbarAttribute>();
            var searchbar          = source as ISearchBar;

            if (searchbarAttribute != null && searchbar != null)
            {
                searchbar.SearchPlaceholder = searchbarAttribute.Placeholder;
                searchbar.IncrementalSearch = searchbarAttribute.IncrementalSearch;
                searchbar.EnableSearch      = searchbarAttribute.ShowImmediately;
                searchbar.IsSearchbarHidden = !searchbarAttribute.ShowImmediately;


                var methods = GetMethods(view);
                foreach (var method in methods)
                {
                    var attribute = method.GetCustomAttribute <SearchbarAttribute>();
                    if (attribute != null)
                    {
                        searchbar.SearchPlaceholder = attribute.Placeholder;
                        searchbar.IncrementalSearch = attribute.IncrementalSearch;
                        searchbar.EnableSearch      = attribute.ShowImmediately;
                        searchbar.IsSearchbarHidden = !attribute.ShowImmediately;

                        searchbar.SearchCommand = new SearchCommand(view, method as MethodInfo);
                        break;
                    }
                    ;
                }
            }
        }
コード例 #2
0
        public UITableViewSource Parse(DialogViewController controller, object view, MemberInfo member)
        {
            UITableViewSource source = null;

            if (view != null)
            {
                view = GetActualView(view);
                controller.RootView = view;

                controller.ToolbarButtons = CheckForToolbarItems(view);
                controller.NavbarButtons  = CheckForNavbarItems(view);

                if (member != null)
                {
                    using (var memberData = new MemberData(view, member))
                    {
                        source = ParseList(controller, memberData, null);
                    }
                }

                if (source == null)
                {
                    source = ParseView(controller, view);
                }

                InitializeSearch(view, source);
            }

            return(source);
        }
コード例 #3
0
            private EventHandler GetTextFieldEditingChangedHandler()
            {
                if (_textFieldEditingChangedHandler == null)
                {
                    _textFieldEditingChangedHandler = delegate
                    {
                        _selectedIndex = -1;
                        _autoCompleteTableView.Hidden = false;
                        _matchedElements = _elements.Where(elem =>
                                                           elem.ToLowerInvariant().Contains(_textField.Text.ToLowerInvariant())).ToList();

                        if (string.IsNullOrWhiteSpace(_textField.Text))
                        {
                            _autoCompleteTableView.Hidden = true;
                        }
                        else
                        {
                            _autoCompleteTableView.Hidden |= _matchedElements.Count == 0;
                        }

                        _autoCompleteTableViewSource =
                            new AutoCompleteTableViewSource(_matchedElements, SelectedElement);
                        _autoCompleteTableView.Source = _autoCompleteTableViewSource;
                        _autoCompleteTableView.ReloadData();
                    }
                }
                ;
                return(_textFieldEditingChangedHandler);
            }
        }
コード例 #4
0
        public void InitializeRunsControllerFields(UITableViewSource sessionSource, Profiles profileRow)
        {
            //pass in profile
            CurrentProfile = profileRow;

            //create source for ran images row
            RanImagesSource = new TableSourceRanImages();

            //images table view controller set up
            imageTableViewController             = new ImagesTableViewController(RanImagesSource);
            imageTableViewController.View.Hidden = true;
            imagesTableviewNavController         = new UINavigationController(imageTableViewController);
            imagesTableviewNavController.View.BackgroundColor = AppColors.LIGHT_TEAL;
            imagesTableviewNavController.NavigationBar.TitleTextAttributes = new UIStringAttributes()
            {
                ForegroundColor = UIColor.White
            };
            imagesTableviewNavController.NavigationBar.BarTintColor = AppColors.DARK_GRAY;

            //source assignments
            SessionSource = (TableSourceSessions)sessionSource;
            ranSessions   = new RunsTableViewController(CurrentProfile);

            //add delegate to the session source
            SessionSource.SessionRowToController += GetRowClickedFromSessionSource;
            SessionSource.HideTable += ShowImagesTableHandler;

            navigationController = new UINavigationController(ranSessions);
            navigationController.NavigationBar.BarTintColor = AppColors.DARK_GRAY;
            //navigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { Font = UIFont.FromName("Arial", 12f)};
            runsSplitViewController             = new RunsSplitViewController(ranSessions, navigationController, imagesTableviewNavController);
            runsSplitViewController.View.Hidden = true;
            navigationController.NavigationItem.Title.StringSize(UIFont.FromName("Arial", 20f));
        }
コード例 #5
0
        //UITableViewSource originalSource;

        protected override void OnElementChanged(ElementChangedEventArgs <ListView> e)
        {
            base.OnElementChanged(e);

            UITableViewSource originalSource = (UIKit.UITableViewSource)Control.Source;

            Control.Source = new MyLVSource(originalSource, e.NewElement);
        }
コード例 #6
0
        public void setFieldsAndInitialize(UITableViewSource sessionSource, Profiles profileRow, MainTabBarController tab)
        {
            SessionSource = (TableSourceSessions)sessionSource;
            tabBar        = tab;
            InitializeRunsControllerFields(SessionSource, profileRow);
            InitializeMasterControllerFields();

            ViewControllers = new UIViewController[] { masterNavigationController, runsSplitViewController };
        }
コード例 #7
0
 public WrapperSource(UITableViewSource original, UITableView tableView, Int32 minRowHeight = -1)
 {
     this.original      = original;
     this._MinRowHeight = minRowHeight;
     if (this._TableView == null)
     {
         this._TableView = new WeakReference(tableView);
     }
 }
コード例 #8
0
            public AutoCompleteTextField(UIViewController viewController, UITextField textView, List <string> elements)
            {
                try
                {
                    this.viewController = viewController;
                    this.textField      = textView;
                    this.selectedIndex  = -1;
                    this.elements       = elements;
                    //this.matchedElements = this.elements.Where(e => e.ToLower().Contains(this.textField.Text.ToLower())).ToList();
                    this.matchedElements = elements;
                    int Count = matchedElements.Count;



                    this.autoCompleteTableView = new UITableView(new CoreGraphics.CGRect(this.textField.Frame.X, this.textField.Frame.Y + this.textField.Frame.Height + 10, this.textField.Frame.Width, Count * 35));

                    // branch locator text field layout
                    if (this.textField.Tag == 1032)
                    {
                        this.autoCompleteTableView = new UITableView(new CoreGraphics.CGRect(this.textField.Frame.X, this.textField.Frame.Y + this.textField.Frame.Height + 80, this.textField.Frame.Width, Count * 35));
                    }


                    this.autoCompleteTableViewSource  = new AutoCompleteTableViewSource(this.elements, this.SelectedElement, this.textField);
                    this.autoCompleteTableView.Source = this.autoCompleteTableViewSource;

                    this.autoCompleteTableView.ReloadData();
                    this.autoCompleteTableView.ScrollEnabled = true;
                    this.autoCompleteTableView.Hidden        = false;

                    this.autoCompleteTableView.BackgroundColor = UIColor.White;
                    //this.autoCompleteTableView.Alpha = 0.8f;

                    // branch locator text field layout
                    //if (this.textField.Tag == 1032)
                    //{
                    //	this.autoCompleteTableView.BackgroundColor = UIColor.Black;
                    //	this.autoCompleteTableView.Alpha = 0.8f;

                    //}


                    this.viewController.View.AddSubview(this.autoCompleteTableView);
                    this.viewController.View.BringSubviewToFront(this.autoCompleteTableView);
                    textField.EditingChanged -= this.GetTextFieldEditingChangedHandler();
                    textField.EditingChanged += this.GetTextFieldEditingChangedHandler();
                    this.autoCompleteTableView.AllowsSelection = true;
                }
                catch (Exception ex)
                {
                    string str = ex.Message;
                    Console.WriteLine("== AutoCompleteTextField Exception=== {0}", str);
                }
            }
コード例 #9
0
        public RunsTableViewController(Profiles profileRow)
        {
            table = new UITableView();
            table.BackgroundColor = AppColors.LIGHT_TEAL;
            List <Session> sessionsByID = new DatabaseContext <Session>().GetQuery("SELECT * FROM Session WHERE ParentProfileID = ?", profileRow.ID.ToString());

            source       = new TableSourceSessions(sessionsByID);
            Title        = "";
            View         = table;
            table.Source = source;
        }
        //========================================================================================================================================
        //  PUBLIC OVERRIDES
        //========================================================================================================================================
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            _tableView = new UITableView();
            _source    = new TableViewSource();

            this._tableView.RowHeight          = UITableView.AutomaticDimension;
            this._tableView.EstimatedRowHeight = 176;
            _tableView.Source = _source;
            this.Add(_tableView);
        }
コード例 #11
0
ファイル: ScrollView.cs プロジェクト: Fedorm/core-master
        protected override void Dismiss()
        {
            DismissControls();

            UITableViewSource source = _view.Source;

            if (source != null)
            {
                _view.Source = null;
                source.Dispose();
            }
        }
		//========================================================================================================================================
		//  PUBLIC OVERRIDES
		//========================================================================================================================================
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			_tableView 			= new UITableView ();
			_source 			= new TableViewSource ();

			this._tableView.RowHeight = UITableView.AutomaticDimension;
			this._tableView.EstimatedRowHeight = 176;
			_tableView.Source 	= _source;
			this.Add (_tableView);


		}
コード例 #13
0
        public DialogView(RectangleF frame, UITableViewStyle style, RootElement root) : base(frame)
        {
            tableView = MakeTableView(new RectangleF(0, 0, frame.Width, frame.Height), style);
            //tableView.BackgroundView.Alpha = 0.0f;
            tableView.AutosizesSubviews = true;

            BackgroundColor = UIColor.Clear;

            source           = new Source(this);
            tableView.Source = source;

            AddSubview(tableView);

            Root = root;
        }
コード例 #14
0
ファイル: DialogView.cs プロジェクト: jcaudill/FlightLog
        public DialogView(RectangleF frame, UITableViewStyle style, RootElement root)
            : base(frame)
        {
            tableView = MakeTableView (new RectangleF (0, 0, frame.Width, frame.Height), style);
            tableView.BackgroundView.Alpha = 0.0f;
            tableView.AutosizesSubviews = true;

            BackgroundColor = UIColor.Clear;

            source = new Source (this);
            tableView.Source = source;

            AddSubview (tableView);

            Root = root;
        }
コード例 #15
0
 private async void textField_EditingChanged(object sender, EventArgs args)
 {
     await base.ExecuteMethodAsync("textField_EditingChanged", async delegate()
     {
         string search      = this.textField.Text;
         this.selectedIndex = -1;
         CGPoint position   = targetView.ConvertPointFromView(new CoreGraphics.CGPoint(0, 0), textField);
         this.autoCompleteTableView.Frame  = new CoreGraphics.CGRect(0, position.Y + this.textField.Frame.Height, targetView.Frame.Width, targetView.Frame.Height - position.Y - this.textField.Frame.Height);
         this.autoCompleteTableView.Hidden = false;
         this.matchedElements = await findElements(search);
         if (this.matchedElements.Count == 0)
         {
             this.matchedElements.Add(this.GetEmptySearchItemMethod(search));
         }
         this.autoCompleteTableViewSource  = new AutoCompleteTableViewSource <TItem>(this.matchedElements, this.OnSelectedElement, this.GetItemNameMethod);
         this.autoCompleteTableView.Source = this.autoCompleteTableViewSource;
         this.autoCompleteTableView.ReloadData();
     });
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            EdgesForExtendedLayout = UIRectEdge.None;

            backgroundView = new UIView(View.Frame);
            backgroundView.BackgroundColor = UIColor.White;
            View.AddSubview(backgroundView);

            searchBar = new UISearchBar();
            searchBar.TranslatesAutoresizingMaskIntoConstraints = false;
            searchBar.ReturnKeyType = UIReturnKeyType.Done;
            View.AddSubview(searchBar);
            AddSearchBarConstraints();
            searchBar.BecomeFirstResponder();

            // TODO - add 'powered by google' attribution image before resultsTable
            googleAttribution       = new UIImageView();
            googleAttribution.Image = UIImage.FromBundle("powered_by_google_on_white");
            googleAttribution.TranslatesAutoresizingMaskIntoConstraints = false;
            googleAttribution.ContentMode = UIViewContentMode.ScaleAspectFit;
            View.AddSubview(googleAttribution);
            AddAttributionConstraints();

            resultsTable = new UITableView();
            tableSource  = new ResultsTableSource();
            resultsTable.TranslatesAutoresizingMaskIntoConstraints = false;
            resultsTable.Source = tableSource;
            ((ResultsTableSource)resultsTable.Source).apiKey           = apiKey;
            ((ResultsTableSource)resultsTable.Source).RowItemSelected += OnPlaceSelection;
            View.AddSubview(resultsTable);
            AddResultsTableConstraints();

            searchBar.TextChanged += SearchInputChanged;
            resultsTable.Hidden    = true;

            NavigationItem.SetLeftBarButtonItem(
                new UIBarButtonItem(UIBarButtonSystemItem.Stop, (sender, args) =>
            {
                DismissViewController(true, null);
            }), true);
        }
コード例 #17
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

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

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

            if (root != null)
            {
                root.Dispose();
                root = null;
            }
        }
コード例 #18
0
            public AutoCompleteTextField(UIViewController viewController, UITextField textView, List <string> elements,
                                         Action selected)
            {
                _selected        = selected;
                _viewController  = viewController;
                _textField       = textView;
                _selectedIndex   = -1;
                _elements        = elements;
                _matchedElements = _elements
                                   .Where(e => e.ToLowerInvariant().Contains(_textField.Text.ToLowerInvariant())).ToList();
                _autoCompleteTableView = new UITableView(new CGRect(0, _textField.Frame.Y,
                                                                    _viewController.View.Frame.Width,
                                                                    _viewController.View.Frame.Height / 2 - _textField.Frame.Y - _textField.Frame.Height));
                _autoCompleteTableViewSource = new AutoCompleteTableViewSource(_matchedElements, SelectedElement);
                _autoCompleteTableView.ReloadData();
                _autoCompleteTableView.ScrollEnabled = true;
                _autoCompleteTableView.Hidden        = true;
                _viewController.View.AddSubview(_autoCompleteTableView);

                _textField.EditingChanged -= GetTextFieldEditingChangedHandler();
                _textField.EditingChanged += GetTextFieldEditingChangedHandler();
            }
コード例 #19
0
 private EventHandler GetTextFieldEditingChangedHandler()
 {
     if (this.elements != null)
     {
         if ((this.textFieldEditingChangedHandler == null && this.textField.Text.Length > 2) && this.elements.Count > 0)
         {
             this.textFieldEditingChangedHandler = delegate(object sender, EventArgs e)
             {
                 this.selectedIndex = -1;
                 this.autoCompleteTableView.Hidden = false;
                 //this.matchedElements = this.elements.Where(elem => elem.ToLower().Contains(this.textField.Text.ToLower())).ToList();
                 this.matchedElements              = this.elements;
                 this.autoCompleteTableViewSource  = new AutoCompleteTableViewSource(this.matchedElements, this.SelectedElement, this.textField);
                 this.autoCompleteTableView.Source = this.autoCompleteTableViewSource;
                 int Count = matchedElements.Count;
                 this.autoCompleteTableView.Frame = new CGRect(this.autoCompleteTableView.Frame.X, this.autoCompleteTableView.Frame.Y, this.autoCompleteTableView.Frame.Size.Width, Count * 35);
                 this.autoCompleteTableView.ReloadData();
             };
         }
     }
     return(this.textFieldEditingChangedHandler);
 }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			tableView 	= new UITableView ();
			helper 		= new TableViewHelper (tableView);


			var s0r0 = buildCell (UITableViewCellStyle.Default, "S0R0", "Tap to hide/show Date Selector");
			var s0r1 = buildDateCell (UITableViewCellStyle.Default, "S0R1");
					 
			var s1r0 = buildCell (UITableViewCellStyle.Default, "S1R0", "Tap to fill 3rd Section");
					 
			var s2r0 = buildCell (UITableViewCellStyle.Default, "S2R0", "3rd Section - Row 0", "Tap to Delete");
			var s2r1 = buildCell (UITableViewCellStyle.Default, "S2R1", "3rd Section - Row 1", "Tap to Delete");
			var s2r2 = buildCell (UITableViewCellStyle.Default, "S2R2", "3rd Section - Row 2", "Tap to Delete");
					 
			var s3r0 = buildCell (UITableViewCellStyle.Default, "S3R0", "This one doesn't do anything");

			helper.addCell (0, s0r0, "S0R0");
			helper.addCell (0, s0r1, "S0R1");

			helper.addCell (1, s1r0, "S1R0");

			helper.addCell (2, s2r0, "S2R0");
			helper.addCell (2, s2r1, "S2R1");
			helper.addCell (2, s2r2, "S2R2");

			helper.addCell (3, s3r0, "S3R0");

			helper.hideCell ("S0R1");
			helper.hideCell ("S1R0");

			source 				= new TableViewSource (helper);
			tableView.Source 	= source;
			this.Add (tableView);

		}
コード例 #21
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            tableView = new UITableView();
            helper    = new TableViewHelper(tableView);


            var s0r0 = buildCell(UITableViewCellStyle.Default, "S0R0", "Tap to hide/show Date Selector");
            var s0r1 = buildDateCell(UITableViewCellStyle.Default, "S0R1");

            var s1r0 = buildCell(UITableViewCellStyle.Default, "S1R0", "Tap to fill 3rd Section");

            var s2r0 = buildCell(UITableViewCellStyle.Default, "S2R0", "3rd Section - Row 0", "Tap to Delete");
            var s2r1 = buildCell(UITableViewCellStyle.Default, "S2R1", "3rd Section - Row 1", "Tap to Delete");
            var s2r2 = buildCell(UITableViewCellStyle.Default, "S2R2", "3rd Section - Row 2", "Tap to Delete");

            var s3r0 = buildCell(UITableViewCellStyle.Default, "S3R0", "This one doesn't do anything");

            helper.addCell(0, s0r0, "S0R0");
            helper.addCell(0, s0r1, "S0R1");

            helper.addCell(1, s1r0, "S1R0");

            helper.addCell(2, s2r0, "S2R0");
            helper.addCell(2, s2r1, "S2R1");
            helper.addCell(2, s2r2, "S2R2");

            helper.addCell(3, s3r0, "S3R0");

            helper.hideCell("S0R1");
            helper.hideCell("S1R0");

            source           = new TableViewSource(helper);
            tableView.Source = source;
            this.Add(tableView);
        }
コード例 #22
0
        public void RenderChoiceSelectionChanged(int selectedIndex)
        {
            // This function modifies the UI parameter controls depending on which stretch
            // renderer is chosen by the user when clicking the table view

            // Get the user choice for the raster stretch render
            UITableViewSource myUITableViewSource  = _myRenderChoiceType.Source;
            TableSource       myTableSource        = (TableSource)myUITableViewSource;
            string            myRendererTypeChoice = myTableSource.TableItems[selectedIndex];

            switch (myRendererTypeChoice)
            {
            case "Min Max":

                // This section displays/resets the user choice options for MinMaxStretchParameters

                // Make sure all the GUI items are visible
                _Label_Parameter1.Hidden = false;
                _Label_Parameter2.Hidden = false;
                _Input_Parameter1.Hidden = false;
                _Input_Parameter2.Hidden = false;

                // Define what values/options the user sees
                _Label_Parameter1.Text = "Minimum value (0 - 255):";
                _Label_Parameter2.Text = "Maximum value (0 - 255):";
                _Input_Parameter1.Text = "10";
                _Input_Parameter2.Text = "150";

                break;

            case "Percent Clip":

                // This section displays/resets the user choice options for PercentClipStretchParameters

                // Make sure all the GUI items are visible
                _Label_Parameter1.Hidden = false;
                _Label_Parameter2.Hidden = false;
                _Input_Parameter1.Hidden = false;
                _Input_Parameter2.Hidden = false;

                // Define what values/options the user sees
                _Label_Parameter1.Text = "Minimum (0 - 100):";
                _Label_Parameter2.Text = "Maximum (0 - 100)";
                _Input_Parameter1.Text = "0";
                _Input_Parameter2.Text = "50";

                break;

            case "Standard Deviation":

                // This section displays/resets the user choice options for StandardDeviationStretchParameters

                // Make sure that only the necessary GUI items are visible
                _Label_Parameter1.Hidden = false;
                _Label_Parameter2.Hidden = true;
                _Input_Parameter1.Hidden = false;
                _Input_Parameter2.Hidden = true;

                // Define what values/options the user sees
                _Label_Parameter1.Text = "Factor (.25 to 4):";
                _Input_Parameter1.Text = "0.5";

                break;
            }
        }
コード例 #23
0
 public ScrollDelegate(Forms9Patch.EnhancedListView element, UITableViewSource source) : base()
 {
     Element = element;
     Source  = source;
 }
コード例 #24
0
		private static void InitializeSearch(object view, UITableViewSource source)
		{
			var searchbarAttribute = view.GetType().GetCustomAttribute<SearchbarAttribute>();
			var searchbar = source as ISearchBar;
			if (searchbarAttribute != null && searchbar != null)
			{
				searchbar.SearchPlaceholder = searchbarAttribute.Placeholder;
				searchbar.IncrementalSearch = searchbarAttribute.IncrementalSearch;
				searchbar.EnableSearch = searchbarAttribute.ShowImmediately;
				searchbar.IsSearchbarHidden = !searchbarAttribute.ShowImmediately;
		
					
				var methods = GetMethods(view);
				foreach (var method in methods)
				{
					var attribute = method.GetCustomAttribute<SearchbarAttribute>();
					if (attribute != null)
					{
						searchbar.SearchPlaceholder = attribute.Placeholder;
						searchbar.IncrementalSearch = attribute.IncrementalSearch;
						searchbar.EnableSearch = attribute.ShowImmediately;
						searchbar.IsSearchbarHidden = !attribute.ShowImmediately;

						searchbar.SearchCommand = new SearchCommand(view, method as MethodInfo);
						break;
					};
				}
			}
		}
コード例 #25
0
 public MyLVSource(UITableViewSource origSource, ListView myListV)
 {
     originalSource = origSource;
     myListView     = myListV;
 }
コード例 #26
0
 public ScrollDelegate(EnhancedListView element, UITableViewSource source)
 {
     Element = element;
     Source  = source;
 }
コード例 #27
0
        private void OnUpdateRendererClicked(object sender, EventArgs e)
        {
            try
            {
                // Define the RasterLayer that will be used to display in the map
                RasterLayer rasterLayer_ForDisplayInMap;

                // Define the ColorRamp that will be used by the BlendRenderer
                ColorRamp myColorRamp;

                // Get the user choice for the ColorRamps
                UITableViewSource myUITableViewSource_ColorRamp = _ColorRamps.Source;
                TableSource       myTableSource_ColorRamp       = (TableSource)myUITableViewSource_ColorRamp;
                string            myColorRampChoice;

                if (myTableSource_ColorRamp.SelectedValue == null)
                {
                    // If the user does not click on a choice in the table but just clicks the
                    // button, the selected value will be null so use the initial ColorRamp option
                    myColorRampChoice = "Elevation";
                }
                else
                {
                    // The user clicked on an option in the table and thus the selected value
                    // will contain a valid choice
                    myColorRampChoice = myTableSource_ColorRamp.SelectedValue;
                }

                // Based on ColorRamp type chosen by the user, create a different
                // RasterLayer and define the appropriate ColorRamp option
                if (myColorRampChoice == "None")
                {
                    // The user chose not to use a specific ColorRamp, therefore
                    // need to create a RasterLayer based on general imagery (ie. Shasta.tif)
                    // for display in the map and use null for the ColorRamp as one of the
                    // parameters in the BlendRenderer constructor

                    // Load the raster file using a path on disk
                    Raster raster_Imagery = new Raster(GetRasterPath_Imagery());

                    // Create the raster layer from the raster
                    rasterLayer_ForDisplayInMap = new RasterLayer(raster_Imagery);

                    // Set up the ColorRamp as being null
                    myColorRamp = null;
                }
                else
                {
                    // The user chose a specific ColorRamp (options: are Elevation, DemScreen, DemLight),
                    // therefore create a RasterLayer based on an imagery with elevation
                    // (ie. Shasta_Elevation.tif) for display in the map. Also create a ColorRamp
                    // based on the user choice, translated into an Enumeration, as one of the parameters
                    // in the BlendRenderer constructor

                    // Load the raster file using a path on disk
                    Raster raster_Elevation = new Raster(GetRasterPath_Elevation());

                    // Create the raster layer from the raster
                    rasterLayer_ForDisplayInMap = new RasterLayer(raster_Elevation);

                    // Create a ColorRamp based on the user choice, translated into an Enumeration
                    PresetColorRampType myPresetColorRampType = (PresetColorRampType)Enum.Parse(typeof(PresetColorRampType), myColorRampChoice);
                    myColorRamp = ColorRamp.Create(myPresetColorRampType, 256);
                }


                // Define the parameters used by the BlendRenderer constructor
                Raster raster_ForMakingBlendRenderer   = new Raster(GetRasterPath_Elevation());
                IEnumerable <double> myOutputMinValues = new List <double> {
                    9
                };
                IEnumerable <double> myOutputMaxValues = new List <double> {
                    255
                };
                IEnumerable <double> mySourceMinValues = new List <double>();
                IEnumerable <double> mySourceMaxValues = new List <double>();
                IEnumerable <double> myNoDataValues    = new List <double>();
                IEnumerable <double> myGammas          = new List <double>();

                // Get the user choice for the SlopeType
                UITableViewSource myUITableViewSource_SlopeType = _SlopeTypes.Source;
                TableSource       myTableSource_SlopeType       = (TableSource)myUITableViewSource_SlopeType;
                string            mySlopeTypeChoice;

                if (myTableSource_SlopeType.SelectedValue == null)
                {
                    // If the user does not click on a choice in the table but just clicks the
                    // button, the selected value will be null so use the initial SlopeType option
                    mySlopeTypeChoice = "Degree";
                }
                else
                {
                    // The user clicked on an option in the table and thus the selected value
                    // will contain a valid choice
                    mySlopeTypeChoice = myTableSource_SlopeType.SelectedValue;
                }

                SlopeType mySlopeType = (SlopeType)Enum.Parse(typeof(SlopeType), mySlopeTypeChoice);

                BlendRenderer myBlendRenderer = new BlendRenderer(
                    raster_ForMakingBlendRenderer, // elevationRaster - Raster based on a elevation source
                    myOutputMinValues,             // outputMinValues - Output stretch values, one for each band
                    myOutputMaxValues,             // outputMaxValues - Output stretch values, one for each band
                    mySourceMinValues,             // sourceMinValues - Input stretch values, one for each band
                    mySourceMaxValues,             // sourceMaxValues - Input stretch values, one for each band
                    myNoDataValues,                // noDataValues - NoData values, one for each band
                    myGammas,                      // gammas - Gamma adjustment
                    myColorRamp,                   // colorRamp - ColorRamp object to use, could be null
                    _Altitude_Slider.Value,        // altitude - Altitude angle of the light source
                    _Azimuth_Slider.Value,         // azimuth - Azimuth angle of the light source, measured clockwise from north
                    1,                             // zfactor - Factor to convert z unit to x,y units, default is 1
                    mySlopeType,                   // slopeType - Slope Type
                    1,                             // pixelSizeFactor - Pixel size factor, default is 1
                    1,                             // pixelSizePower - Pixel size power value, default is 1
                    8);                            // outputBitDepth - Output bit depth, default is 8-bi

                // Set the RasterLayer.Renderer to be the BlendRenderer
                rasterLayer_ForDisplayInMap.Renderer = myBlendRenderer;

                // Set the new base map to be the RasterLayer with the BlendRenderer applied
                _myMapView.Map.Basemap = new Basemap(rasterLayer_ForDisplayInMap);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
コード例 #28
0
 public ListSortableTableSource(UITableViewSource source, ListView element)
 {
     _originalSource = source;
     _formsElement   = element;
 }
コード例 #29
0
ファイル: DialogView.cs プロジェクト: jcaudill/FlightLog
        protected override void Dispose(bool disposing)
        {
            base.Dispose (disposing);

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

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

            if (root != null) {
                root.Dispose ();
                root = null;
            }
        }
 public MCListViewSource(UITableViewSource formsSource, 
     Action<CGPoint> onStartScrolling, 
     Action<CGPoint> onScrolled,
     Action onStopScrolling
 )
 {
     _formsSource = formsSource;
     _onStartScrolling = onStartScrolling;
     _onScrolled = onScrolled;
     _onStopScrolling = onStopScrolling;
 }
コード例 #31
0
 public CustomDatasource(UITableViewSource underlyingTableSource)
 {
     this.underlyingTableSource = underlyingTableSource;
 }
コード例 #32
0
 private EventHandler GetTextFieldEditingChangedHandler()
 {
     if (this.textFieldEditingChangedHandler == null) {
         this.textFieldEditingChangedHandler = delegate(object sender, EventArgs e) {
             this.selectedIndex = -1;
             this.autoCompleteTableView.Hidden = false;
             this.matchedElements = this.elements.Where (elem => elem.ToLower ().Contains (this.textField.Text.ToLower ())).ToList ();
             this.autoCompleteTableViewSource = new AutoCompleteTableViewSource (this.matchedElements, this.SelectedElement);
             this.autoCompleteTableView.Source = this.autoCompleteTableViewSource;
             this.autoCompleteTableView.ReloadData ();
         };
     }
     return this.textFieldEditingChangedHandler;
 }
コード例 #33
0
        private void OnUpdateRendererClicked(object sender, EventArgs e)
        {
            // This function acquires the user selection of the stretch renderer from the table view
            // along with the parameters specified, then a stretch renderer is created and applied to
            // the raster layer

            // Get the user choice for the raster stretch render
            UITableViewSource myUITableViewSource = _myRenderChoiceType.Source;
            TableSource       myTableSource       = (TableSource)myUITableViewSource;
            string            myRendererTypeChoice;

            if (myTableSource.SelectedValue == null)
            {
                // If the user does not click on a choice in the table but just clicks the
                // button, the selected value will be null so use the initial
                // stretch renderer option
                myRendererTypeChoice = "Min Max";
            }
            else
            {
                // The user clicked on an option in the table and thus the selected value
                // will contain a valid choice
                myRendererTypeChoice = myTableSource.SelectedValue;
            }

            // Create an IEnumerable from an empty list of doubles for the gamma values in the stretch render
            IEnumerable <double> myGammaValues = new List <double>();

            // Create a color ramp for the stretch renderer
            ColorRamp myColorRamp = ColorRamp.Create(PresetColorRampType.DemLight, 1000);

            // Create the place holder for the stretch renderer
            StretchRenderer myStretchRenderer = null;

            switch (myRendererTypeChoice)
            {
            case "Min Max":

                // This section creates a stretch renderer based on a MinMaxStretchParameters
                // TODO: Add you own logic to ensure that accurate min/max stretch values are used

                // Create an IEnumerable from a list of double min stretch value doubles
                IEnumerable <double> myMinValues = new List <double> {
                    Convert.ToDouble(_Input_Parameter1.Text)
                };

                // Create an IEnumerable from a list of double max stretch value doubles
                IEnumerable <double> myMaxValues = new List <double> {
                    Convert.ToDouble(_Input_Parameter2.Text)
                };

                // Create a new MinMaxStretchParameters based on the user choice for min and max stretch values
                MinMaxStretchParameters myMinMaxStretchParameters = new MinMaxStretchParameters(myMinValues, myMaxValues);

                // Create the stretch renderer based on the user defined min/max stretch values, empty gamma values, statistic estimates, and a predefined color ramp
                myStretchRenderer = new StretchRenderer(myMinMaxStretchParameters, myGammaValues, true, myColorRamp);

                break;

            case "Percent Clip":

                // This section creates a stretch renderer based on a PercentClipStretchParameters
                // TODO: Add you own logic to ensure that accurate min/max percent clip values are used

                // Create a new PercentClipStretchParameters based on the user choice for min and max percent clip values
                PercentClipStretchParameters myPercentClipStretchParameters = new PercentClipStretchParameters(Convert.ToDouble(_Input_Parameter1.Text), Convert.ToDouble(_Input_Parameter2.Text));

                // Create the percent clip renderer based on the user defined min/max percent clip values, empty gamma values, statistic estimates, and a predefined color ramp
                myStretchRenderer = new StretchRenderer(myPercentClipStretchParameters, myGammaValues, true, myColorRamp);

                break;

            case "Standard Deviation":

                // This section creates a stretch renderer based on a StandardDeviationStretchParameters
                // TODO: Add you own logic to ensure that an accurate standard deviation value is used

                // Create a new StandardDeviationStretchParameters based on the user choice for standard deviation value
                StandardDeviationStretchParameters myStandardDeviationStretchParameters = new StandardDeviationStretchParameters(Convert.ToDouble(_Input_Parameter1.Text));

                // Create the standard deviation renderer based on the user defined standard deviation value, empty gamma values, statistic estimates, and a predefined color ramp
                myStretchRenderer = new StretchRenderer(myStandardDeviationStretchParameters, myGammaValues, true, myColorRamp);

                break;
            }

            // Get the existing raster layer in the map
            RasterLayer myRasterLayer = (RasterLayer)_myMapView.Map.OperationalLayers[0];

            // Apply the stretch renderer to the raster layer
            myRasterLayer.Renderer = myStretchRenderer;
        }
コード例 #34
0
 public WrapperSource(UITableViewSource original)
 {
     this.original = original;
 }
コード例 #35
0
 public ListViewTableViewDelegate(CustomListViewRenderer renderer)
 {
     _element = renderer.Element;
     _source  = renderer.Control.Source;
 }
コード例 #36
0
            public AutoCompleteTextField(UIViewController viewController, UITextField textView, List<string> elements)
            {
                this.viewController = viewController;
                this.textField = textView;
                this.selectedIndex = -1;
                this.elements = elements;
                this.matchedElements = this.elements.Where (e => e.ToLower ().Contains (this.textField.Text.ToLower ())).ToList ();
                this.autoCompleteTableView = new UITableView (new CoreGraphics.CGRect (0, this.textField.Frame.Y + this.textField.Frame.Height, this.viewController.View.Frame.Width, this.viewController.View.Frame.Height - this.textField.Frame.Y - this.textField.Frame.Height));
                this.autoCompleteTableViewSource = new AutoCompleteTableViewSource (this.matchedElements, this.SelectedElement);
                this.autoCompleteTableView.ReloadData ();
                this.autoCompleteTableView.ScrollEnabled = true;
                this.autoCompleteTableView.Hidden = true;
                this.viewController.View.AddSubview (this.autoCompleteTableView);

                this.textField.EditingChanged -= this.GetTextFieldEditingChangedHandler ();
                this.textField.EditingChanged += this.GetTextFieldEditingChangedHandler ();
            }
コード例 #37
0
 public ListViewDataSourceWrapper(UITableViewSource underlyingTableSource)
 {
     this._underlyingTableSource = underlyingTableSource;
 }
コード例 #38
0
 public void ReloadSessionTableData(TableSourceSessions sessions)
 {
     source       = (TableSourceSessions)sessions;
     table.Source = source;
     table.ReloadData();
 }