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

C# Location类代码示例

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

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



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

示例1: CreateNewMeeting

        public async Task CreateNewMeeting()
        {
            try
            {
                Microsoft.Graph.Event evt = new Microsoft.Graph.Event();

                Location location = new Location();
                location.DisplayName = tbLocation.Text;

                ItemBody body = new ItemBody();
                body.Content = tbBody.Text;
                body.ContentType = BodyType.Html;

                List<Attendee> attendees = new List<Attendee>();
                Attendee attendee = new Attendee();
                EmailAddress email = new EmailAddress();
                email.Address = tbToRecipients.Text;
                attendee.EmailAddress = email;
                attendee.Type = AttendeeType.Required;
                attendees.Add(attendee);

                evt.Subject = tbSubject.Text;
                evt.Body = body;
                evt.Location = location;
                evt.Attendees = attendees;

                DateTimeTimeZone dtStart = new DateTimeTimeZone();
                dtStart.TimeZone = TimeZoneInfo.Local.Id;
                DateTime dts = dtpStartDate.Value.Date + dtpStartTime.Value.TimeOfDay;
                dtStart.DateTime = dts.ToString();
                
                DateTimeTimeZone dtEnd = new DateTimeTimeZone();
                dtEnd.TimeZone = TimeZoneInfo.Local.Id;
                DateTime dte = dtpEndDate.Value.Date + dtpEndTime.Value.TimeOfDay;
                dtEnd.DateTime = dte.ToString();

                evt.Start = dtStart;
                evt.End = dtEnd;
                
                // log the request info
                sdklogger.Log(graphClient.Me.Events.Request().GetHttpRequestMessage().Headers.ToString());
                sdklogger.Log(graphClient.Me.Events.Request().GetHttpRequestMessage().RequestUri.ToString());

                // send the new message
                var createdEvent = await graphClient.Me.Events.Request().AddAsync(evt);

                // log the send and associated id
                sdklogger.Log("Meeting Sent : Id = " + createdEvent.Id);
            }
            catch (Exception ex)
            {
                sdklogger.Log("NewMeetingSend Failed: " + ex.Message);
                sdklogger.Log(ex.Message);
            }
            finally
            {
                // close the form
                Close();
            }
        }
开发者ID:desjarlais,项目名称:restfuloutlook,代码行数:60,代码来源:NewEventForm.cs


