Inheritance: EventSelector
 public static PlaceReviewsFragment CreateNewInstance(Place place)
 {
     return new PlaceReviewsFragment {
         Place = place,
         Arguments = new Bundle ()
     };
 }
Exemple #2
0
    List<Place> doBFS(Place pathTarget)
    {
        Queue<Place> BFSQueue = new Queue<Place> ();
        BFSQueue.Enqueue (currentPlace);
        currentPlace.visited = true;
        Debug.Log ("Start point: " + currentPlace.placeName);
        while (BFSQueue.Count != 0) {
            Place cur = BFSQueue.Dequeue();
            Debug.Log ("Current place: " + cur.placeName);
            if(cur.placeName.Equals (pathTarget.placeName)){
                Debug.Log ("Done!");
                return retracePath(cur);
            }
            for (int i = 0; i < cur.adjacencies.Length; i++){
                if (!cur.adjacencies[i].visited) {
                    cur.adjacencies[i].visited =  true;
                    cur.adjacencies[i].prevPlace = cur;
                    BFSQueue.Enqueue (cur.adjacencies[i]);
                    Debug.Log ("  Neighbor of current place (being enqueued now): "+cur.adjacencies[i].placeName);
                }
            }
        }

        Debug.Log ("NO PATH FOUND - ERROR");
        return null;
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            _MapView = new MapView(new RectangleF(0, 0, View.Frame.Width, View.Frame.Height));
            _MapView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

            View.AddSubview(_MapView);

            var home = new Place()
            {
                Name = "Home",
                Description = "Boring Home Town",
                Latitude = 32.725410,
                Longitude = -97.320840,
            };

            var office = new Place()
            {
                Name = "Austin",
                Description = "Super Awesome Town",
                Latitude = 30.26710,
                Longitude = -97.744546,
            };

            _MapView.ShowRouteFrom(office, home);
        }
Exemple #4
0
    public override decimal MobilityRequired( Place place )
    {
      if ( place.Owner == this.Owner )//在自己的领土上移动不需要移动力
        return 0;

      return base.MobilityRequired( place );
    }
Exemple #5
0
        public Map(XmlElement map)
        {
            Row = int.Parse(map.GetAttribute("row"));
            Col = int.Parse(map.GetAttribute("col"));
            Places = new Place[Row, Col];
            PlaceIdToCoordinate = new Dictionary<int, Tuple<int, int>>();
            _MaxId = 0;

            for (int r = 0; r < Row; r++)
            {
                for (int c = 0; c < Col; c++)
                {
                    Places[r, c] = new None(0);
                }
            }

            foreach (XmlNode item in map.ChildNodes)
            {
                int r = int.Parse((item as XmlElement).GetAttribute("row"));
                int c = int.Parse((item as XmlElement).GetAttribute("col"));
                int id = int.Parse((item as XmlElement).GetAttribute("id"));
                NewInstanceFromXml(item, ref Places[r, c], id);
                PlaceIdToCoordinate.Add(id, new Tuple<int, int>(r, c));
                if (id > _MaxId)
                {
                    _MaxId = id;
                }
            }
        }
Exemple #6
0
 internal virtual Day CreateDay()
 {
     // TODO: Instantiate an appropriate concrete class.
     int[] click = {700,1000};
     Place hq = new Place(0.0, 0.0, "HQ", click);
     Day target = new Future(1, hq);
     return target;
 }
Exemple #7
0
 public int GetID(string country, string city, string street, int house, int flat)
 {
     Place place = new Place {city = city, country = country, house = house, street = street, flat = flat};
     if (!pr.Exist(place.idPlace)) {
         pr.Add(place);
     }
     return pr.GetId(place);
 }
        public void CreatePlace(Place place)
        {
            Log("Begin creating Place in database. Place object", place);

            DatabaseConnector.PushCommandToDatabase(sqlConnection, CommandList.Build_CreatePlaceCommand(place));

            Log("End creating Place in database. Place object", place);
        }
        public void UpdatePlaceInfo(Place place)
        {
            Log("Begin updating Place in database. Place object", place);

            DatabaseConnector.PushCommandToDatabase(sqlConnection, CommandList.Build_UpdatePlaceCommand(place));

            Log("End updating Place in database. Place object", place);
        }
 public static PlaceDetailsFragment NewInstance(Place place, Position position)
 {
     return new PlaceDetailsFragment {
         Place = place,
         Position = position,
         Arguments = new Bundle ()
     };
 }
Exemple #11
0
 public Activity(int _start, int _end, Place _place, string _type = "private")
 {
     //choose the place in a list / with the map. If it's not there, create it
     start = _start;
     end = _end;
     place = _place;
     type = _type;
 }
        private Place GetPlacesFromMongoPlaces(MongoPlace mongoPlace)
        {
            var place = new Place();
            place.PlaceId = mongoPlace.Id;
            place.Name = mongoPlace.Name;

            return place;
        }
