Ejemplo n.º 1
0
 public ImportExportViewModel()
 {
     if (_crossPermissions is null)
     {
         _crossPermissions = CrossPermissions.Current;
     }
 }
        /// <summary>
        /// Make a button tied to a specific name. Any primitives with the given name and the following script embedded in them will trigger this button when touched.
        /// </summary>
        /// <param name="name">The name of the button.</param>
        /// <returns>A button object that allows listeners to be attached to the button.</returns>
        public IButton MakeButton(string name, IPermissions permissions)
        {
            IButton button = new TouchButton(this, name, permissions);

            _logger.Info("Made button " + name + " with " + button.Prims.ToArray().Length + " primitives.");
            return(button);
        }
Ejemplo n.º 3
0
        public static UIElement ToElement(this IPermissions permissions)
        {
            if (permissions == null)
            {
                return(new Label()
                {
                    Content = ExtensionHelper.ValueUnset
                });
            }

            Expander expander = new Expander()
            {
                Header   = "Permissions".ToDisplayValue(),
                Template = Application.Current.Resources["NiceExpanderTemplate"] as ControlTemplate,
            };

            PropertyInfo[] properties = typeof(IPermissions).GetProperties(BindingFlags.Instance | BindingFlags.Public);

            if (properties == null || !properties.Any())
            {
                return(new UIElement());
            }

            Grid grid = new Grid();

            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });

            Int32 rows = properties.Length;

            for (Int32 row = 0; row < rows; row++)
            {
                grid.RowDefinitions.Add(new RowDefinition()
                {
                    Height = GridLength.Auto
                });

                PropertyInfo property = properties[row];

                Label label = permissions.ToLabel(property);
                grid.Children.Add(label);
                Grid.SetRow(label, row);
                Grid.SetColumn(label, 0);

                UIElement value = permissions.ToValue(property);
                grid.Children.Add(value);
                Grid.SetRow(value, row);
                Grid.SetColumn(value, 1);
            }

            expander.Content = grid;

            return(expander);
        }
        /// <summary>
        /// Make a linked button. If a prim linked to the given root prim is called name then touching it will trigger the button.
        /// </summary>
        /// <param name="name">The name of the button.</param>
        /// <param name="id">The root primitive of the link set. Any children of this primitive with name 'name' will be listened to as a button.</param>
        /// <returns>A button object that allows listeners to be attached to the button.</returns>
        public IButton MakeButton(string name, IPermissions permissions, params UUID[] ids)
        {
            IButton button = new TouchButton(this, name, permissions, ids);

            _logger.Info("Made button " + name + " with " + button.Prims.Count() + " primitives.");
            return(button);
        }
        public void TestInitializer()
        {
            // initialize fake context
            _fakeContext = InitializeFakeContext<FacilitiesController>();

            // explicitly create fake dependencies that need to be intercepted
            //  (all other fake dependencies will be implicitly created by _fakeContext.Resolve<>)
            _fakeBusinessFacade = A.Fake<IBusinessFacade>();
            _fakeLoadedSubscriber = A.Fake<ILoadedSubscriber>();
            _fakeCurrentLocation = A.Fake<ILoadedLocation>();
            _fakeCurrentUser = A.Fake<ILoggedInUser>();
            _fakePermissions = A.Fake<IPermissions>();

            // provide fake dependencies to context
            _fakeContext.Provide(_fakeBusinessFacade);
            _fakeContext.Provide(_fakeLoadedSubscriber);
            _fakeContext.Provide(_fakeCurrentLocation);
            _fakeContext.Provide(_fakeCurrentUser);
            _fakeContext.Provide(_fakePermissions);

            // create system-under-test instance
            _facilitiesControllerForTest = _fakeContext.Resolve<FacilitiesController>();

            // create fake data
            _usiForTest = TestDataRepository.GetUsiForTest();
            _locationIdForTest = TestDataRepository.GetLocationIdForTest();
            _serviceAddressControlNumberForTests = TestDataRepository.GetServiceAddressControlNumberForTest();
            _dpiRegionForTests = TestDataRepository.GetDpiRegionForTest();
        }
 /// <summary>
 /// Adds a user to the allowed list of users to access this LUIS application.
 /// Users are added using their email address.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='azureRegion'>
 /// Supported Azure regions for Cognitive Services endpoints. Possible values
 /// include: 'westus', 'westeurope', 'southeastasia', 'eastus2',
 /// 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope',
 /// 'eastasia', 'australiaeast', 'brazilsouth', 'virginia'
 /// </param>
 /// <param name='azureCloud'>
 /// Supported Azure Clouds for Cognitive Services endpoints. Possible values
 /// include: 'com', 'us'
 /// </param>
 /// <param name='appId'>
 /// The application ID.
 /// </param>
 /// <param name='userToAdd'>
 /// A model containing the user's email address.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <OperationStatus> AddAsync(this IPermissions operations, AzureRegions azureRegion, AzureClouds azureCloud, System.Guid appId, UserCollaborator userToAdd, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddWithHttpMessagesAsync(azureRegion, azureCloud, appId, userToAdd, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the list of user emails that have permissions to access your
 /// application.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='azureRegion'>
 /// Supported Azure regions for Cognitive Services endpoints. Possible values
 /// include: 'westus', 'westeurope', 'southeastasia', 'eastus2',
 /// 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope',
 /// 'eastasia', 'australiaeast', 'brazilsouth', 'virginia'
 /// </param>
 /// <param name='azureCloud'>
 /// Supported Azure Clouds for Cognitive Services endpoints. Possible values
 /// include: 'com', 'us'
 /// </param>
 /// <param name='appId'>
 /// The application ID.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <UserAccessList> ListAsync(this IPermissions operations, AzureRegions azureRegion, AzureClouds azureCloud, System.Guid appId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(azureRegion, azureCloud, appId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Removes a user from the allowed list of users to access this LUIS
 /// application. Users are removed using their email address.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='appId'>
 /// The application ID.
 /// </param>
 /// <param name='userToDelete'>
 /// A model containing the user's email address.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <OperationStatus> DeleteAsync(this IPermissions operations, System.Guid appId, UserCollaborator userToDelete, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.DeleteWithHttpMessagesAsync(appId, userToDelete, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Gets permissions.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='expand'>
 /// Expands related entities inline.
 /// </param>
 /// <param name='filter'>
 /// Filters the results, based on a Boolean condition.
 /// </param>
 /// <param name='select'>
 /// Selects which properties to include in the response.
 /// </param>
 /// <param name='orderby'>
 /// Sorts the results.
 /// </param>
 /// <param name='top'>
 /// Returns only the first n results.
 /// </param>
 /// <param name='skip'>
 /// Skips the first n results.
 /// </param>
 /// <param name='count'>
 /// Includes a count of the matching results in the response.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ODataValueIEnumerablePermissionDto> GetAsync(this IPermissions operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(expand, filter, select, orderby, top, skip, count, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        public LandingPageViewModel(INavigationService navigationService, IPermissions permissionsUtil)
            : base(navigationService)
        {
            _permissionsUtil = permissionsUtil;

            this.NavigateCommand = new DelegateCommand <string>(async(selection) => await ExecuteNavigateCommand(selection));
        }