示例2: CreateBranching

		public static FlowBranching CreateBranching (FlowBranching parent, BranchingType type, Block block, Location loc)
		{
			switch (type) {
			case BranchingType.Exception:
			case BranchingType.Labeled:
			case BranchingType.Toplevel:
			case BranchingType.TryCatch:
				throw new InvalidOperationException ();

			case BranchingType.Switch:
				return new FlowBranchingBreakable (parent, type, SiblingType.SwitchSection, block, loc);

			case BranchingType.Block:
				return new FlowBranchingBlock (parent, type, SiblingType.Block, block, loc);

			case BranchingType.Loop:
				return new FlowBranchingBreakable (parent, type, SiblingType.Conditional, block, loc);

			case BranchingType.Embedded:
				return new FlowBranchingContinuable (parent, type, SiblingType.Conditional, block, loc);

			default:
				return new FlowBranchingBlock (parent, type, SiblingType.Conditional, block, loc);
			}
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:25,代码来源:flowanalysis.cs


示例3: NullableType

		public NullableType (TypeExpr underlying, Location l)
		{
			this.underlying = underlying;
			loc = l;

			eclass = ExprClass.Type;
		}
开发者ID:saga,项目名称:mono,代码行数:7,代码来源:nullable.cs


示例4: AStarNode

 public AStarNode(Location location, INode parent,
     decimal costFromStart, decimal costToGoal)
     : base(location, parent)
 {
     CostFromStart = costFromStart;
     CostToGoal = costToGoal;
 }
开发者ID:nabinnepal,项目名称:aStarSearch,代码行数:7,代码来源:AStarNode.cs


示例5: ReverseGeoCode

		public IEnumerable<GoogleAddress> ReverseGeoCode(Location location)
		{
			if (location == null)
				throw new ArgumentNullException("location");

			return ReverseGeoCode(location.Latitude, location.Longitude);
		}
开发者ID:Virtualhurst,项目名称:Geocoding.net,代码行数:7,代码来源:GoogleGeoCoder.cs


示例6: Comment

		public Comment(CommentType commentType, string comment, bool commentStartsLine, Location startPosition, Location endPosition)
			: base(startPosition, endPosition)
		{
			this.CommentType   = commentType;
			this.CommentText       = comment;
			CommentStartsLine = commentStartsLine;
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:7,代码来源:Comment.cs


示例7: HasAssignmentsVisitor

		public HasAssignmentsVisitor(string name, TypeReference type, Location startRange, Location endRange)
		{
			this.name = name;
			this.type = type;
			this.startRange = startRange;
			this.endRange = endRange;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:HasAssignmentsVisitor.cs


示例8: SearchStationViewModel

        public SearchStationViewModel(ITransportService transportService)
        {
            this.InitializeSearchStationCommand(transportService);
            this.Stations = new ObservableCollection<Station>();

            this.stationPosition = LocationBern;
        }
开发者ID:mmarkovic,项目名称:WpfBasics,代码行数:7,代码来源:SearchStationViewModel.cs


示例9: Token

 public Token(TokenId tokenId, string data, Location startLocation, Location endLocation)
 {
     _tokenId = tokenId;
     _data = data;
     _startLocation = startLocation;
     _endLocation = endLocation;
 }
开发者ID:yslib,项目名称:minimvc,代码行数:7,代码来源:Token.cs


示例10: CheckType

		public MessageCollection CheckType(TypeDefinition type, Runner runner)
		{
			MessageCollection messageCollection = new MessageCollection();

			foreach (MethodDefinition method in type.Methods)
			{
				if (!method.IsStatic)
				{
					return null;
				}
			}

			foreach (FieldDefinition field in type.Fields)
			{
				if (!field.IsStatic)
				{
					return null;
				}
			}
			
			foreach (MethodDefinition ctor in type.Constructors)
			{
				if (!ctor.IsStatic && (ctor.Attributes & MethodAttributes.Public) == MethodAttributes.Public)
				{
					Location location = new Location(type.Name, ctor.Name, 0);
					Message message = new Message(MessageString, location, MessageType.Error);
					messageCollection.Add(message);
				}
			}

			return messageCollection.Count > 0 ? messageCollection : null;
			
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:33,代码来源:AvoidConstructorsInStaticTypesRule.cs


示例11: window_Closed

        void window_Closed(object sender, EventArgs e)
        {
            String URL = window.getURL();
            Debug.WriteLine("URL: " + URL);

            Location location = new Location();

            if (this.mainPage.mainMap.TryViewportPointToLocation(this.mouseEvent.ViewportPoint, out location))
            {
                /* Success */
                Debug.WriteLine("Point (" + location.Longitude + "," + location.Latitude + ")");

                MapImage image = new MapImage(URL);
                Debug.WriteLine("yabai: " + URL);
                image.setLocation(location);
                image.draw(mainPage.mainMap);

                this.mapData = image;
            }
            else
            {
                /* Fails */
                Debug.WriteLine("Something wrong has happened in converting viewport to location.");
            }
        }
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:25,代码来源:MapImageMode.cs


示例12: addLocation

    private void addLocation()
    {
        try
        {
            lblMessage.Text = "";

            using (CCSEntities db = new CCSEntities())
            {
                Location newLocation = new Location(); // create a new food category with the specified name

                if (txtAddLocation.Text != "")
                {
                    newLocation.RoomName = txtAddLocation.Text;

                    db.Locations.Add(newLocation); // add the new food category record
                    db.SaveChanges();
                }
                else
                    lblMessage.Text = "You must specify a location";
            }
        }

        catch (Exception ex)
        {
            LogError.logError(ex);
            Response.Redirect("../errorpages/error.aspx");
        }
    }
开发者ID:WsuCS3750,项目名称:CCSInventory,代码行数:28,代码来源:default.aspx.cs


示例13: DebuggerTooltipControl

		public DebuggerTooltipControl(Location logicalPosition)
		{
			this.logicalPosition = logicalPosition;
			InitializeComponent();
			
			Loaded += new RoutedEventHandler(OnLoaded);
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:7,代码来源:DebuggerTooltipControl.xaml.cs


示例14: CreateNpc

        private static NonPlayerCharacter CreateNpc(ModelEnums.NpcType type, Race race, string name, Location location = null, int level = 1)
        {
            var npc = new NonPlayerCharacter()
            {
                Name = name,
                Type = type,
                Level = level,
                Race = race,
                Creature = race.Creature
            };
            npc.SetTag();

            if (location != null)
            {
                var now = DateTime.Now;

                var entryLocation = new EntryLocationCharacter
                {
                    EntryInto = now,
                    Arrival = now,
                    Location = location,
                    Character = npc
                };
                npc.EntryLocations.Add(entryLocation);
            }

            return npc;
        }
开发者ID:JuninZe,项目名称:akabow,代码行数:28,代码来源:SeedNpcs.cs


示例15: Add

        public static void Add(
            Connection connection,
            NetworkMessage outMessage,
            Location fromLocation,
            Location toLocation
            )
        {
            if (fromLocation.Y > toLocation.Y)
            { // north, for old x
                outMessage.AddByte((byte)ServerPacketType.MapSliceNorth);
                AddMapDescription(connection, outMessage, fromLocation.X - 8, toLocation.Y - 6, toLocation.Z, 18, 1);
            }
            else if (fromLocation.Y < toLocation.Y)
            { // south, for old x
                outMessage.AddByte((byte)ServerPacketType.MapSliceSouth);
                AddMapDescription(connection, outMessage, fromLocation.X - 8, toLocation.Y + 7, toLocation.Z, 18, 1);
            }

            if (fromLocation.X < toLocation.X)
            { // east, [with new y]
                outMessage.AddByte((byte)ServerPacketType.MapSliceEast);
                AddMapDescription(connection, outMessage, toLocation.X + 9, toLocation.Y - 6, toLocation.Z, 1, 14);
            }
            else if (fromLocation.X > toLocation.X)
            { // west, [with new y]
                outMessage.AddByte((byte)ServerPacketType.MapSliceWest);
                AddMapDescription(connection, outMessage, toLocation.X - 8, toLocation.Y - 6, toLocation.Z, 1, 14);
            }
        }
开发者ID:henriqueuller,项目名称:sharpot,代码行数:29,代码来源:MapSlicePacket.cs


示例16: ComputeText

 private string ComputeText(Location location)
 {
     var lineSpan = location.GetLineSpan();
     var start = location.SourceTree.GetText().Lines[lineSpan.StartLinePosition.Line].Start;
     var end = location.SourceTree.GetText().Lines[lineSpan.EndLinePosition.Line].End;
     return location.SourceTree.GetText().GetSubText(TextSpan.FromBounds(start, end)).ToString();
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:CallHierarchyDetail.cs


示例17: CursorIsJustBeforeChildEndElementEndTagAfterIndent

		public void CursorIsJustBeforeChildEndElementEndTagAfterIndent()
		{
			int line = 3;
			int column = 2;
			Location expectedLocation = new Location(column, line);
			Assert.AreEqual(expectedLocation, textEditor.Caret.Position);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:IndentChildElementEndTagAfterNewLineTypedTestFixture.cs


示例18: LocationFrm

        public LocationFrm(Location location)
        {
            InitializeComponent();
            this.location = location;

            tbName.Text = location.Name;
        }
开发者ID:Exomnius,项目名称:TogetherIsBetter,代码行数:7,代码来源:LocationFrm.xaml.cs


示例19: Index

 public ActionResult Index(Location location)
 {
     if (!ModelState.IsValid)
         return View(location);
     ViewBag.Success = "Done!!!";
     return View(location);
 }
开发者ID:Accesspay,项目名称:NgWebInfra,代码行数:7,代码来源:HomeController.cs


示例20: Assign

 private Assign(Location loc, string builtIn, LineId line)
     : base(line)
 {
     this.location = loc;
     this.value = null;
     this.builtIn = builtIn;
 }
开发者ID:michaelgwelch,项目名称:mbasic99,代码行数:7,代码来源:Assign.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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