Exemple #13
0
 public SPlaceExtended(HttpContextBase context, Place place, Culture culture = Culture.En)
     : base(context, place, culture)
 {
     Type = PlaceTypes.GetPlaceType(place.TypeId).GetName(culture);
     Description = place.GetDescription(culture);
     RegionId = place.RegionId;
     RegionName = place.Region.GetName(culture);
 }
Exemple #14
0
        public void WhenSavingItShouldDelegateToMongoAbstraction()
        {
            var place = new Place("fooBarBazQuux");

            _allPlaces.Save(place);

            _mongoDB.Verify(it => it.Save("places", place));
        }
Exemple #15
0
 internal static void NewInstanceFromXml(XmlNode detail, ref Place result, int id)
 {
     if (detail.Name != "Bank")
     {
         return;
     }
     result = new Bank(id);
 }
Exemple #16
0
 public Day(int _number, Place _map_hq)
 {
     number = _number;
     map_hq = _map_hq;
     l_activity = new List<Activity>();
     createDfaultActList();
     sortActivityList();
 }
Exemple #17
0
        internal static Place ToPlace(this JsonPlace jsonPlace)
        {
            if (jsonPlace == null) throw new ArgumentNullException("jsonPlace");

            var place = new Place
            {
                WoeId = jsonPlace.WoeId,
                Name = jsonPlace.Name,
                Language = jsonPlace.Language,
                Uri = jsonPlace.Uri,
                Center = jsonPlace.Center,
                BoundingBox = jsonPlace.BoundingBox,
                AreaRank = jsonPlace.AreaRank,
                PopulationRank = jsonPlace.PopulationRank,
                Postal = jsonPlace.Postal,
                Type = (jsonPlace.Type != null || !string.IsNullOrWhiteSpace(jsonPlace.TypeName)) ? new PlaceType
                {
                    Name = jsonPlace.TypeName,
                    Code = (jsonPlace.Type != null) ? jsonPlace.Type.Code : default(int),
                } : null,
                Country = (jsonPlace.Country != null || !string.IsNullOrWhiteSpace(jsonPlace.CountryName)) ? new Admin
                {
                    Name = jsonPlace.CountryName,
                    Code = (jsonPlace.Country != null) ? jsonPlace.Country.Code : null,
                    Type = (jsonPlace.Country != null) ? jsonPlace.Country.Type : null,
                } : null,
                Admin1 = (jsonPlace.Admin1 != null || !string.IsNullOrWhiteSpace(jsonPlace.Admin1Name)) ? new Admin
                {
                    Name = jsonPlace.Admin1Name,
                    Code = (jsonPlace.Admin1 != null) ? jsonPlace.Admin1.Code : null,
                    Type = (jsonPlace.Admin1 != null) ? jsonPlace.Admin1.Type : null,
                } : null,
                Admin2 = (jsonPlace.Admin2 != null || !string.IsNullOrWhiteSpace(jsonPlace.Admin2Name)) ? new Admin
                {
                    Name = jsonPlace.Admin2Name,
                    Code = (jsonPlace.Admin2 != null) ? jsonPlace.Admin2.Code : null,
                    Type = (jsonPlace.Admin2 != null) ? jsonPlace.Admin2.Type : null,
                } : null,
                Admin3 = (jsonPlace.Admin3 != null || !string.IsNullOrWhiteSpace(jsonPlace.Admin3Name)) ? new Admin
                {
                    Name = jsonPlace.Admin3Name,
                    Code = (jsonPlace.Admin3 != null) ? jsonPlace.Admin3.Code : null,
                    Type = (jsonPlace.Admin3 != null) ? jsonPlace.Admin3.Type : null,
                } : null,
                Locality1 = (jsonPlace.Locality1 != null || !string.IsNullOrWhiteSpace(jsonPlace.Locality1Name)) ? new Locality
                {
                    Name = jsonPlace.Locality1Name,
                    Type = (jsonPlace.Locality1 != null) ? jsonPlace.Locality1.Type : null,
                } : null,
                Locality2 = (jsonPlace.Locality2 != null || !string.IsNullOrWhiteSpace(jsonPlace.Locality2Name)) ? new Locality
                {
                    Name = jsonPlace.Locality2Name,
                    Type = (jsonPlace.Locality2 != null) ? jsonPlace.Locality2.Type : null,
                } : null,
            };

            return place;
        }
 protected void OnPlaceRightClicked(Place place)
 {
     MenuItem openPlace;
     MenuItem addToReserve;
     MenuItem removeFromReserve;
     MenuItem openReserve;
     Menu dropDown = new Menu ();
     openPlace = new MenuItem ("Открыть место");
     openPlace.Activated += (s,args) => {
         var dlg = new PlaceDlg (place.Id);
         dlg.Show();
         dlg.Run();
         dlg.Destroy();
     };
     openPlace.Show ();
     dropDown.Append (openPlace);
     if (planviewwidget1.CurrentReserve != null) {
         if (planviewwidget1.CurrentReserve.Places.Any(p=>p.Id==place.Id)) {
             removeFromReserve = new MenuItem ("Удалить из резерва");
             removeFromReserve.Activated += (s, args) => {
                 planviewwidget1.CurrentReserve.Places.Remove(
                     planviewwidget1.CurrentReserve.Places.Where(p=>p.Id==place.Id).Single()
                 );
                 OnReserveChanged(this,null);
             };
             dropDown.Append (removeFromReserve);
             removeFromReserve.Show ();
         }else{
             Polygon polygon = planviewwidget1.Floor.Polygons.Single (p => p.Place.Id == place.Id);
             if (polygon.Status == PlaceStatus.Vacant) {
                 addToReserve = new MenuItem ("Добавить в резерв");
                 addToReserve.Activated += (s, args) => {
                     planviewwidget1.CurrentReserve.Places.Add (place);
                     OnReserveChanged (this, null);
                 };
                 dropDown.Append (addToReserve);
                 addToReserve.Show ();
             }
         }
     } else {
         Reserve reserve;
         using (var tempUoW = UnitOfWorkFactory.CreateWithoutRoot ()) {
             reserve = tempUoW.Session.QueryOver<Reserve> ().Where(r=>r.Date>DateTime.Today).JoinQueryOver<Place>(r=>r.Places).Where(p=>p.Id==place.Id).SingleOrDefault ();
         }
         if (reserve!= null) {
             openReserve = new MenuItem ("Открыть резерв");
             openReserve.Activated += (s, args) => {
                 uow = UnitOfWorkFactory.CreateForRoot<Reserve>(reserve.Id);
                 planviewwidget1.CurrentReserve = uow.Root;
                 reserveDeleteButton.Sensitive=true;
                 OnReserveChanged (this, null);
             };
             dropDown.Append (openReserve);
             openReserve.Show ();
         }
     }
     dropDown.Popup ();
 }
        bool CharIsHyperlink(Place place)
        {
            var mask = fctb.GetStyleIndexMask(new Style[] { blueStyle });
            if (place.iChar < fctb.GetLineLength(place.iLine))
                if ((fctb[place].style & mask) != 0)
                    return true;

            return false;
        }
