コード例 #1
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            var lp = new LocationPicker();

            lp.ID    = filterControl.ID + "_lp";
            lp.Label = "Location";
            lp.AllowedPickerModes = LocationPickerMode.Named | LocationPickerMode.Polygon;
            lp.SetBestPickerModeForLocation(null);
            lp.CssClass = "col-lg-4";
            filterControl.Controls.Add(lp);

            Panel panel = new Panel();

            panel.CssClass = "col-lg-8";
            filterControl.Controls.Add(panel);

            var dvpLocationType = new DefinedValuePicker();

            dvpLocationType.ID             = filterControl.ID + "_dvpLocationType";
            dvpLocationType.Label          = "Location Type";
            dvpLocationType.DataValueField = "Id";
            dvpLocationType.DataTextField  = "Value";
            DefinedTypeCache locationDefinedType = DefinedTypeCache.Get(SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid());

            dvpLocationType.DefinedTypeId = locationDefinedType.Id;
            panel.Controls.Add(dvpLocationType);

            return(new Control[3] {
                lp, dvpLocationType, panel
            });
        }
コード例 #2
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            RockDropDownList groupLocationTypeList = new RockDropDownList();

            groupLocationTypeList.Items.Clear();
            foreach (var value in Rock.Web.Cache.DefinedTypeCache.Read(Rock.SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid()).DefinedValues.OrderBy(a => a.Order).ThenBy(a => a.Value))
            {
                groupLocationTypeList.Items.Add(new ListItem(value.Value, value.Guid.ToString()));
            }

            groupLocationTypeList.Items.Insert(0, Rock.Constants.None.ListItem);

            groupLocationTypeList.ID    = filterControl.ID + "_groupLocationTypeList";
            groupLocationTypeList.Label = "Location Type";
            filterControl.Controls.Add(groupLocationTypeList);

            LocationPicker locationPicker = new LocationPicker();

            locationPicker.ID    = filterControl.ID + "_locationPicker";
            locationPicker.Label = "Location";

            filterControl.Controls.Add(locationPicker);

            NumberBox numberBox = new NumberBox();

            numberBox.ID         = filterControl.ID + "_numberBox";
            numberBox.NumberType = ValidationDataType.Double;
            numberBox.Label      = "Miles";
            numberBox.AddCssClass("number-box-miles");
            filterControl.Controls.Add(numberBox);

            return(new Control[3] {
                groupLocationTypeList, locationPicker, numberBox
            });
        }
コード例 #3
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            lp       = new LocationPicker();
            lp.ID    = filterControl.ID + "_lp";
            lp.Label = "Location";
            lp.AllowedPickerModes = LocationPickerMode.Named | LocationPickerMode.Polygon;
            lp.SetBestPickerModeForLocation(null);
            lp.CssClass = "col-lg-4";
            filterControl.Controls.Add(lp);

            Panel panel = new Panel();

            panel.CssClass = "col-lg-8";
            filterControl.Controls.Add(panel);

            ddlLocationType                = new RockDropDownList();
            ddlLocationType.ID             = filterControl.ID + "_ddlLocationType";
            ddlLocationType.Label          = "Location Type";
            ddlLocationType.DataValueField = "Id";
            ddlLocationType.DataTextField  = "Value";
            DefinedTypeCache locationDefinedType = DefinedTypeCache.Read(SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid());

            ddlLocationType.BindToDefinedType(locationDefinedType);
            ddlLocationType.Items.Insert(0, new ListItem("(All Location Types)", ""));
            panel.Controls.Add(ddlLocationType);

            return(new Control[3] {
                lp, ddlLocationType, panel
            });
        }
