Exemplo n.º 1
0
 public LocationViewModel()
 {
     AddLocationCommand = new RelayCommand <object>((p) => { return(true); }, (p) =>
     {
         if (NewLocation.IsAnyFieldNull())
         {
             CustomDialog.ShowDialog("Có thông tin bỏ trống !", CustomDialog.Buttons.OK);
             return;
         }
         // Những địa điểm đã có trong DB
         var existingLocations = new HashSet <string>(from location in Locations select location.Name);
         // Kiểm tra địa điểm được thêm vào có trong DB chưa
         bool isExisted = existingLocations.Any(locationName => locationName == NewLocation.Name);
         if (!isExisted)
         {
             // Thêm vào địa điểm mới lên UI
             Locations.Add(NewLocation.Clone());
             NewLocation = new Location();
             return;
         }
         NewLocation = new Location();
         CustomDialog.ShowDialog("Địa điểm đã có !", CustomDialog.Buttons.OK);
     });
     ResetViewCommand = new RelayCommand <object>((p) => { return(true); }, (p) =>
     {
         ResetView();
     });
     SaveLocationsCommand = new RelayCommand <object>((p) => { return(true); }, (p) =>
     {
         DataAccess.UpdateAddLocations(Locations.ToList());
         CustomDialog.ShowDialog("Đã lưu dữ liệu thành công", CustomDialog.Buttons.OK);
         ResetView();
     });
     ResetView();
 }
Exemplo n.º 2
0
 public Quality(Mesh mesh)
 {
     this.logger      = SimpleLog.Instance;
     this.badsubsegs  = new Queue <BadSubseg>();
     this.queue       = new BadTriQueue();
     this.mesh        = mesh;
     this.behavior    = mesh.behavior;
     this.newLocation = new NewLocation(mesh);
 }
Exemplo n.º 3
0
        public override void EventCallback(string data)
        {
            string location = GetLocation(data);

            if (!string.IsNullOrEmpty(location))
            {
                //raise event
                NewLocation?.Invoke(location);
            }
        }
 public void Identify(RaycastHit hit)
 {
     if (hit.transform.CompareTag("Ground"))
     {
         NewLocation?.Invoke(hit.point);
     }
     else
     {
         InteractWithObject(hit.transform.gameObject);
     }
 }
        public static async Task <Location> AddLocation(NewLocation newLocation)
        {
            var jsonData            = newLocation.ToJson();
            var httpResponseMessage = await HttpUtils.MakeRequest(Constants.LocationListUrl, jsonData, HttpUtils.HttpMethod.Post);

            var responseData = await HttpUtils.ProcessResponse(httpResponseMessage);

            var location = JsonConvert.DeserializeObject <Location>(responseData);

            return(location);
        }
Exemplo n.º 6
0
        public string this[string columnName]
        {
            get
            {
                if (columnName == "NewTitle")
                {
                    if (string.IsNullOrEmpty(NewTitle.ToString()))
                    {
                        return("New title is required");
                    }
                }
                if (columnName == "NewLocation")
                {
                    if (string.IsNullOrEmpty(NewLocation.ToString()))
                    {
                        return("New location is required");
                    }
                }

                if (columnName == "EffectiveDate")
                {
                    if (string.IsNullOrEmpty(EffectiveDate.ToString()))
                    {
                        return("Effective date is required");
                    }
                }

                if (columnName == "ApprovedBy")
                {
                    if (string.IsNullOrEmpty(ApprovedBy))
                    {
                        return("Approved by is required");
                    }
                }

                if (columnName == "TransferDate")
                {
                    if (string.IsNullOrEmpty(TransferDate.ToString()))
                    {
                        return("Transfer date is required");
                    }
                }
                if (columnName == "TransferReason")
                {
                    if (string.IsNullOrEmpty(TransferReason))
                    {
                        return("Transfer reason is required");
                    }
                }
                return(string.Empty);
            }
        }
Exemplo n.º 7
0
        public QualityMesher(Mesh mesh, Configuration config)
        {
            badsubsegs = new Queue <BadSubseg>();
            queue      = new BadTriQueue();

            this.mesh       = mesh;
            this.predicates = config.Predicates();

            this.behavior = mesh.behavior;

            newLocation = new NewLocation(mesh, predicates);

            newvertex_tri = new Triangle();
        }
Exemplo n.º 8
0
        private async void FbLoginButton_onClick(object sender, RoutedEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(
                new Uri(
                    "fbconnect://authorize?client_id=625784407575569&redirect_uri=msft-9cca4bcf684046e19596c45e910d77db://fbauth&scope=email"));

            var nl = new NewLocation
            {
                Latitude  = 23.390F,
                Longitude = 32.32F,
                Name      = "Test"
            };
            //await new Requests().AddLocation(nl);
        }
Exemplo n.º 9
0
        public QualityMesher(Mesh mesh, Configuration config)
        {
            logger = Log.Instance;

            badsubsegs = new Queue<BadSubseg>();
            queue = new BadTriQueue();

            this.mesh = mesh;
            this.predicates = config.Predicates();

            this.behavior = mesh.behavior;

            newLocation = new NewLocation(mesh, predicates);

            newvertex_tri = new Triangle();
        }
Exemplo n.º 10
0
        public QualityMesher(TriangleNetMesh triangleNetMesh, Configuration config)
        {
            logger = Log.Instance;

            badsubsegs = new Queue <BadSubseg>();
            queue      = new BadTriQueue();

            this._TriangleNetMesh = triangleNetMesh;
            this.predicates       = config.Predicates();

            this.behavior = triangleNetMesh.behavior;

            newLocation = new NewLocation(triangleNetMesh, predicates);

            newvertex_tri = new Triangle();
        }
        private void ContinueAddingNewLocation(object sender, RoutedEventArgs e)
        {
            if (!_firstAdded)
            {
                return;
            }

            var newLocation = new NewLocation
            {
                Name      = AddressBar.Text,
                Latitude  = (float)_newLocationIcon.Location.Position.Latitude,
                Longitude = (float)_newLocationIcon.Location.Position.Longitude
            };

            Frame.Navigate(typeof(NewLocationPage), newLocation);
        }
Exemplo n.º 12
0
        private async void AddNewLocation_Click(object sender, RoutedEventArgs e)
        {
            var newLocation = new NewLocation
            {
                Name        = LocationName.Text,
                Longitude   = Convert.ToSingle(Longitude.Text),
                Latitude    = Convert.ToSingle(Latitude.Text),
                IsFree      = IsFree.IsOn,
                Male        = IsForMale.IsOn,
                Female      = IsForFemale.IsOn,
                IsAnonymous = IsAnonymous.IsOn
            };

            ProgressRingGrid.Visibility = Visibility.Visible;
            CommandBar.Visibility       = Visibility.Collapsed;
            await Requests.AddLocation(newLocation);

            ProgressRingGrid.Visibility = Visibility.Collapsed;

            if (Frame.CanGoBack)
            {
                Frame.GoBack();
            }
        }
 protected void ChildInvokeNewLocation(Vector3 location) //special method to call from Child/Inherited Class, uses this/Parent event call
 {
     NewLocation?.Invoke(location);
 }
Exemplo n.º 14
0
        public override Task <Ok> UpdateLocation(NewLocation request, ServerCallContext context)
        {
            Console.WriteLine($"Roll {request.Roll} Pitch {request.Pitch} Yaw {request.Yaw}");

            return(Task.FromResult(new Ok()));
        }