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

C# Station类代码示例

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

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



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

示例1: AddRef

 /// <summary>
 /// Create and remember a reference to an Instance.
 /// </summary>
 /// <param name="instance"></param>
 /// <param name="station">station to which this instance belongs</param>
 /// <returns>new instance reference</returns>
 public InstanceRef AddRef(Instance instance, Station station)
 {
     long id = NextId();
     InstanceRef iRef = new InstanceRefImpl(id, instance, station);
     refs.Add(id, iRef);
     return iRef;
 }
开发者ID:jblindberg,项目名称:Clouseau,代码行数:13,代码来源:InstanceMemory.cs


示例2: setUp

        public void setUp()
        {
            station = new Station();

            station.Input = Inputs.Ant_Two;
            station.VirtualChannel = 67;
        }
开发者ID:nirvdrum,项目名称:btv_myhd_connector,代码行数:7,代码来源:StationTest.cs


示例3: TestHandoverEventActionCallHandover

        public void TestHandoverEventActionCallHandover()
        {
            int dropped = 0;
            int createdhandover = 0;
            int createdend = 0;

            var data = new CallData( 1, 5, 20, 0 );
            var tostation = new Station( 1, 0, 10, 10 );

            var fromstation = new Station( 1, 0, 0, 10 );
            fromstation.ClaimChannel( true );

            var e = new HandoverEvent(
                fromstation,
                tostation,
                () => { dropped++; },
                ( d, cd ) => { createdend++; },
                ( d, cd ) =>
                {
                    createdhandover++;
                    Assert.AreEqual( data, cd );
                    Assert.AreEqual( (uint) 15, d );
                },
                5,
                data );

            e.Action();

            Assert.AreEqual( 0, dropped );
            Assert.AreEqual( 0, createdend );
            Assert.AreEqual( 1, createdhandover );
        }
开发者ID:Zazcallabah,项目名称:Sysmod,代码行数:32,代码来源:HandoverEventTests.cs


示例4: CreateDeviceCollection

        /// <summary>
        /// 
        /// </summary>
        /// <param name="db"></param>
        /// <param name="s"></param>
        private static void CreateDeviceCollection(DB db, Station s)
        {
            DataTable tbl = db.GetDeviceDataTable ( s.ID );
            foreach (DataRow row in tbl.Rows)
            {
                Device d = new Device(s);
                d.ID = Convert.ToInt32(row["DeviceID"]);
                d.Name = row["name"].ToString().Trim();
                s.DeviceCollection.Add(d);

                //if (_request.IsReady())
                if (_client.IsRequestReady())
                {
                    object state = new object[] {
                        d.Station.Group.Name ,
                        d.Station.Name ,
                        d.Name };
                    //RequestResult r =  _request.Request("", RequestNameEnum.GetDeviceID, state);
                    RequestResult r = _client.ExecuteRequestDeviceID(state);
                    if (r.ResultEnum == RequestResultEnum.OK)
                    {
                        int remoteDeviceID = (int)r.Result;
                        d.RemoteID = remoteDeviceID;
                    }
                }
            }
        }
开发者ID:hkiaipc,项目名称:hunb,代码行数:32,代码来源:GroupFactory.cs


示例5: AddStation

 public Task AddStation(Station station)
 {
     var connection = _context.CreateConnection();
     var findedStation=connection.GetAsync<Station>(station.Id);
     if (findedStation == null) return Task.CompletedTask;
     return connection.InsertAsync(station);
 }
开发者ID:DrNorton,项目名称:TrineTimeTable,代码行数:7,代码来源:StationRepository.cs


示例6: TryGrowHub

        bool TryGrowHub(Station v, bool useHalfEdgesAsIdealR) {
            double oldR = v.Radius;
            double allowedRadius = CalculateAllowedHubRadius(v);
            Debug.Assert(allowedRadius > 0);
            if (v.Radius >= allowedRadius)
                return false;
            double idealR = useHalfEdgesAsIdealR ?
                                  CalculateIdealHubRadiusWithAdjacentEdges(metroGraphData, bundlingSettings, v) :
                                  v.cachedIdealRadius;

            Debug.Assert(idealR > 0);
            if (v.Radius >= idealR)
                return false;
            double step = 0.05;
            double delta = step * (idealR - v.Radius);
            if (delta < 1.0)
                delta = 1.0;

            double newR = Math.Min(v.Radius + delta, allowedRadius);
            if (newR <= v.Radius)
                return false;

            v.Radius = newR;
            return true;
        }
开发者ID:danielskowronski,项目名称:network-max-flow-demo,代码行数:25,代码来源:HubRadiiCalculator.cs