コード例 #4
0
        /// <summary>
        /// Sets the selected location.
        /// Note this will redirect to the current page to include a LocationId query parameter if a LocationId parameter in the URL is missing or doesn't match.
        /// </summary>
        /// <param name="rockBlock">The rock block.</param>
        /// <param name="lpLocation">The lp location.</param>
        /// <param name="locationId">The identifier of the location.</param>
        /// <param name="campusId">The campus identifier.</param>
        public static void SetSelectedLocation(RockBlock rockBlock, LocationPicker lpLocation, int?locationId, int campusId)
        {
            if (locationId.HasValue && locationId > 0)
            {
                CheckinManagerHelper.SaveCampusLocationConfigurationToCookie(campusId, locationId);
                var pageParameterLocationId = rockBlock.PageParameter(PageParameterKey.LocationId).AsIntegerOrNull();
                if (!pageParameterLocationId.HasValue || pageParameterLocationId.Value != locationId)
                {
                    var additionalQueryParameters = new Dictionary <string, string>();
                    additionalQueryParameters.Add(PageParameterKey.LocationId, locationId.ToString());
                    rockBlock.NavigateToCurrentPageReference(additionalQueryParameters);
                    return;
                }

                using (var rockContext = new RockContext())
                {
                    if (locationId.HasValue)
                    {
                        lpLocation.SetNamedLocation(NamedLocationCache.Get(locationId.Value));
                    }
                }
            }
            else
            {
                lpLocation.Location = null;
                CheckinManagerHelper.SaveCampusLocationConfigurationToCookie(campusId, null);
            }
        }
コード例 #5
0
 void OnLocationButtonClick(object sender, EventArgs e)
 {
     LocationPicker.IsVisible = true;
     LocationPicker.IsEnabled = true;
     LocationPicker.Focus();
     LocationPicker.Unfocused += LocationPicker_Unfocused;
 }
コード例 #6
0
ファイル: DialogService.cs プロジェクト: Aqudei/RescueClient
        public Tuple <double, double> ShowMapPicker()
        {
            var dlgMap = new LocationPicker();

            if (dlgMap.ShowDialog() == true)
            {
                return(new Tuple <double, double>(dlgMap.Latitude, dlgMap.Longitude));
            }
            else
            {
                return(new Tuple <double, double>(0, 0));;
            }
        }
コード例 #7
0
        /// <summary>
        /// Creates the HTML controls required to configure this type of field
        /// </summary>
        /// <returns></returns>
        public override List <Control> ConfigurationControls()
        {
            var controls = base.ConfigurationControls();

            var locationTypeDefinedType = DefinedTypeCache.Get(SystemGuid.DefinedType.LOCATION_TYPE.AsGuid());

            var dvpLocationType = new DefinedValuePicker();

            controls.Add(dvpLocationType);
            dvpLocationType.AutoPostBack          = true;
            dvpLocationType.SelectedIndexChanged += OnQualifierUpdated;
            dvpLocationType.Label         = "Location Type";
            dvpLocationType.DefinedTypeId = locationTypeDefinedType.Id;

            var lpParentLocation = new LocationPicker();

            controls.Add(lpParentLocation);
            lpParentLocation.Label              = "Parent Location";
            lpParentLocation.Required           = true;
            lpParentLocation.AllowedPickerModes = LocationPickerMode.Named;
            lpParentLocation.CurrentPickerMode  = LocationPickerMode.Named;
            lpParentLocation.SelectLocation    += OnQualifierUpdated;

            var cbAllowAddingNewLocations = new RockCheckBox();

            controls.Add(cbAllowAddingNewLocations);
            cbAllowAddingNewLocations.AutoPostBack    = true;
            cbAllowAddingNewLocations.CheckedChanged += OnQualifierUpdated;
            cbAllowAddingNewLocations.Label           = "Allow Adding New Locations";

            var cbShowCityState = new RockCheckBox();

            controls.Add(cbShowCityState);
            cbShowCityState.AutoPostBack    = true;
            cbShowCityState.CheckedChanged += OnQualifierUpdated;
            cbShowCityState.Label           = "Show City / State";

            var cbAddressRequired = new RockCheckBox();

            controls.Add(cbAddressRequired);
            cbAddressRequired.AutoPostBack    = true;
            cbAddressRequired.CheckedChanged += OnQualifierUpdated;
            cbAddressRequired.Label           = "Address Required";

            return(controls);
        }
コード例 #8
0
        public async void Handle_Clicked(object sender, EventArgs e)
        {
            LocationPicker.PinImage = "pin.png";
            var place = await LocationPicker.SelectPlace();

            if (place?.Data != null)
            {
                SelectedPlace = place.Data;
                location.Text = place.Data.LocationAddress;
            }
            else
            {
                if (place != null)
                {
                    await DisplayAlert("Oops", place.Status.ToString(), "OK");
                }
            }
        }