Exemple #20
0
 public SPlace(HttpContextBase context, Place place, Culture culture = Culture.En)
 {
     Id = place.Id;
     Name = place.GetName(culture);
     Rating = place.Rating;
     X = place.X;
     Y = place.Y;
     Image = DefineImagePath(context, place.Image);
 }
 public PlaceDetailWindow (Place place, EventHandler OnSave, Gtk.Window parent) :  base(Gtk.WindowType.Toplevel)
 {
     this.Build ();
     this.Modal = true;
     this.OnSaved = OnSave;
     this.TransientFor = parent;
     show.Place = place;
     show.IsEditable = false;
 }
Exemple #22
0
        public static object GetValue(Type type, string strValue)
        {
            bool isNullable = false;

            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
            {
                isNullable = true;

                type = type.GetGenericArguments()[0];
            }

            object result;

            if (type.IsEnum)
            {
                result = Enum.Parse(type, strValue);
            }
            else if (type == typeof(Place))
            {
                var placeParts = strValue.Split(',');
                var place = new int[4];

                for (int i = 0; i < placeParts.Length; i++)
                {
                    place[i] = Convert.ToInt32(placeParts[i] ?? "0");
                }

                result = new Place(place[0], place[1], place[2], place[3]);
            }
            else if (type == typeof(Guid))
            {
                result = new Guid(strValue);
            }
            else if (type == typeof(bool))
            {
                if (strValue.Length == 1)
                    result = strValue[0] == '1';
                else
                    result = bool.Parse(strValue);
            }
            else if (type == typeof(string))
            {
                result = strValue;
            }
            else if (type.IsValueType)
            {
                result = Convert.ChangeType(strValue, type);
            }
            else
            {
                throw new InvalidOperationException();
            }

            if (isNullable) return Activator.CreateInstance(typeof(Nullable<>).MakeGenericType(type), result);

            return result;
        }
 public PlaceDetailWindow (Place place, Gtk.Window parent) :  base(Gtk.WindowType.Toplevel)
 {
     this.Build ();
     this.Modal = true;
     this.TransientFor = parent;
     show.Place = place;
     show.IsEditable = false;
     show.HideActionButtons ();
 }
Exemple #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     int placeId = Convert.ToInt32(Request.QueryString["PlaceID"].ToString());
     place = BLLPlace.getPlaceByID(placeId)[0];
     if (!Page.IsPostBack)
     {
         PlaceName.Text = place.PlaceName;
     }
 }