Ejemplo n.º 11
0
        public LocationManager()
        {
            LocMgr = new CLLocationManager
            {
                PausesLocationUpdatesAutomatically = false
            };

            if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                LocMgr.RequestAlwaysAuthorization();
            }

            if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
            {
                LocMgr.AllowsBackgroundLocationUpdates = true;
            }

            _wasabeeApiV1Service = Mvx.IoCProvider.Resolve <WasabeeApiV1Service>();
            _preferences         = Mvx.IoCProvider.Resolve <IPreferences>();
            _loggingService      = Mvx.IoCProvider.Resolve <ILoggingService>();
            _permissions         = Mvx.IoCProvider.Resolve <IPermissions>();
            _userDialogs         = Mvx.IoCProvider.Resolve <IUserDialogs>();

            _loggingService.Trace("LocationManager Initialized");
        }
Ejemplo n.º 12
0
        private Task <bool> OnLoginComplete(Task <IUserV2> userFetchTask)
        {
            if (userFetchTask.IsFaulted)
            {
                RaiseAuthenticationStateChanged(AuthenticationStatus.AuthenticationFailed);
                return(Task.FromResult <bool>(false));
            }

            lock (lockObj)
            {
                this.CurrentUser = userFetchTask.Result;
            }


            string resource = $"user/me/permissions?{GetAccessTokenQueryString()}";

            return(this.client.Get(resource, this.CancellationToken, OAuthPermissions.FromJson)
                   .ContinueWith(t =>
            {
                if (t.IsFaulted)
                {
                    LogoutInternal();
                    RaiseAuthenticationStateChanged(AuthenticationStatus.AuthenticationFailed);

                    return false;
                }

                this.UserPermissions = t.Result;

                RaiseAuthenticationStateChanged(AuthenticationStatus.Authenticated);
                return true;
            }, this.CancellationToken, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default));
        }
