本文整理汇总了C#中Id类的典型用法代码示例。如果您正苦于以下问题:C# Id类的具体用法?C# Id怎么用?C# Id使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Id类属于命名空间,在下文中一共展示了Id类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RelayVariations
public RelayVariations(EventDB eventDB, Id<Course> courseId, int numberTeams, int numberLegs)
{
this.eventDB = eventDB;
this.courseId = courseId;
this.numberTeams = numberTeams;
this.numberLegs = numberLegs;
}
示例2: GetImageByGuid
public byte[] GetImageByGuid(string sGuid)
{
Id ID = new Id(sGuid);
IDocument doc = Factory.Document.FetchInstance(this._ceConn.objectStore, ID, null);
return null;
}
示例3: LoadNibResourceNamedOwner
public static bool LoadNibResourceNamedOwner(this NSBundle bundle, Type type, NSString resourceName, Id owner)
{
bool result = false;
Assembly assembly = type.Assembly;
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
{
if (stream != null)
{
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, (int)stream.Length);
stream.Close();
String fileName = Path.GetTempFileName();
File.WriteAllBytes(fileName, buffer);
NSNib nib = new NSNib(NSURL.URLWithString(fileName));
NSArray topLevelObjects;
result = nib.InstantiateNibWithOwnerTopLevelObjects(owner, out topLevelObjects);
nib.Release();
File.Delete(fileName);
}
}
return result;
}
示例4: CourseDesignator
// Create a course designator for a part
public CourseDesignator(Id<Course> course, int part)
{
Debug.Assert(part >= 0);
Debug.Assert(course.IsNotNone);
this.courseId = course;
this.part = part;
}
示例5: AddCourseControl
// Add a new course control to a course. Adds a new CourseControl referencing controlId into courseId. The place to insert is
// given by courseControl1 and courseControl2. These control should have been gotten by calling FindControlInsertionPoint.
public static Id<CourseControl> AddCourseControl(EventDB eventDB, Id<ControlPoint> controlId, Id<Course> courseId, Id<CourseControl> courseControl1, Id<CourseControl> courseControl2)
{
CourseControl newCourseControl;
Id<CourseControl> newCourseControlId;
// When adding a new course controls, they fit into variations fine because we are never adding or changing an split, just
// fitting into existing splits.
if (courseControl1.IsNone) {
// Adding at start.
Course course = (Course) eventDB.GetCourse(courseId).Clone();
Debug.Assert(courseControl2 == course.firstCourseControl);
newCourseControl = new CourseControl(controlId, course.firstCourseControl);
newCourseControlId = eventDB.AddCourseControl(newCourseControl);
course.firstCourseControl = newCourseControlId;
eventDB.ReplaceCourse(courseId, course);
}
else {
// Adding after courseControl1.
CourseControl before = (CourseControl) eventDB.GetCourseControl(courseControl1).Clone();
Debug.Assert(courseControl2 == before.nextCourseControl);
newCourseControl = new CourseControl(controlId, before.nextCourseControl);
newCourseControlId = eventDB.AddCourseControl(newCourseControl);
before.nextCourseControl = newCourseControlId;
eventDB.ReplaceCourseControl(courseControl1, before);
}
return newCourseControlId;
}
示例6: AddDimension
public void AddDimension(Id conceptId)
{
Contract.AssertNotNull(conceptId, "conceptId");
var dimension = KeyFamily.Dimensions.Find(conceptId);
dimensions.Add(conceptId, dimension);
}
示例7: Hierarchy
public Hierarchy(Id id, CodeRef root)
: this(id)
{
Contract.AssertNotNull(root, "root");
Root = root;
}
示例8: ComponentsOrderedAccordingToGenericParameterOrder
public void ComponentsOrderedAccordingToGenericParameterOrder()
{
#region Arrange
var expectedComponent0 = Guid.NewGuid();
var expectedComponents = new List<Object>
{
expectedComponent0
};
var id = new Id<Guid>(
expectedComponent0);
#endregion
#region Act
var actualComponents = id;
#endregion
#region Assert
actualComponents.Should().Equal(expectedComponents);
#endregion
}
示例9: ComponentsOrderedAccordingToGenericParameterOrder
public void ComponentsOrderedAccordingToGenericParameterOrder()
{
#region Arrange
var expectedComponent0 = Guid.NewGuid();
var expectedComponent1 = Guid.NewGuid().ToString();
var expectedComponent2 = DateTime.UtcNow;
var expectedComponents = new List<Object>
{
expectedComponent0,
expectedComponent1,
expectedComponent2
};
var id = new Id<Guid, String, DateTime>(
expectedComponent0,
expectedComponent1,
expectedComponent2);
#endregion
#region Act
var actualComponents = id;
#endregion
#region Assert
actualComponents.Should().Equal(expectedComponents);
#endregion
}
示例10: Initialize
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
base.Initialize();
//System.Reflection.Assembly.GetAssembly().CreateInstance("")
//// Tile
// for (int row = 0; row < 10; row++)
// {
// for (int column = 0; column < 10; column++)
// {
// var model = new Model("Models/tile");
// //model.Shader = "TCT";
// model.Position = new Vector3(row, column, 0);
// model.BoundingBox = new BoundingBox(new Vector3(row, 0, column), new Vector3(row*1.0f, 0.1f, row*column));
// var quad = new Quad("Textures/Harmony", new Color(((float)row) / 10.0f, ((float)column) / 10.0f, 0));
// GameObjectManager.AddGameObject("quad" + row + column, quad);
// quad.Position = new Vector3(row, -1.0f, -column);
// quad.Shader = "TCT";
// quad.Rotation = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), -((float)Math.PI)/2.0f);
// quad.Scale = new Vector3(1.0f);
// GameObjectManager.AddGameObject("tile" + row + column, model);
// }
// }
var model = new Model("Models/tile");
var id = new Id {Handle = "tile", Guid = GuidManager.NewGuid()};
ModelManager.AddModel(id, model);
//var quad = new Quad("Textures/harmony", Color.White);
//var id = new Id() {Handle = "quad", Guid = GuidManager.NewGuid()};
//GameObjectManager.AddGameObject(id, quad);
}
示例11: ComponentsOrderedAccordingToGenericParameterOrder
public void ComponentsOrderedAccordingToGenericParameterOrder()
{
#region Arrange
var expectedIdStringBuilder = new StringBuilder();
expectedIdStringBuilder.Append("fe67da762a214fa2b356d9e5da80edfc");
expectedIdStringBuilder.Append("|helloworld");
expectedIdStringBuilder.Append("|2342342343234");
expectedIdStringBuilder.Append("|0");
expectedIdStringBuilder.Append("|33");
expectedIdStringBuilder.Append("|a4bac0922c674c1b80016b680e31ba44");
var expectedIdString = expectedIdStringBuilder.ToString();
var id = new Id<Guid, String, DateTime, DayOfWeek,int,Guid>(expectedIdString);
#endregion
#region Act
var actualIdString = id.ToString();
#endregion
#region Assert
actualIdString.ShouldBeEquivalentTo(expectedIdString);
#endregion
}
示例12: PanelDirectoryDidChange
public void PanelDirectoryDidChange(Id sender, NSString path)
{
if (this.soundOnCheck.State > 0)
{
NSSound.SoundNamed("Frog").Play();
}
}
示例13: WriteXml
public void WriteXml(string filename, RelayVariations relayVariations, EventDB eventDB, Id<Course> courseId)
{
this.relayVariations = relayVariations;
this.eventDB = eventDB;
this.courseId = courseId;
this.modificationDate = DateTimeOffset.Now;
this.courseName = eventDB.GetCourse(courseId).name;
// Create the XML writer.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.Encoding = new UTF8Encoding(false);
xmlWriter = XmlWriter.Create(filename, settings);
WriteStart();
for (int teamNumber = 1; teamNumber < relayVariations.NumberOfTeams; ++teamNumber) {
WriteTeam(teamNumber);
}
WriteEnd();
// And done.
xmlWriter.Close();
eventDB = null;
xmlWriter = null;
}
示例14: SelectVariations
public SelectVariations(EventDB eventDB, Id<Course> courseId)
{
InitializeComponent();
this.eventDB = eventDB;
this.courseId = courseId;
Course course = eventDB.GetCourse(courseId);
if (course.relayTeams > 0)
lastTeam = course.relayTeams;
else
lastTeam = null;
comboBoxVariations.SelectedIndex = 0;
if (lastTeam.HasValue) {
upDownFirstTeam.Maximum = upDownLastTeam.Maximum = lastTeam.Value;
upDownFirstTeam.Minimum = upDownLastTeam.Minimum = 1;
upDownFirstTeam.Value = 1;
upDownLastTeam.Value = lastTeam.Value;
labelNumberOfTeams.Text = string.Format(labelNumberOfTeams.Text, lastTeam.Value);
}
UpdateControls();
}
示例15: CreateTextForControl
/// <summary>
/// Create the text version of a particular control point.
/// The distanceText parameter is used for finish, marked route end,
/// and other similar features, and be the distance, already rounded with "m" suffix. Use "" if none.
/// Custom text for the control or for symbols are taken into account.
/// </summary>
public string CreateTextForControl(Id<ControlPoint> controlId, string distanceText)
{
ControlPoint controlPoint = eventDB.GetControl(controlId);
// If there is custom text, just return it.
if (!string.IsNullOrEmpty(controlPoint.descriptionText))
return controlPoint.descriptionText;
string text;
switch (controlPoint.kind) {
case ControlPointKind.Normal:
text = CreateTextForNormalControl(controlPoint);
break;
case ControlPointKind.Start:
case ControlPointKind.MapExchange:
text = CreateTextForStartControl(controlPoint);
break;
case ControlPointKind.Finish:
case ControlPointKind.CrossingPoint:
text = CreateTextForDirective(controlPoint.symbolIds[0], distanceText);
break;
default:
Debug.Fail("bad control point kind"); text = ""; break;
}
return CapitalizeFirstLetter(text);
}