Exemple #25
0
        public void ShouldDelegateFindByIdToTheWrapper()
        {
            var placeId = "42";
            var expectedPlace = new Place();
            _mongoDB.Setup(it => it.FindById<Place>("places", placeId)).Returns(expectedPlace);
            var actualPlace = _allPlaces.FindById(placeId);

            Assert.That(actualPlace, Is.SameAs(expectedPlace));
        }
Exemple #26
0
 public static RouteValueDictionary GetRVD(Place place)
 {
     var rvd = new RouteValueDictionary();
     //fill it
     rvd["Latitude"] = place.Latitude;
     rvd["Longitude"] = place.Longitude;
     rvd["EworkyId"] = place.EworkyId;
     rvd["FoursquareId"] = place.FoursquareId;
     return rvd;
 }
Exemple #27
0
 //constructor
 public Day(int _number, Place map_hq)
 {
     number = _number;
     Activity defaultAct = new Inside(0, 147, map_hq);
     for (int i = 0; i <= 147; i++) //24*6+4 -1 because no activity at 24:40
     {
         //create default activity
         l_activity[i] = defaultAct;
     }
 }
Exemple #28
0
 /**
  * Constructor based on the currentContent and a {@link Place}. All none {@link TableData} elements are filtered out of the current content list.
  * @param currentContent IList<IElement> containing all elements found between <tr> and </tr>.
  * @param place a {@link Place} in the table (caption, header, body or footer).
  */
 public TableRowElement(IList<IElement> currentContent, Place place)
 {
     // filter out none TD elements, discard others
     content = new List<HtmlCell>(currentContent.Count);
     foreach (IElement e in currentContent) {
         if (e is HtmlCell) {
             content.Add((HtmlCell) e);
         }
     }
     this.place = place;
 }
 void Log(String logMessage, Place place)
 {
     if (place != null)
     {
         _logger.Debug("{0}: ID = {1}, Address = {2}.", logMessage, place.Id, place.Address);
     }
     else
     {
         _logger.Debug("{0} is null.", logMessage);
     }
 }
 public PlaceDetailWindow (Case c, EventHandler OnSave, Gtk.Window parent) :  base(Gtk.WindowType.Toplevel)
 {
     this.Build ();
     this.Modal = true;
     this.OnSaved = OnSave;
     this.TransientFor = parent;
     Place p = new Place ();
     p.Case = c;
     show.Place = p;
     show.IsEditable = true;
 }
Exemple #31
0
        public void PlaceConstructor_CreateInstanceOfPlace_Place()
        {
            Place newPlace = new Place("Tokyo", "Japan", "This is the journal of the trip to Tokyo.");

            Assert.AreEqual(typeof(Place), newPlace.GetType());
        }
 public void Post([FromBody] Place place)
 {
     service.Insert(place);
 }