Ejemplo n.º 13
0
 public SystemSettings(
     ICurrentActivity currentActivity,
     IPermissions permissions
     )
 {
     CurrentActivity = currentActivity;
     Permissions     = permissions;
 }
Ejemplo n.º 14
0
        public MainPageViewModel(IPermissions permissions, BaseExample example, IUserDialogs userDialogs)
        {
            _permissions = permissions;
            _example     = example;
            _userDialogs = userDialogs;

            ConnectCommand = new DelegateCommand(Connect);
        }
 public SandboxControlLink(ILink link, INode from, INode to, SandboxControl control, IKeyTableFactory tableFactory, IPrimFactory primFactory, IPermissions permissions)
     : base(link, from, to, control, permissions)
 {
     _control = control;
     _bufferedChanges = tableFactory.MakeKeyTable<double>();
     _dialog = new Dialog(control.HostPrim, primFactory, LINK_BUTTONS);
     _dialog.ResponseReceived += DialogPressed;
 }
Ejemplo n.º 16
0
        public static bool IsAuthorised(IPermissions permissions, ulong channel, ulong user, IEnumerable <IRole> roles)
        {
            bool c = permissions.Channels.Contains(Server.Channels.Any) || permissions.Channels.Contains(channel);
            bool u = permissions.Users.Contains(Server.Users.Any) || permissions.Users.Contains(user);
            bool r = permissions.Roles.Contains(Server.Roles.Any) || permissions.Roles.Any(i => roles.Any(role => role.Id == i));

            return(c && u && r);
        }
Ejemplo n.º 17
0
 private void Construct(
     ICoroutineRunner coroutineRunner,
     IPhotoGallery photoGallery,
     IPermissions permissions)
 {
     this.coroutineRunner = coroutineRunner;
     this.photoGallery    = photoGallery;
     this.permissions     = permissions;
 }
 public void Construct(
     ICameraCaptureSystem cameraCaptureSystem,
     IDatabase database,
     IPermissions permissions)
 {
     this.cameraCaptureSystem = cameraCaptureSystem;
     this.database            = database;
     this.permissions         = permissions;
 }