コード例 #9
0
        /// <summary>
        /// Sets the selection.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        /// <param name="controls">The controls.</param>
        /// <param name="selection">The selection.</param>
        public override void SetSelection(Type entityType, Control[] controls, string selection)
        {
            var  selections   = selection.SplitDelimitedValues();
            Guid locationGuid = selections[0].AsGuid();

            var location = new LocationService(new RockContext()).Get(locationGuid);

            if (location != null)
            {
                LocationPicker locationPicker = controls[0] as LocationPicker;
                locationPicker.SetBestPickerModeForLocation(location);
                locationPicker.Location = location;
            }

            if (selections.Length >= 2)
            {
                (controls[1] as RockDropDownList).SetValue(selections[1]);
            }
        }
コード例 #10
0
ファイル: DistanceFromFilter.cs プロジェクト: ewin66/rockrms
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls(Type entityType, FilterField filterControl)
        {
            LocationPicker locationPicker = new LocationPicker();

            locationPicker.ID    = filterControl.ID + "_0";
            locationPicker.Label = "Location";

            filterControl.Controls.Add(locationPicker);

            NumberBox numberBox = new NumberBox();

            numberBox.ID         = filterControl.ID + "_1";
            numberBox.NumberType = ValidationDataType.Double;
            numberBox.Label      = "Miles";
            numberBox.AddCssClass("number-box-miles");
            filterControl.Controls.Add(numberBox);

            return(new Control[2] {
                locationPicker, numberBox
            });
        }
コード例 #11
0
ファイル: DistanceFromSelect.cs プロジェクト: waldo2590/Rock
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <param name="parentControl"></param>
        /// <returns></returns>
        public override System.Web.UI.Control[] CreateChildControls(System.Web.UI.Control parentControl)
        {
            LocationPicker locationPicker = new LocationPicker();

            locationPicker.ID    = parentControl.ID + "_0";
            locationPicker.Label = "Location";
            parentControl.Controls.Add(locationPicker);

            RockDropDownList locationTypeList = new RockDropDownList();

            locationTypeList.Items.Clear();
            foreach (var value in DefinedTypeCache.Get(Rock.SystemGuid.DefinedType.GROUP_LOCATION_TYPE.AsGuid()).DefinedValues.OrderBy(a => a.Order).ThenBy(a => a.Value))
            {
                locationTypeList.Items.Add(new ListItem(value.Value, value.Guid.ToString()));
            }

            locationTypeList.Items.Insert(0, Rock.Constants.None.ListItem);

            locationTypeList.ID    = parentControl.ID + "_grouplocationType";
            locationTypeList.Label = "Address Type";
            parentControl.Controls.Add(locationTypeList);

            return(new System.Web.UI.Control[] { locationPicker, locationTypeList });
        }
コード例 #12
0
ファイル: DistanceFromSelect.cs プロジェクト: waldo2590/Rock
        /// <summary>
        /// Gets the selection.
        /// </summary>
        /// <param name="controls">The controls.</param>
        /// <returns></returns>
        public override string GetSelection(System.Web.UI.Control[] controls)
        {
            if (controls.Count() == 2)
            {
                Guid?          locationGuid     = null;
                Guid?          locationTypeGuid = null;
                LocationPicker locationPicker   = controls[0] as LocationPicker;
                Location       location         = locationPicker.Location;
                if (location != null)
                {
                    locationGuid = location.Guid;
                }

                RockDropDownList dropDownList = controls[1] as RockDropDownList;
                if (dropDownList != null)
                {
                    locationTypeGuid = dropDownList.SelectedValue.AsGuidOrNull();
                }

                return(string.Format("{0}|{1}", locationGuid, locationTypeGuid));
            }

            return(string.Empty);
        }