Exemple #33
0
        public IHttpActionResult Insert([FromBody] CrawPlaceViewModel[] cvmds)
        {
            try
            {
                foreach (CrawPlaceViewModel cvmd in cvmds)
                {
                    var pAddress  = _PlaceService.GetPlaceByAddress(cvmd.address);
                    var upAddress = _PlaceService.GetPlaceByAddress(convertToUnSign3(cvmd.address)); //unsigned UTF-8
                    var pName     = _PlaceService.GetPlace(cvmd.title);
                    var upName    = _PlaceService.GetPlace(convertToUnSign3(cvmd.title));            //unsigned UTF8

                    //if not exist add place with (sign/usigned) name/address tag  OR new address
                    if ((pName == null && upName == null && upAddress == null && pAddress == null) || (pAddress == null && upAddress == null))
                    {
                        PlaceKind pk = _PlaceKindService.GetPlaceKind(cvmd.category);
                        if (pk == null)
                        {
                            placeKind            = new PlaceKind();
                            placeKind.DateCreate = DateTime.Today;
                            string pkind = "";
                            switch (cvmd.category)
                            {
                            case "Nhà hàng": pkind = "Restaurant"; break;

                            case "Café": pkind = "Cafe"; break;

                            case "Khách sạn và chỗ ở": pkind = "Hotel"; break;

                            case "Mua sắm": pkind = "Market"; break;

                            case "Giáo dục": pkind = "Education"; break;

                            case "Du lịch": pkind = "Point_of_interested"; break;

                            case "Sức khỏe": pkind = "Health"; break;

                            case "Làm đẹp": pkind = "Spa"; break;

                            case "Giải trí": pkind = "Entertaiment"; break;

                            case "Cây xăng": pkind = "Gas"; break;

                            case "Các cây ATM": pkind = "ATM"; break;

                            case "Cuộc sống về đêm": pkind = "NightLife"; break;

                            case "Dịch vụ": pkind = "Service"; break;
                            }
                            placeKind.Kind        = pkind;
                            placeKind.Description = cvmd.category;
                            _PlaceKindService.CreatePlaceKind(placeKind);
                        }
                        place             = new Place();
                        place.Address     = cvmd.address;
                        place.Description = cvmd.description;
                        place.Facebook    = cvmd.facebook;
                        place.DateCreate  = DateTime.Today;
                        place.LastConfirm = DateTime.Today;
                        place.isEnable    = true;
                        place.Latitude    = cvmd.gps.latitude;
                        place.Longitude   = cvmd.gps.longitude;
                        place.Name        = cvmd.title;
                        place.PageUrl     = cvmd.url;
                        place.PhoneNumber = cvmd.phone;
                        place.RatingStar  = cvmd.rating;
                        place.ServeStatus = 1; //active
                        place.UserId      = 0; //admin
                        place.RootPlaceId = 0; //VietNam
                        place.TimeOpen    = 0000;
                        place.PlaceKindId = _PlaceKindService.GetPlaceKind(cvmd.category).Id;
                        place.PlaceKind   = pk;
                        place.TimeClose   = 0000;
                        place.ZoomSize    = "16";
                        place.NofSearch   = 0;
                        place.Promote     = 0;

                        place.Poppular = (100 - pk.Priority) * 100 + (place.RatingStar * 10) + place.Promote;

                        place.Definition = convertToUnSign3(cvmd.title + " " + cvmd.address);
                        _PlaceService.CreatePlace(place);


                        Image img = _ImageService.GetImage(cvmd.img_big);
                        if (img == null)
                        {
                            image             = new Image();
                            image.ImageKindId = _ImageKindService.GetImageKind("Place").Id;
                            image.DateCreate  = DateTime.Today;
                            image.ImageKind   = _ImageKindService.GetImageKind(2);
                            image.OwnId       = _PlaceService.GetPlace(cvmd.title).Id;
                            image.Description = cvmd.title + " : " + cvmd.address;
                            image.Url         = cvmd.img_big;
                            _ImageService.CreateImage(image);
                        }
                        //break;//test: add only one none exist place in db
                    }
                }
            }
            catch (Exception e)
            {
                return(Content(HttpStatusCode.BadRequest, e.Message + " : " + e.InnerException + " : " + e.StackTrace + " : " + e.Data));
            }
            return(Ok());
        }
Exemple #34
0
 public void Set(Place pl, NeighborPosition.Position po)
 {
     place = pl;
     position.set(po);
 }
Exemple #35
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (Page.IsValid)
            {
                string country           = ddlCountry.SelectedValue;
                string language          = ddlLanguage.SelectedValue;
                string dateformat        = ddlDateFormat.SelectedValue;
                string currecy           = txtCurrency.Text.Replace("'", @"''");
                string homepage          = txtHomePageText.Text.Replace("'", @"''");
                string supplyChainLevels = txtSupplyChain.Text;
                string warningDays       = txtWarningDays.Text;
                string eligible          = txtEligible.Text;
                string defaulters        = txtDefaulters.Text;

                string prevcountry = Configuration.GetConfigurationByName("Country").Value;

                int           i = 0;
                Configuration o = new Configuration();
                o.Name  = "Country";
                o.Value = country;
                i       = Configuration.UpdateValues(o);
                if (country != "0" && prevcountry == "0")
                {
                    HealthFacility hf = HealthFacility.GetHealthFacilityById(1);
                    if (hf != null)
                    {
                        hf.Name = Country.GetCountryById(int.Parse(country)).Name;
                        HealthFacility.Update(hf);
                    }
                    if (Place.GetPlaceByParentId(0) == null)
                    {
                        Place p = new Place();
                        p.Name       = Country.GetCountryById(int.Parse(country)).Name;
                        p.ParentId   = 0;
                        p.Leaf       = false;
                        p.IsActive   = true;
                        p.Notes      = "";
                        p.ModifiedBy = 1;
                        p.ModifiedOn = DateTime.Today.Date;
                        Place.Insert(p);
                    }
                }

                o.Name  = "Language";
                o.Value = language;
                i       = Configuration.UpdateValues(o);

                o.Name  = "DateFormat";
                o.Value = dateformat;
                i       = Configuration.UpdateValues(o);

                o.Name  = "Currency";
                o.Value = currecy;
                i       = Configuration.UpdateValues(o);

                o.Name  = "HomePageText";
                o.Value = homepage;
                i       = Configuration.UpdateValues(o);

                o.Name  = "SupplyChainLevels";
                o.Value = supplyChainLevels;
                i       = Configuration.UpdateValues(o);

                o.Name  = "DefaultWarningDays";
                o.Value = warningDays;
                i       = Configuration.UpdateValues(o);

                o.Name = "LinkImmunizationwithStockManagement";
                if (rblLink.SelectedIndex == 0)
                {
                    o.Value = "1";
                }
                else
                {
                    o.Value = "0";
                }
                i = Configuration.UpdateValues(o);

                o.Name  = "EligibleForVaccination";
                o.Value = eligible;
                i       = Configuration.UpdateValues(o);

                o.Name  = "Defaulters";
                o.Value = defaulters;
                i       = Configuration.UpdateValues(o);

                if (i > 0)
                {
                    lblSuccess.Visible = true;
                    lblWarning.Visible = false;
                    lblError.Visible   = false;
                }
                else
                {
                    lblSuccess.Visible = false;
                    lblWarning.Visible = false;
                    lblError.Visible   = true;
                }
            }
        }
        catch (Exception ex)
        {
            lblSuccess.Visible = false;
            lblWarning.Visible = false;
            lblError.Visible   = true;
        }
    }
        public ActionResult Index()
        {
            List <Place> allPlaces = Place.GetAll();

            return(View(allPlaces));
        }