Ejemplo n.º 19
0
        public WelcomeViewModel(IPermissions permissionService, ISpeakerVerification verificationService)
        {
            _permissionService   = permissionService;
            _verificationService = verificationService;

            CheckAndGoTrainCommand  = new Command(async() => await CheckAndTrain());
            CheckAndGoVerifyCommand = new Command(async() => await CheckAndVerify());
            ClearCommand            = new Command(Clear);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Implementation
        /// </summary>
        public Media(IPermissions currentPermissions) : base(currentPermissions)
        {
            _Context           = Android.App.Application.Context;
            _IsCameraAvailable = _Context.PackageManager.HasSystemFeature(PackageManager.FeatureCamera);

            if (Build.VERSION.SdkInt >= BuildVersionCodes.Gingerbread)
            {
                _IsCameraAvailable |= _Context.PackageManager.HasSystemFeature(PackageManager.FeatureCameraFront);
            }
        }
Ejemplo n.º 21
0
        public ControlNode(INode n, IControlUtil control, IPermissions permissions)
            : base(n)
        {
            _control     = control;
            _permissions = permissions;
            _owner       = Parameters.Get <UUID>(Diagrams.Control.Impl.Module.Control.OwnerID);;

            OnWorldTouch  += Touched;
            OnWorldDelete += entity => OnDeleted();
        }
        public MainPageViewModel(IMedia media, IPermissions permissions, IPageDialogService pageDialogService, IPrintService printService)
        {
            _mediaService      = media;
            _permissionService = permissions;
            _pageDialogService = pageDialogService;
            _printService      = printService;

            OnPrintImageCommand = new DelegateCommand(PrintImage);
            OnPrintPDFCommand   = new DelegateCommand(PrintPDF);
        }
        public MainPageViewModel(INavigationService navigationService, IMedia mediaPlugin, IPermissions permissionsPlugin, IUserDialogs userDialogs)
            : base(navigationService)
        {
            _mediaPlugin       = mediaPlugin;
            _permissionsPlugin = permissionsPlugin;
            _userDialogs       = userDialogs;

            this.TakePictureCommand = new DelegateCommand(async() => await OnTakePictureAsync());
            this.PickPictureCommand = new DelegateCommand(async() => await OnPickPictureAsync());
        }
Ejemplo n.º 24
0
 public LocationService(IPermissions permissions, IGeolocator geolocator, IWorkManager workManager, ISettingStorage settingStorage, IVibrate vibrate,
                        ILocalNotifications localNotifications)
 {
     _permissions        = permissions;
     _geolocator         = geolocator;
     _workManager        = workManager;
     _settingStorage     = settingStorage;
     _vibrate            = vibrate;
     _localNotifications = localNotifications;
 }
Ejemplo n.º 25
0
        public TouchButton(MRMPrimFactory factory, string name, IPermissions permissions, params UUID[] ids)
        {
            _name = name;
            _factory = factory;
            _listeners = new List<EntityTouchedDelegate>();
            _permissions = permissions;

            foreach (var obj in ids.Select<UUID, IObject>(id => factory.GetIObject(id)))
                RegisterPrim(obj);
        }
Ejemplo n.º 26
0
        public ControlNode(INode n, IControlUtil control, IPermissions permissions)
            : base(n)
        {
            _control = control;
            _permissions = permissions;
            _owner = Parameters.Get<UUID>(Diagrams.Control.Impl.Module.Control.OwnerID); ;

            OnWorldTouch += Touched;
            OnWorldDelete += entity => OnDeleted();
        }
Ejemplo n.º 27
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (!Enabled)
            {
                base.OnActionExecuting(filterContext);
                return;
            }

            string    token = filterContext.HttpContext.Request["token"];
            JwtResult jwt   = JwtUtil.Decode(token);

            if (jwt.Success)
            {
                //获取当前登录用户
                IUser iUser = lessContext.GetService <IUser>();
                lessContext.CurrentUser = iUser.GetCurrentUser(lessContext);
                if (lessContext.CurrentUser == null)
                {
                    jwt.Success = false;
                    jwt.Msg     = $"获取登录帐号 {lessContext.Jwt.Result[BasicConst.JWT_USER].loginName} 信息失败,请重新登录!";
                    filterContext.HttpContext.Response.AddHeaderTimeOut();
                    filterContext.Result = new BaseJsonResult()
                    {
                        Data = jwt
                    };
                    return;
                }

                //获取当前站点
                var sysWebSiteDal = lessContext.GetService <SysWebSiteDal>();
                lessContext.WebSite = sysWebSiteDal.GetModel(filterContext.HttpContext.Request["SiteID"]);

                //获取权限
                IPermissions iPermissions = lessContext.GetService <IPermissions>();
                lessContext.Limit = iPermissions.GetPermissions(lessContext, filterContext.RequestContext.HttpContext.Request);

                base.OnActionExecuting(filterContext);
                return;
            }
            else
            {
                filterContext.HttpContext.Response.AddHeaderTimeOut();
                if (string.IsNullOrEmpty(WhenNotPassedRedirectUrl))
                {
                    filterContext.Result = new BaseJsonResult()
                    {
                        Data = jwt
                    };
                }
                else
                {
                    filterContext.Result = new RedirectResult(WhenNotPassedRedirectUrl);
                }
            }
        }
Ejemplo n.º 28
0
        public App(IPresentationFactory presentationFactory, IPermissions currentPermissions, IGeolocator geolocator)
        {
            PresentationFactory = presentationFactory;
            CurrentPermissions  = currentPermissions;
            Geolocator          = geolocator;

            var mainPage = new MainPage();

            InitializeComponent();
            MainPage = mainPage;
        }
Ejemplo n.º 29
0
        // Private Impl
        public void LogoutInternal()
        {
            lock (this.lockObj)
            {
                this.AccessToken     = null;
                this.CurrentUser     = null;
                this.UserPermissions = null;
            }

            RaiseAuthenticationStateChanged(AuthenticationStatus.Unauthenticated);
        }