示例7: GetSites

        public List<Station> GetSites(string locationText)
        {
            var path = string.Format(
                "sl/realtid/GetSite.json?stationSearch={0}&key=72c26d46c3efc6d5158d1dfc89b5f6fd", locationText);
            var response = this.ApiClient.GetAsync(path).Result;

            if (!response.IsSuccessStatusCode)
            {
                return new List<Station>();
            }

            var result = response.Content.ReadAsStringAsync().Result;

            dynamic test = JsonConvert.DeserializeObject(result);
            var siteList = new List<Station>();

            var siteTest = test.Hafas.Sites.Site;
            if (siteTest.GetType().ToString() == "Newtonsoft.Json.Linq.JObject")
            {
                var site = new Station { Name = siteTest.Name, Id = siteTest.Number };
                siteList.Add(site);
            }
            else
            {
                foreach (var item in siteTest)
                {
                    var site = new Station { Name = item.Name, Id = item.Number };
                    siteList.Add(site);
                }
            }

            return siteList;
        }
开发者ID:parse,项目名称:valtechUH_api,代码行数:33,代码来源:StationRepository.cs


示例8: SetStations

        public void SetStations(Station[] InitialStationList)
        {
            this.InitialStationList = InitialStationList;

            FilterStations = InitialStationList.OrderByDescending(o => o.LastSeenDate).ToArray();
            StationList.VirtualListSize = FilterStations.Length;
        }
开发者ID:JackWangCUMT,项目名称:WiFiSpy,代码行数:7,代码来源:StationListControl.cs


示例9: NPCCorporation

        /// <summary>
        /// Initializes a new instance of the <see cref="NPCCorporation"/> class.
        /// </summary>
        /// <param name="station">The station.</param>
        /// <exception cref="System.ArgumentNullException">station</exception>
        public NPCCorporation(Station station)
        {
            station.ThrowIfNull(nameof(station));

            ID = station.CorporationID;
            Name = station.CorporationName;
        }
开发者ID:,项目名称:,代码行数:12,代码来源:


示例10: getStations

        public List<Station> getStations(Inputs input)
        {
            List<Station> ret = new List<Station>();

            RegistryManager registry = new RegistryManager();
            byte[] value = registry.getStations(input);

            int segmentLength = 40;
            int stationEndpoint = segmentLength * registry.getStationCount(input);
            for (int i = 8; i < stationEndpoint; i += segmentLength)
            {
                ArraySegment<byte> segment = new ArraySegment<byte>(value, i, segmentLength);

                Station s = new Station();
                s.Input = input;
                s.PhysicalChannel = BitConverter.ToInt16(segment.Array, segment.Offset + (int)StationBytePositions.PhysicalChannel);
                s.VirtualChannel = BitConverter.ToInt16(segment.Array, segment.Offset + (int)StationBytePositions.VirtualChannel);
                s.SubChannel = segment.Array[segment.Offset + (int)StationBytePositions.SubChannel];

                // TODO: (KJM 02/21/06) Figure out how to treat 0xFF as -1 rather than 255.
                int minorChannel = segment.Array[segment.Offset + (int)StationBytePositions.MinorChannel];
                if (255 == minorChannel)
                {
                    minorChannel = -1;
                }
                s.MinorChannel = minorChannel;

                // TODO: (KJM 02/21/06) Figure out a way of actually reading in the name without dying on channels without names.
                //s.Name = System.Text.Encoding.ASCII.GetString(segment.Array, segment.Offset + 16, 5);

                ret.Add(s);
            }

            return ret;
        }
开发者ID:nirvdrum,项目名称:btv_myhd_connector,代码行数:35,代码来源:StationManager.cs


示例11: SaveTimetables

        /// <summary>
        /// Create html file with information about timetable and save it
        /// </summary>
        /// <param name="Path">Where html file should be saved</param>
        /// <param name="station">Station</param>
        public void SaveTimetables(string Path, Station station)
        {
            FileStream fs = new FileStream(Path, FileMode.Create);

            XDocument document = new XDocument();
            document.AddFirst(new XElement("html"));

            document.Root.Add(new XElement("head",
                new XElement("title", station.Name)));

            XElement body = new XElement("body");
            XElement div = new XElement("div");
            foreach (Timetable tt in station)
            {
                XElement inner = new XElement("div", new XAttribute("style", "width:800px;"));
                inner.Add(new XElement("div", tt.FirstStation + " - " + tt.LastStation, new XAttribute("style", "border:solid; float:left; width:400px; heigth:20px;"), new XAttribute("align", "center")),
                    new XElement("div", tt.TimeOfArrival.ToString() + " - " + tt.TimeOfDeparture.ToString(), new XAttribute("style", "border:solid; float:left; width:150px; heigth:20px;"), new XAttribute("align", "center")),
                    new XElement("div", tt.FreqType, new XAttribute("style", "border:solid; float:left; width:150px; heigth:20px;"), new XAttribute("align", "center")),
                    new XElement("br"));
                div.Add(inner);
            }
            body.Add(div);
            document.Root.Add(body);

            document.Save(fs);
            fs.Close();
        }