Exemple #37
0
 public IntroSection(string name, string title, Place place)
     : base(name, title, place)
 {
     _Tag = "IntroSection";
 }
Exemple #38
0
 public PraiseSection(string name, string title, Place place)
     : base(name, title, place)
 {
     _Tag = "PraiseSection";
 }
Exemple #39
0
 public void UnfreezePlace(Place p)
 {
     p.UnfreezeCallback(LastFrameTime);
     UniverseFrozen.Remove(p);
     UniverseLive.Add(p);
 }
 public void OpenChangePlaceDialog(Place place)
 {
     new PlaceInputWindow(ProxyCreationFacade, User, Logger, place).Show();
 }
Exemple #41
0
 public int Update(Place place)
 {
     throw new System.NotImplementedException();
 }
        public void Delete(int id)
        {
            Place place = service.SelectById(id);

            service.Delete(place);
        }
Exemple #43
0
        private SQLitePlace FromPlaceToSQLitePlace(Place place)
        {
            var sqlitePlace = new SQLitePlace
            {
                Id          = place.Id,
                Description = place.Description,
                Name        = place.Name,
                Version     = place.Version,
                Latitude    = place.Location.Latitude,
                Longitude   = place.Location.Longitude,

                Bank         = place.Bank,
                Bowl         = place.Bowl,
                Corners      = place.Corners,
                Curb         = place.Curb,
                Downhill     = place.Downhill,
                Gap          = place.Gap,
                Handrail     = place.Handrail,
                Hubba        = place.Hubba,
                Ledge        = place.Ledge,
                Manualpad    = place.Manualpad,
                OpenYourMind = place.OpenYourMind,
                Pyramid      = place.Pyramid,
                Rail         = place.Rail,
                Stairs       = place.Stairs,
                Wallride     = place.Wallride,
                UserId       = place.UserId
            };

            switch (place.Type)
            {
            case PlaceType.Skatepark:
                sqlitePlace.Type = 0;
                break;

            case PlaceType.Skatespot:
                sqlitePlace.Type = 1;
                break;

            default:
                sqlitePlace.Type = 2;
                break;
            }

            if (place.PhotosBase64List != null && place.PhotosBase64List.Count > 0)
            {
                sqlitePlace.Image1 = place.PhotosBase64List.ElementAt(0);
            }

            if (place.PhotosBase64List != null && place.PhotosBase64List.Count > 1)
            {
                sqlitePlace.Image2 = place.PhotosBase64List.ElementAt(1);
            }

            if (place.PhotosBase64List != null && place.PhotosBase64List.Count > 2)
            {
                sqlitePlace.Image3 = place.PhotosBase64List.ElementAt(2);
            }

            if (place.PhotosBase64List != null && place.PhotosBase64List.Count > 3)
            {
                sqlitePlace.Image4 = place.PhotosBase64List.ElementAt(3);
            }

            if (place.PhotosBase64List != null && place.PhotosBase64List.Count > 4)
            {
                sqlitePlace.Image5 = place.PhotosBase64List.ElementAt(4);
            }

            if (place.PhotosBase64List != null && place.PhotosBase64List.Count > 5)
            {
                sqlitePlace.Image5 = place.PhotosBase64List.ElementAt(5);
            }

            return(sqlitePlace);
        }
 public ActionResult DeleteAll()
 {
     Place.ClearAll();
     return(RedirectToAction("Index"));
 }
        public ActionResult Create(string cityName, string date, string entry)
        {
            Place myPlace = new Place(cityName, date, entry);

            return(RedirectToAction("Index"));
        }
Exemple #46
0
        public void PlaceConstructor_CreatesInstanceOfPlace_Place()
        {
            Place newPlace = new Place("Portland", 3, "A lot of bridges");

            Assert.AreEqual(typeof(Place), newPlace.GetType());
        }
        public ActionResult Show(int id)
        {
            Place foundPlace = Place.Find(id);

            return(View(foundPlace));
        }
Exemple #48
0
 public void Dispose()
 {
     Place.ClearAll();
 }
Exemple #49
0
        protected override void Seed(TicketsDemo.EF.TicketsContext context)
        {
            //This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method
            //  to avoid creating duplicate seed data. E.g.

            Func <List <Place> > placeGenerator = () =>
            {
                var    retIt  = new List <Place>();
                Random random = new Random();


                for (int i = 0; i < 100; i++)
                {
                    decimal randomNumber = random.Next(80, 120);
                    var     newPlace     = new Place()
                    {
                        Number = i, PriceMultiplier = randomNumber / 100
                    };
                    retIt.Add(newPlace);
                }
                return(retIt);
            };

            context.Trains.AddOrUpdate(
                t => t.Number,
                new Train
            {
                Number        = 90,
                StartLocation = "Kiev",
                EndLocation   = "Odessa",
                Carriages     = new List <Carriage>()
                {
                    new Carriage()
                    {
                        Places       = placeGenerator(),
                        Type         = CarriageType.SecondClassSleeping,
                        DefaultPrice = 100m,
                        Number       = 1,
                    }, new Carriage()
                    {
                        Places       = placeGenerator(),
                        Type         = CarriageType.SecondClassSleeping,
                        DefaultPrice = 100m,
                        Number       = 2,
                    }, new Carriage()
                    {
                        Places       = placeGenerator(),
                        Type         = CarriageType.FirstClassSleeping,
                        DefaultPrice = 120m,
                        Number       = 3,
                    }, new Carriage()
                    {
                        Places       = placeGenerator(),
                        Type         = CarriageType.FirstClassSleeping,
                        DefaultPrice = 130m,
                        Number       = 4,
                    }
                }
            },
                new Train
            {
                Number        = 720,
                StartLocation = "Kiev",
                EndLocation   = "Vinnitsa",
                Carriages     = new List <Carriage>()
                {
                    new Carriage()
                    {
                        Places       = placeGenerator(),
                        Type         = CarriageType.Sedentary,
                        DefaultPrice = 40m,
                        Number       = 1,
                    }, new Carriage()
                    {
                        Places       = placeGenerator(),
                        Type         = CarriageType.Sedentary,
                        DefaultPrice = 40m,
                        Number       = 2,
                    }, new Carriage()
                    {
                        Places       = placeGenerator(),
                        Type         = CarriageType.Sedentary,
                        DefaultPrice = 40m,
                        Number       = 3,
                    }
                }
            }

                );
        }
Exemple #50
0
 public Neighbor(Place pl, NeighborPosition.Position po)
 {
     Set(pl, po);
 }
 public void Post([FromBody] Place place)
 {
     _db.Places.Add(place);
     _db.SaveChanges();
 }
Exemple #52
0
 public ConsultMunicipalityIDCommand(Place _municipalityID)
 {
     this.municipalityID = _municipalityID;
 }
Exemple #53
0
        private void HandleClick(Vector2 position, bool remove = false)
        {
            if (entryLineMap == null)
            {
                return;
            }

            int moveSrcIdx = selectedEntry;    // Will be set if moving an entry
            int line       = (int)(position.y / questLogLabel.LineHeight);

            if (line < entryLineMap.Count)
            {
                selectedEntry = entryLineMap[line];
            }
            else
            {
                selectedEntry = entryLineMap[entryLineMap.Count - 1];
            }
            Debug.LogFormat("line is: {0} entry: {1}", line, selectedEntry);

            if (DisplayMode == JournalDisplay.ActiveQuests)
            {
                // Handle current quest clicks - ask if want to travel to last location for quest.
                Message questMessage = questMessages[selectedEntry];
                Debug.Log(questMessage.ParentQuest.QuestName);
                Place place = questMessage.ParentQuest.LastPlaceReferenced;
                if (place != null &&
                    !string.IsNullOrEmpty(place.SiteDetails.locationName) &&
                    place.SiteDetails.locationName != GameManager.Instance.PlayerGPS.CurrentLocation.Name)
                {
                    findPlaceName = place.SiteDetails.locationName;
                    if (DaggerfallUI.Instance.DfTravelMapWindow.CanFindPlace(place.SiteDetails.regionName, findPlaceName))
                    {
                        findPlaceRegion = DaggerfallUnity.Instance.ContentReader.MapFileReader.GetRegionIndex(place.SiteDetails.regionName);
                        string entryStr = string.Format("{0} in {1} province", findPlaceName, place.SiteDetails.regionName);
                        DaggerfallMessageBox dialogBox = CreateDialogBox(GetDialogText(entryStr, "selectedPlace", "confirmFind"));
                        dialogBox.OnButtonClick += FindPlace_OnButtonClick;
                        DaggerfallUI.UIManager.PushWindow(dialogBox);
                    }
                }
            }
            else
            {
                // Handle finished quest or notebook clicks - move, remove or add note.
                if (moveSrcIdx == NULLINT)
                {     // Process the click on or between entries
                    if (selectedEntry < 0)
                    { // Add a note between entries
                        EnterNote(selectedEntry);
                    }
                    else
                    {   // Move or remove when click on entry
                        TextFile.Token[] entry = GetEntry(selectedEntry);
                        if (entry != null && entry.Length > 0)
                        {
                            DaggerfallMessageBox dialogBox = CreateDialogBox(GetDialogText(entry[0].text, "selectedEntry", remove ? "confirmRemove" : "confirmMove"));
                            if (remove)
                            {
                                dialogBox.OnButtonClick += RemoveEntry_OnButtonClick;
                            }
                            else
                            {
                                dialogBox.OnButtonClick += MoveEntry_OnButtonClick;
                            }
                            DaggerfallUI.UIManager.PushWindow(dialogBox);
                        }
                    }
                }
                else
                {   // Move the selected entry to this position
                    if (selectedEntry < 0)
                    {
                        selectedEntry = -selectedEntry + currentMessageIndex;
                    }
                    MoveEntry(moveSrcIdx, selectedEntry);
                    lastMessageIndex = NULLINT;
                    selectedEntry    = NULLINT;
                }
            }
        }
 public int Add(Place place)
 {
     count++;
     return(list.Add(place));
 }