Ejemplo n.º 30
0
        public TouchButton(MRMPrimFactory factory, string name, IPermissions permissions, params UUID[] ids)
        {
            _name        = name;
            _factory     = factory;
            _listeners   = new List <EntityTouchedDelegate>();
            _permissions = permissions;

            foreach (var obj in ids.Select <UUID, IObject>(id => factory.GetIObject(id)))
            {
                RegisterPrim(obj);
            }
        }
Ejemplo n.º 31
0
 public BLEService(IBluetoothLE bluetoothLe, IAdapter adapter, IPermissions permission)
 {
     Adapter     = adapter;
     BluetoothLE = bluetoothLe;
     Permission  = permission;
     BluetoothLE.StateChanged     += BluetoothLE_StateChanged;
     Adapter.DeviceDiscovered     += Adapter_DeviceDiscovered;
     Adapter.ScanTimeoutElapsed   += Adapter_ScanTimeoutElapsed;
     Adapter.DeviceDisconnected   += Adapter_DeviceDisconnected;
     Adapter.DeviceConnectionLost += Adapter_DeviceConnectionLost;
     Adapter.DeviceConnected      += AdapterOnDeviceConnected;
 }
Ejemplo n.º 32
0
        public App(IPresentationFactory presentationFactory, IPermissions currentPermissions, IGeolocator geolocator, IClipboard clipboard, IInAppNotification inAppNotification)
        {
            PresentationFactory = presentationFactory;
            CurrentPermissions  = currentPermissions;
            Geolocator          = geolocator;
            Clipboard           = clipboard;
            InAppNotification   = inAppNotification;

            var mainPage = new MainPage();

            InitializeComponent();
            MainPage = mainPage;
        }
 public SettingsViewModel(IVersionTracking versionTracking, IPermissions permissions, IUserDialogs userDialogs,
                          IPreferences preferences, IMvxMessenger messenger, ISecureStorage secureStorage, ILoginProvider loginProvider,
                          IFirebaseService firebaseService)
 {
     _versionTracking = versionTracking;
     _permissions     = permissions;
     _userDialogs     = userDialogs;
     _preferences     = preferences;
     _messenger       = messenger;
     _secureStorage   = secureStorage;
     _loginProvider   = loginProvider;
     _firebaseService = firebaseService;
 }
Ejemplo n.º 34
0
        private void ThrowDeezerError(IError error)
        {
            if (error.Code == 200 ||       //200 == Logout fail
                error.Code == 300)         //300 == Authentication error
            {
                //We've got an invalid/expired auth code -> auto logout + clear internals
                iSession.Logout();
                iPermissions = null;
                iUser        = null;
            }

            throw new DeezerException(error);
        }
Ejemplo n.º 35
0
        public static bool HasPermission(IPrincipal user, IPermissions permissions)
        {
            ArtGalleryDBContext db = new ArtGalleryDBContext();
            IUserDal userDal = new UserDal(db);

            var currentUser = GetCurrentUser(userDal, user);

            if (currentUser != null && currentUser.Permissions!=null)
            {

                if (currentUser.Permissions.Contains(permissions.Values))
                    return true;
            }

            return false;
        }