コード例 #13
0
        /// <summary>
        /// Gets the selected location.
        /// </summary>
        /// <param name="rockBlock">The rock block.</param>
        /// <param name="campus">The campus.</param>
        /// <param name="lpLocation">The lp location.</param>
        /// <returns></returns>
        public static int?GetSelectedLocation(RockBlock rockBlock, CampusCache campus, LocationPicker lpLocation)
        {
            // If the Campus selection has changed, we need to reload the LocationItemPicker with the Locations specific to that Campus.
            lpLocation.NamedPickerRootLocationId = campus.LocationId.GetValueOrDefault();

            // Check the LocationPicker for the Location ID.
            int locationId = lpLocation.NamedLocation?.Id ?? 0;

            if (locationId > 0)
            {
                return(locationId);
            }

            // If not defined on the LocationPicker, check first for a LocationId Page parameter.
            locationId = rockBlock.PageParameter(PageParameterKey.LocationId).AsInteger();

            if (locationId > 0)
            {
                // double check the locationId in the URL is valid for the Campus (just in case it was altered or is no longer valid for the campus)
                var locationCampusId = NamedLocationCache.Get(locationId).CampusId;
                if (locationCampusId != campus.Id)
                {
                    locationId = 0;
                }
            }

            if (locationId > 0)
            {
                CheckinManagerHelper.SaveCampusLocationConfigurationToCookie(campus.Id, locationId);
            }
            else
            {
                // If still not defined, check for cookie setting.
                locationId = CheckinManagerHelper.GetCheckinManagerConfigurationFromCookie().LocationIdFromSelectedCampusId.GetValueOrNull(campus.Id) ?? 0;

                if (locationId > 0)
                {
                    // double check the locationId in the cookie is valid for the Campus (just in case it was altered or is no longer valid for the campus)
                    var locationCampusId = NamedLocationCache.Get(locationId)?.CampusId;
                    if (locationCampusId != campus.Id)
                    {
                        locationId = 0;
                    }
                }

                if (locationId <= 0)
                {
                    return(null);
                }
            }

            return(locationId);
        }
        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);

            MapCCodeList         = new List <Location>();
            LocationList         = new List <Location>();
            provinceList         = new List <Location>();
            stateList            = new List <Location>();
            FilteredLocationList = new List <Location>();
            SelectedMapCCode     = new Location();
            SelectedLocation     = new Location();

            LocationsPickerViewProperty.Alpha = 0f;
            //LocationPickerWidthConstraintProperty.Constant = 0f;
            //if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            //{
            //	MapCCodePickerWidthConstraint.Constant = 80f;
            //}
            //else {
            //	MapCCodePickerWidthConstraint.Constant = 150f;
            //}

            //Load values if already registered
            if (Settings.IsRegistered)
            {
                EmailTextField.Text       = Settings.Email;
                PasswordTextField.Text    = Settings.Password;
                FirstNameTextField.Text   = Settings.FirstName;
                LastNameTextField.Text    = Settings.LastName;
                PhoneTextField.Text       = Settings.Phone;
                CompanyTextField.Text     = Settings.Company;
                HomeAirportTextField.Text = Settings.HomeAirport;
            }

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

            Task.Run(async() =>
            {
                LocationResponse location = new LocationResponse();
                if (Reachability.IsHostReachable(Settings._baseDomain))
                {
                    location = await LocationResponse.GetLocations();
                    if (location.Status != "Success")
                    {
                        InvokeOnMainThread(() =>
                        {
                            var alert = UIAlertController.Create("There was a problem loading registration data", "Please try again.", UIAlertControllerStyle.Alert);

                            alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Cancel, (obj) =>
                            {
                                RegistrationViewController registrationVC = (RegistrationViewController)((MultiStepProcessHorizontalViewController)this.ParentViewController).ContainerViewController;
                                //var firstStep = registrationVC.Steps.FirstOrDefault();
                                //registrationVC._pageViewController.SetViewControllers(new[] { firstStep as UIViewController }, UIPageViewControllerNavigationDirection.Reverse, true, (finished) =>
                                //{
                                //	if (finished)
                                //	{
                                //		//finalStep.StepActivated(this, new MultiStepProcessStepEventArgs());

                                //	}
                                //});
                                registrationVC.DismissViewController(true, null);
                            }));

                            PresentViewController(alert, animated: true, completionHandler: () =>
                            {
                            });
                        });
                    }
                    else
                    {
                        //Save to settings file to use object during the rest of the registration process
                        Settings.LocationResponse = location;

                        var distinctMapCodes = location.Locations.Select(row => row.MapCCode).Distinct().ToList();
                        List <Location> filteredLocationListByFirstMapCode = new List <Location>();
                        foreach (var mapCode in distinctMapCodes)
                        {
                            Location loc = location.Locations.FirstOrDefault(row => row.MapCCode == mapCode);

                            if (loc != null)
                            {
                                if (loc.MapCCode == "WO")
                                {
                                    Location placeholderLocation     = new Location();
                                    placeholderLocation.LocationId   = loc.LocationId;
                                    placeholderLocation.LocName      = "World";
                                    placeholderLocation.Abbreviation = loc.Abbreviation;
                                    placeholderLocation.MapCCode     = loc.MapCCode;
                                    placeholderLocation.DisplayOrder = loc.DisplayOrder;
                                    filteredLocationListByFirstMapCode.Add(placeholderLocation);
                                }
                                else
                                {
                                    filteredLocationListByFirstMapCode.Add(loc);
                                }
                            }
                        }
                        MapCCodeList = filteredLocationListByFirstMapCode.OrderByDescending(row => row.DisplayOrder).ToList();

                        Location sleLocation     = new Location();
                        sleLocation.LocationId   = 0;
                        sleLocation.LocName      = "Select";
                        sleLocation.Abbreviation = "Select";
                        sleLocation.MapCCode     = "SE";
                        sleLocation.DisplayOrder = 0;
                        MapCCodeList.Insert(0, sleLocation);

                        LocationList         = location.Locations.OrderBy(row => row.DisplayOrder).ToList();
                        provinceList         = location.ProvinceLst.OrderBy(row => row.DisplayOrder).ToList();
                        stateList            = location.StatesLst.OrderBy(row => row.DisplayOrder).ToList();
                        FilteredLocationList = LocationList;

                        if (MapCCodeList.Count > 1 && Settings.LocationPickerSelectedId == 0)
                        {
                            //Assign value to registration objec
                            Settings.LocationPickerSelectedId = MapCCodeList[0].LocationId;
                        }

                        InvokeOnMainThread(() =>
                        {
                            MapCCodePicker.Model = new MapCCodeMod(this);
                            LocationPicker.Model = new LocationsMod(this);

                            if (Settings.IsRegistered)
                            {
                                var previouslSelectedLocation = MapCCodeList.FirstOrDefault(row => row.LocationId == Settings.LocationPickerSelectedId);

                                if (previouslSelectedLocation != null)
                                {
                                    int currentIndex = MapCCodeList.IndexOf(MapCCodeList.FirstOrDefault(row => row.LocationId == Settings.LocationPickerSelectedId));;
                                    MapCCodePicker.Select(currentIndex, 0, true);
                                }
                                else
                                {
                                    if (Settings.LocationPickerSelectedId != 0)
                                    {
                                        int locationId = Settings.LocationPickerSelectedId;
                                        int mapCIndex  = MapCCodeList.IndexOf(MapCCodeList.FirstOrDefault(row => row.LocationId == 0));
                                        MapCCodePicker.Select(mapCIndex, 0, true);
                                        MapCCodePicker.Model.Selected(MapCCodePicker, mapCIndex, 0);

                                        int locationCInddex = FilteredLocationList.IndexOf(FilteredLocationList.FirstOrDefault(row => row.LocationId == locationId));
                                        LocationPicker.Select(locationCInddex, 0, true);
                                        LocationPicker.Model.Selected(LocationPicker, locationCInddex, 0);
                                        //LocationPicker.Alpha = 1f;
                                    }
                                }
                            }
                            else
                            {
                                //MapCCodePicker.Model.Selected(MapCCodePicker, 0, 0);
                                MapCCodePicker.Select(0, 0, true);
                            }
                        });
                    }
                }
                else
                {
                    InvokeOnMainThread(() =>
                    {
                        var alert = UIAlertController.Create("Please connect to the internet", "Internet access is required.", UIAlertControllerStyle.Alert);

                        alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Cancel, (obj) =>
                        {
                            RegistrationViewController registrationVC = (RegistrationViewController)((MultiStepProcessHorizontalViewController)this.ParentViewController).ContainerViewController;
                            //var firstStep = registrationVC.Steps.FirstOrDefault();
                            //registrationVC._pageViewController.SetViewControllers(new[] { firstStep as UIViewController }, UIPageViewControllerNavigationDirection.Reverse, true, (finished) =>
                            //{
                            //	if (finished)
                            //	{
                            //		//finalStep.StepActivated(this, new MultiStepProcessStepEventArgs());

                            //	}
                            //});
                            registrationVC.DismissViewController(true, null);
                        }));

                        PresentViewController(alert, animated: true, completionHandler: () =>
                        {
                        });
                    });
                }
            });
        }
コード例 #15
0
        public void Handle(TLUpdateEditChannelMessage update)
        {
            var channel = With as TLChannel;

            if (channel == null)
            {
                return;
            }

            var message = update.Message as TLMessage31;

            if (message == null || !(message.ToId is TLPeerChannel))
            {
                return;
            }

            if (channel.Id.Value == message.ToId.Id.Value)
            {
                Execute.BeginOnUIThread(() =>
                {
                    var item = Items.FirstOrDefault(x => x.Index == update.Message.Index) as TLMessage31;
                    if (item == null)
                    {
                        return;
                    }

                    if (item != message)
                    {
                        item.Edit(message);
                    }

                    message       = item;
                    var item48    = item as TLMessage48;
                    var message48 = message as TLMessage48;
                    if (message48 != null && item48 != null)
                    {
                        message48.Entities = item48.Entities;
                    }
                    var message31 = message as TLMessage48;
                    if (message31 != null)
                    {
                        var mediaGeoLive = message31.Media as TLMessageMediaGeoLive;
                        if (mediaGeoLive != null)
                        {
                            mediaGeoLive.EditDate = message31.EditDate;
                            mediaGeoLive.Date     = message31.Date;
                            mediaGeoLive.NotifyOfPropertyChange(() => mediaGeoLive.Geo);
                            mediaGeoLive.NotifyOfPropertyChange(() => mediaGeoLive.EditDate);
                            mediaGeoLive.NotifyOfPropertyChange(() => mediaGeoLive.Active);

                            message31.NotifyOfPropertyChange(() => message31.Message);
                            message31.NotifyOfPropertyChange(() => message31.ReplyMarkup);

                            if (LocationPicker != null)
                            {
                                LocationPicker.UpdateLiveLocation(message31);
                            }
                            if (LiveLocationBadge != null)
                            {
                                LiveLocationBadge.UpdateLiveLocation(message31);
                            }

                            return;
                        }

                        message31.NotifyOfPropertyChange(() => message31.Message);
                        message31.NotifyOfPropertyChange(() => message31.Media);
                        message31.NotifyOfPropertyChange(() => message31.ReplyMarkup);

                        var mediaGame = message31.Media as TLMessageMediaGame;
                        if (mediaGame != null)
                        {
                            mediaGame.NotifyOfPropertyChange(() => mediaGame.Message);
                            mediaGame.NotifyOfPropertyChange(() => mediaGame.MessageVisibility);
                            mediaGame.NotifyOfPropertyChange(() => mediaGame.DescriptionVisibility);
                        }
                    }
                });
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (CompanyTextField != null)
            {
                CompanyTextField.Dispose();
                CompanyTextField = null;
            }

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

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

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

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

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

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

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

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

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

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

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

            if (RePasswordTextField != null)
            {
                RePasswordTextField.Dispose();
                RePasswordTextField = null;
            }
        }
コード例 #17
0
        private void AddButtonHandler(object parameter)
        {
            LocationPicker picker = new LocationPicker();

            picker.Closed += (s1, e1) =>
                                 {
                                     //Handle dialog closed
                                     if (picker.DialogResult.HasValue && picker.DialogResult.Value)
                                     {
                                         foreach (DocumentLocation location in picker.Locations)
                                         {
                                             var documentLocation = new DocumentAssignedLocation
                                                 {
                                                     Document = mDocument,
                                                     DocumentId = mDocument.Id,
                                                     LocationId = location.Id,
                                                     DocumentLocation = location
                                                 };
                                             var existingDocumentLocation = (from x in mDocument.DocumentAssignedLocations
                                                                             where x.DocumentId == mDocument.Id
                                                                                   && x.LocationId == location.Id
                                                                             select x).FirstOrDefault();
                                             if (existingDocumentLocation == null)
                                             {
                                                 mDocument.DocumentAssignedLocations.Add(documentLocation);
                                             }
                                         }
                                         RaisePropertyChanged("DocumentLocations");
                                         OnCollectionChanged();
                                         Utils.OnCollectionChanged(EventAggregator, mDocument, "DocumentLocationsViewModel", true);
                                     }
                                 };

            picker.Show();
        }
コード例 #18
0
        public void Handle(TLUpdateEditMessage update)
        {
            var message = update.Message as TLMessageCommon;

            if (message == null)
            {
                return;
            }

            var editMessage = false;

            var user = With as TLUserBase;
            var chat = With as TLChatBase;

            if (user != null &&
                message.ToId is TLPeerUser &&
                !message.Out.Value &&
                user.Id.Value == message.FromId.Value)
            {
                editMessage = true;
            }
            else if (user != null &&
                     message.ToId is TLPeerUser &&
                     message.Out.Value &&
                     user.Id.Value == message.ToId.Id.Value)
            {
                editMessage = true;
            }
            else if (chat != null &&
                     message.ToId is TLPeerChat &&
                     chat.Id.Value == message.ToId.Id.Value)
            {
                editMessage = true;
            }

            if (editMessage)
            {
                Execute.BeginOnUIThread(() =>
                {
                    var item = Items.FirstOrDefault(x => x.Index == update.Message.Index) as TLMessageCommon;
                    if (item == null)
                    {
                        return;
                    }

                    if (item != message)
                    {
                        item.Edit(message);
                    }

                    message       = item;
                    var item48    = item as TLMessage48;
                    var message48 = message as TLMessage48;
                    if (message48 != null && item48 != null)
                    {
                        message48.Entities = item48.Entities;
                    }
                    var message31 = message as TLMessage48;
                    if (message31 != null)
                    {
                        var mediaGeoLive = message31.Media as TLMessageMediaGeoLive;
                        if (mediaGeoLive != null)
                        {
                            mediaGeoLive.EditDate = message31.EditDate;
                            mediaGeoLive.Date     = message31.Date;
                            mediaGeoLive.NotifyOfPropertyChange(() => mediaGeoLive.Geo);
                            mediaGeoLive.NotifyOfPropertyChange(() => mediaGeoLive.EditDate);
                            mediaGeoLive.NotifyOfPropertyChange(() => mediaGeoLive.Active);

                            message31.NotifyOfPropertyChange(() => message31.Message);
                            message31.NotifyOfPropertyChange(() => message31.ReplyMarkup);

                            if (LocationPicker != null)
                            {
                                LocationPicker.UpdateLiveLocation(message31);
                            }
                            if (LiveLocationBadge != null)
                            {
                                LiveLocationBadge.UpdateLiveLocation(message31);
                            }

                            return;
                        }

                        message31.NotifyOfPropertyChange(() => message31.Message);
                        message31.NotifyOfPropertyChange(() => message31.Media);
                        message31.NotifyOfPropertyChange(() => message31.ReplyMarkup);

                        var mediaGame = message31.Media as TLMessageMediaGame;
                        if (mediaGame != null)
                        {
                            mediaGame.NotifyOfPropertyChange(() => mediaGame.Message);
                            mediaGame.NotifyOfPropertyChange(() => mediaGame.MessageVisibility);
                            mediaGame.NotifyOfPropertyChange(() => mediaGame.DescriptionVisibility);
                        }
                    }

                    var messageService = item as TLMessageService;
                    if (messageService != null)
                    {
                        var actionGameScore = messageService.Action as TLMessageActionGameScore;
                        if (actionGameScore != null)
                        {
                            messageService.NotifyOfPropertyChange(() => messageService.Self);
                        }
                    }
                });
            }
        }