本文整理汇总了C#中Location类的典型用法代码示例。如果您正苦于以下问题:C# Location类的具体用法?C# Location怎么用?C# Location使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Location类属于命名空间,在下文中一共展示了Location类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例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);
}
}
示例3: NullableType
public NullableType (TypeExpr underlying, Location l)
{
this.underlying = underlying;
loc = l;
eclass = ExprClass.Type;
}
示例4: AStarNode
public AStarNode(Location location, INode parent,
decimal costFromStart, decimal costToGoal)
: base(location, parent)
{
CostFromStart = costFromStart;
CostToGoal = costToGoal;
}
示例5: ReverseGeoCode
public IEnumerable<GoogleAddress> ReverseGeoCode(Location location)
{
if (location == null)
throw new ArgumentNullException("location");
return ReverseGeoCode(location.Latitude, location.Longitude);
}
示例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;
}
示例7: HasAssignmentsVisitor
public HasAssignmentsVisitor(string name, TypeReference type, Location startRange, Location endRange)
{
this.name = name;
this.type = type;
this.startRange = startRange;
this.endRange = endRange;
}
示例8: SearchStationViewModel
public SearchStationViewModel(ITransportService transportService)
{
this.InitializeSearchStationCommand(transportService);
this.Stations = new ObservableCollection<Station>();
this.stationPosition = LocationBern;
}
示例9: Token
public Token(TokenId tokenId, string data, Location startLocation, Location endLocation)
{
_tokenId = tokenId;
_data = data;
_startLocation = startLocation;
_endLocation = endLocation;
}
示例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;
}
示例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.");
}
}
示例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");
}
}
示例13: DebuggerTooltipControl
public DebuggerTooltipControl(Location logicalPosition)
{
this.logicalPosition = logicalPosition;
InitializeComponent();
Loaded += new RoutedEventHandler(OnLoaded);
}
示例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;
}
示例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);
}
}