Ejemplo n.º 36
0
        public TouchButton(MRMPrimFactory factory, string name, IPermissions permissions)
        {
            _name = name;
            _factory = factory;
            _listeners = new List<EntityTouchedDelegate>();
            _permissions = permissions;

            factory.OnButtonRegistered += (id, registeredName) => {
                if (registeredName.Equals(name))
                    RegisterPrim(factory.GetIObject(id));
            };
            if (factory.ButtonPrims.ContainsKey(name)) {
                IEnumerable<UUID> objects = factory.ButtonPrims[Name].ToArray();
                foreach (var obj in objects.Select<UUID, IObject>(id => factory.GetIObject(id)))
                    RegisterPrim(obj);
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PagePermissionForumModule"/> class.
 /// </summary>
 /// <param name="permissions">
 /// The permissions.
 /// </param>
 public PagePermissionForumModule([NotNull] IPermissions permissions)
 {
     this._permissions = permissions;
 }
Ejemplo n.º 38
0
 public SandboxControlEP(INode node, Vector3 pos, SandboxControl control, IConfig controlConfig, IPermissions permissions)
     : base(node, pos, control, permissions)
 {
 }
Ejemplo n.º 39
0
 public void PluginLoad(IBot BotHandler, IBotUI UIHandler, IPermissions PermissionsHandler)
 {
     Bot = BotHandler;
     PermissionsHandler.UseCommands();
 }
Ejemplo n.º 40
0
        public SettingsViewModel(IPermissions permissions,
                                 IGeofenceManager geofences,
                                 IUserDialogs dialogs,
                                 IViewModelManager viewModelMgr)
        {
            this.permissions = permissions;
            this.geofences = geofences;
            this.dialogs = dialogs;

            this.Menu = new Command(() => dialogs.ActionSheet(new ActionSheetConfig()
                .SetCancel()
                .Add("Add Geofence", async () => 
                    await viewModelMgr.PushNav<AddGeofenceViewModel>()
                )
                .Add("Use Default Geofences", async () => 
                {
                    var result = await dialogs.ConfirmAsync(new ConfirmConfig()
                        .UseYesNo()
                        .SetMessage("This will stop monitoring all existing geofences and set the defaults.  Are you sure you want to do this?"));

                    if (result)
                    {
                        geofences.StopAllMonitoring();
                        await Task.Delay(500);
                        geofences.StartMonitoring(new GeofenceRegion
                        {
                            Identifier = "FC HQ",
                            Center = new Position(43.6411314, -79.3808415),   // 88 Queen's Quay - Home
                            Radius = Distance.FromKilometers(1)
                        });
                        geofences.StartMonitoring(new GeofenceRegion
                        {
                            Identifier = "Close to HQ",
                            Center = new Position(43.6411314, -79.3808415),   // 88 Queen's Quay
                            Radius = Distance.FromKilometers(3)
                        });
                        geofences.StartMonitoring(new GeofenceRegion 
                        {
                            Identifier = "Ajax GO Station",
                            Center = new Position(43.8477697, -79.0435461),
                            Radius = Distance.FromMeters(500)
                        });
                        await Task.Delay(500); // ios needs a second to breathe when registering like this
                        this.RaisePropertyChanged("CurrentRegions");
                    }                
                })
                .Add("Stop All Geofences", async () => 
                {
                    var result = await dialogs.ConfirmAsync(new ConfirmConfig()
                        .UseYesNo()
                        .SetMessage("Are you sure wish to stop monitoring all geofences?"));

                    if (result)
                    {
                        this.geofences.StopAllMonitoring();
                        this.RaisePropertyChanged("CurrentRegions");
                    }
                })
            ));
            
            this.Remove = new Command<GeofenceRegion>(x =>
            {
                this.geofences.StopMonitoring(x);
                this.RaisePropertyChanged("CurrentRegions");
            });
        }
 public SandboxControlRouter(INode node, Vector3 pos, SandboxControl control, IPermissions permissions)
     : base(node, pos, control, permissions)
 {
 }
 /// <summary>
 /// Make a linked button. If a prim linked to the given root prim is called name then touching it will trigger the button.
 /// </summary>
 /// <param name="name">The name of the button.</param>
 /// <param name="id">The root primitive of the link set. Any children of this primitive with name 'name' will be listened to as a button.</param>
 /// <returns>A button object that allows listeners to be attached to the button.</returns>
 public IButton MakeButton(string name, IPermissions permissions, params UUID[] ids)
 {
     IButton button = new TouchButton(this, name, permissions, ids);
     _logger.Info("Made button " + name + " with " + button.Prims.Count() + " primitives.");
     return button;
 }
 /// <summary>
 /// Make a button tied to a specific name. Any primitives with the given name and the following script embedded in them will trigger this button when touched.
 /// </summary>
 /// <param name="name">The name of the button.</param>
 /// <returns>A button object that allows listeners to be attached to the button.</returns>
 public IButton MakeButton(string name, IPermissions permissions)
 {
     IButton button = new TouchButton(this, name, permissions);
     _logger.Info("Made button " + name + " with " + button.Prims.ToArray().Length + " primitives.");
     return button;
 }
 public SandboxControlNode(INode n, Vector3 pos, SandboxControl control, IPermissions permissions)
     : base(n, control, permissions)
 {
     _control = control;
 }