Exemple #55
0
        static void SelectStream(IEditor editor, ILine line, bool right, Point caretOld, Point caretNew)
        {
            Point first, last;

            if (editor != null && editor.SelectionExists || line != null && line.SelectionSpan.Length > 0)
            {
                Place place;
                if (line == null)
                {
                    place = editor.SelectionPlace;
                }
                else
                {
                    var span = line.SelectionSpan;
                    place = new Place(span.Start, 0, span.Start + span.Length - 1, 0);
                }

                if (right)
                {
                    if (place.Last == new Point(caretNew.X - 1, caretNew.Y))
                    {
                        // vanish selection
                        first = last = new Point(-1, -1);
                    }
                    else if (caretOld != place.First)
                    {
                        // expand selection
                        first = place.First;
                        last  = new Point(caretNew.X - 1, caretNew.Y);
                    }
                    else if (caretNew.Y > place.Last.Y || caretNew.Y == place.Last.Y && caretNew.X > place.Last.X)
                    {
                        // invert selection
                        first = new Point(place.Last.X + 1, place.Last.Y);
                        last  = new Point(caretNew.X - 1, caretNew.Y);
                    }
                    else
                    {
                        // reduce selection
                        first = caretNew;
                        last  = place.Last;
                    }
                }
                else
                {
                    if (place.First == caretNew)
                    {
                        // vanish selection
                        first = last = new Point(-1, -1);
                    }
                    else if (place.Last != new Point(caretOld.X - 1, caretOld.Y))
                    {
                        // expand selection
                        first = caretNew;
                        last  = place.Last;
                    }
                    else if (caretNew.Y < place.First.Y || caretNew.Y == place.First.Y && caretNew.X < place.First.X)
                    {
                        // invert selection
                        first = caretNew;
                        last  = new Point(place.First.X - 1, place.First.Y);
                    }
                    else
                    {
                        // reduce selection
                        first = place.First;
                        last  = new Point(caretNew.X - 1, caretNew.Y);
                    }
                }
            }
            else
            {
                // start selection
                if (right)
                {
                    first = caretOld;
                    last  = new Point(caretNew.X - 1, caretNew.Y);
                }
                else
                {
                    first = caretNew;
                    last  = new Point(caretOld.X - 1, caretOld.Y);
                }
            }

            // set/drop selection and set the caret
            if (line == null)
            {
                editor.GoTo(caretNew.X, caretNew.Y);
                if (first.Y >= 0)
                {
                    editor.SelectText(first.X, first.Y, last.X, last.Y);
                }
                else
                {
                    editor.UnselectText();
                }
                editor.Redraw();
            }
            else
            {
                line.Caret = caretNew.X;
                if (first.Y >= 0)
                {
                    line.SelectText(first.X, last.X + 1);
                }
                else
                {
                    line.UnselectText();
                }
            }
        }
Exemple #56
0
 public static bool IsPlaying(Team tm, Place p)
 {
     return(p.Player != null && tm.Tactics[0].Places.Exists(o => o.Player != null && o.Player.Id == p.Player.Id));
 }
Exemple #57
0
 public List <Place> GetAll(DynamicDictionary parameters)
 {
     return(Place.GetAll());
 }
Exemple #58
0
        public override void execute()
        {
            DAOPlace daoplace = new DAOPlace();

            answer = daoplace.consultMunicipalityID(municipalityID);
        }
 public void Put(int id, [FromBody] Place place)
 {
     place.PlaceId = id;
     service.Update(place);
 }
Exemple #60
0
 public CanticlesSection(string name, string title, Place place)
     : base(name, title, place)
 {
     _Tag = "CanticlesSection";
 }