开发者ID:alexssource,项目名称:Labs,代码行数:32,代码来源:LINQHTML.cs


示例12: StationIsCreatedAtProperPosition

        public void StationIsCreatedAtProperPosition()
        {
            var st = new Station( 0, 0, 2, 1 );

            Assert.AreEqual( (uint) 2, st.StartPosition );
            Assert.AreEqual( (uint) 3, st.EndPosition );
        }
开发者ID:Zazcallabah,项目名称:Sysmod,代码行数:7,代码来源:StationTests.cs


示例13: getLineTypeTo

 public Line.Type getLineTypeTo(Station station)
 {
     if ((line() == null || station.getLine() != line()))
         return Line.Type.None;
     else
         return line().type;
 }
开发者ID:v01pe,项目名称:ExplorativeDesign,代码行数:7,代码来源:Player.cs


示例14: AddExistingStationTest

 public void AddExistingStationTest()
 {
     Administration admin = new Administration();
     Station station = new Station("station1");
     admin.Add(station);
     Assert.AreEqual(station, admin.Add(station));
 }
开发者ID:grasmanek94,项目名称:t22-4,代码行数:7,代码来源:Administration_Test.cs


示例15: AddedStationCanBeFoundTest

 public void AddedStationCanBeFoundTest()
 {
     Administration admin = new Administration();
     Station station = new Station("station1");
     admin.Add(station);
     Station foundStation = admin.FindStation("station1");
     Assert.AreEqual(foundStation, station);
 }
开发者ID:grasmanek94,项目名称:t22-4,代码行数:8,代码来源:Administration_Test.cs


示例16: StationNameLong

 public void StationNameLong()
 {
     string longStationName = "He was a boy. She was a girl. Could I be anymore obvious? All around the world statues crumble for me."
     + "Why did this happen to me. I tried so hard, and got so far.But in the end it didn't even matter. I'm blue daba dee daba da. "
     + "Never gonna give you up. Never gonna let you down. What is love. Baby dont hurt me. Dont hurt me. No more.";
     Station station = new Station(longStationName);
     Assert.AreEqual(longStationName, station.StationName);
 }
开发者ID:grasmanek94,项目名称:t22-4,代码行数:8,代码来源:Station_Test.cs


示例17: NextStationTest

 public void NextStationTest()
 {
     Station station = new Station("test");
     Train nextTrain = new Train(1, 2);
     station.NextTrain = nextTrain;
     Assert.AreEqual(nextTrain, station.NextTrain);
     Assert.AreEqual(1, nextTrain.TrainUnit);
 }
开发者ID:grasmanek94,项目名称:t22-4,代码行数:8,代码来源:Station_Test.cs


示例18: LastStationTest

 public void LastStationTest()
 {
     Station station = new Station("test");
     Train lastTrain = new Train(1, 2);
     station.LastTrain = lastTrain;
     Assert.AreEqual(lastTrain, station.LastTrain);
     Assert.AreEqual(1, lastTrain.TrainUnit);
 }
开发者ID:grasmanek94,项目名称:t22-4,代码行数:8,代码来源:Station_Test.cs


示例19: CreateStation3

 private static Station CreateStation3() {
     var station = new Station("Stenungsund", "Snu");
     station.Add(new StationExit("Vänster"));
     station.Add(new StationExit("Höger"));
     station.Add(new StationTrack("1"));
     station.Add(new StationTrack("2"));
     return station;
 }
开发者ID:fjallemark,项目名称:TrainDispatch,代码行数:8,代码来源:TestDataFactory.cs


示例20: CreateStation2

 private static Station CreateStation2() {
     var station = new Station("Ytterby", "Yb");
     station.Add(new StationExit("Vänster"));
     station.Add(new StationExit("Höger"));
     station.Add(new StationTrack("1"));
     station.Add(new StationTrack("2"));
     return station;
 }
开发者ID:fjallemark,项目名称:TrainDispatch,代码行数:8,代码来源:TestDataFactory.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# StatisAnalysisSession类代码示例发布时间:2022-05-24
下一篇:
C# StaticVariable类代码示例发布时间: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