• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Place类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Place的典型用法代码示例。如果您正苦于以下问题:C# Place类的具体用法?C# Place怎么用?C# Place使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Place类属于命名空间,在下文中一共展示了Place类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ViewDidLoad

        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);
        }
开发者ID:anujb,项目名称:MapWithRoutes,代码行数:27,代码来源:MapWithRouteViewController.cs


示例2: MobilityRequired

    public override decimal MobilityRequired( Place place )
    {
      if ( place.Owner == this.Owner )//在自己的领土上移动不需要移动力
        return 0;

      return base.MobilityRequired( place );
    }
开发者ID:Ivony,项目名称:HelloWorld,代码行数:7,代码来源:Worker.cs


示例3: doBFS

    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;
    }
开发者ID:jondutko,项目名称:Summer2014,代码行数:26,代码来源:Server.cs


示例4: Map

        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;
                }
            }
        }
开发者ID:halfdb,项目名称:MyMonopoly,代码行数:29,代码来源:Map.cs


示例5: CreateNewInstance

 public static PlaceReviewsFragment CreateNewInstance(Place place)
 {
     return new PlaceReviewsFragment {
         Place = place,
         Arguments = new Bundle ()
     };
 }
开发者ID:RobGibbens,项目名称:Coffee-Filter,代码行数:7,代码来源:PlaceReviewsFragment.cs


示例6: CreateDay

 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;
 }
开发者ID:RxnDbr,项目名称:PI_Mars,代码行数:8,代码来源:DayTest.cs


示例7: NewInstanceFromXml

 internal static void NewInstanceFromXml(XmlNode detail, ref Place result, int id)
 {
     if (detail.Name != "Bank")
     {
         return;
     }
     result = new Bank(id);
 }
开发者ID:halfdb,项目名称:MyMonopoly,代码行数:8,代码来源:PlaceWithEvent.cs


示例8: SPlaceExtended

 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);
 }
开发者ID:Reidan94,项目名称:ITouristDashboard,代码行数:8,代码来源:SPlace.cs


示例9: WhenSavingItShouldDelegateToMongoAbstraction

        public void WhenSavingItShouldDelegateToMongoAbstraction()
        {
            var place = new Place("fooBarBazQuux");

            _allPlaces.Save(place);

            _mongoDB.Verify(it => it.Save("places", place));
        }
开发者ID:hammernight,项目名称:Garcom,代码行数:8,代码来源:AllPlacesSpec.cs


示例10: UpdatePlaceInfo

        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);
        }
开发者ID:Bot32,项目名称:MeetGenerator,代码行数:8,代码来源:PlaceRepository.cs


示例11: Day

 public Day(int _number, Place _map_hq)
 {
     number = _number;
     map_hq = _map_hq;
     l_activity = new List<Activity>();
     createDfaultActList();
     sortActivityList();
 }
开发者ID:RxnDbr,项目名称:PI_Mars,代码行数:8,代码来源:Day.cs


示例12: Activity

 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;
 }
开发者ID:RxnDbr,项目名称:PI_Mars,代码行数:8,代码来源:Activity.cs


示例13: GetID

 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);
 }
开发者ID:m13oas,项目名称:DevSchool,代码行数:8,代码来源:PlaceController.cs


示例14: CreatePlace

        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);
        }
开发者ID:Bot32,项目名称:MeetGenerator,代码行数:8,代码来源:PlaceRepository.cs


示例15: GetPlacesFromMongoPlaces

        private Place GetPlacesFromMongoPlaces(MongoPlace mongoPlace)
        {
            var place = new Place();
            place.PlaceId = mongoPlace.Id;
            place.Name = mongoPlace.Name;

            return place;
        }
开发者ID:Team-Lawrencium,项目名称:AvalancheTesterDB,代码行数:8,代码来源:PlaceEntitiesController.cs


示例16: NewInstance

 public static PlaceDetailsFragment NewInstance(Place place, Position position)
 {
     return new PlaceDetailsFragment {
         Place = place,
         Position = position,
         Arguments = new Bundle ()
     };
 }
开发者ID:RobGibbens,项目名称:Coffee-Filter,代码行数:8,代码来源:PlaceDetailsFragment.cs


示例17: ToPlace

        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;
        }
开发者ID:Gaploid,项目名称:NGeo,代码行数:58,代码来源:JsonConverter.cs


示例18: OnPlaceRightClicked

 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 ();
 }
开发者ID:QualitySolution,项目名称:LeaseAgreement,代码行数:58,代码来源:MainWinMap.cs


示例19: PlaceDetailWindow

 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 ();
 }
开发者ID:monsterlabs,项目名称:HumanRightsTracker,代码行数:9,代码来源:PlaceDetailWindow.cs


示例20: SPlace

 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);
 }
开发者ID:Reidan94,项目名称:ITouristDashboard,代码行数:9,代码来源:SPlace.cs



注:本文中的Place类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PlaceHolder类代码示例发布时间:2022-05-24
下一篇:
C# PixelType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap