本文整理汇总了C#中ComponentType类的典型用法代码示例。如果您正苦于以下问题:C# ComponentType类的具体用法?C# ComponentType怎么用?C# ComponentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComponentType类属于命名空间,在下文中一共展示了ComponentType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FunctionStart
internal unsafe void FunctionStart(string callerName,
int callerHash,
string method,
string parametersName,
int parametersHash,
ComponentType componentType)
{
const int SIZEDATA = 6;
fixed (char* arg1Ptr = callerName, arg2Ptr = method, arg3Ptr = parametersName)
{
EventData* dataDesc = stackalloc EventSource.EventData[SIZEDATA];
dataDesc[0].DataPointer = (IntPtr)arg1Ptr;
dataDesc[0].Size = (callerName.Length + 1) * sizeof(char); // Size in bytes, including a null terminator.
dataDesc[1].DataPointer = (IntPtr)(&callerHash);
dataDesc[1].Size = sizeof(int);
dataDesc[2].DataPointer = (IntPtr)(arg2Ptr);
dataDesc[2].Size = (method.Length + 1) * sizeof(char);
dataDesc[3].DataPointer = (IntPtr)(arg3Ptr);
dataDesc[3].Size = (parametersName.Length + 1) * sizeof(char);
dataDesc[4].DataPointer = (IntPtr)(¶metersHash);
dataDesc[4].Size = sizeof(int);
dataDesc[5].DataPointer = (IntPtr)(&componentType);
dataDesc[5].Size = sizeof(int);
WriteEventCore(FUNCTIONSTART_ID, SIZEDATA, dataDesc);
}
}
示例2: AddComponentsToSolution
/// <summary>
/// Adds the components to solution.
/// </summary>
/// <param name="sourceService">The source service.</param>
/// <param name="destinationService">The destination service.</param>
/// <param name="entityName">Name of the entity.</param>
/// <param name="solutionComponentType">Type of the solution component.</param>
/// <param name="componentType">Type of the component.</param>
/// <param name="destinationDataSourceElement">The destination data source element.</param>
/// <param name="context">The xrm activity context</param>
/// <param name="noOfThreads">The no of threads.</param>
/// <param name="checkManaged">
/// if set to <c>true</c> [check if component is managed and exclude from adding to the
/// solution].
/// </param>
public static void AddComponentsToSolution(string entityName,
SolutionPackageType solutionComponentType,
ComponentType componentType,
XrmActivityContext context,
bool checkManaged = true)
{
var columns = XrmMetadataHelperFunctions.GetNonSystemColumns(context.Source, entityName);
var sourceEntities = XrmHelperFunctions.RetrieveMultipleByEntityName(
context.Source,
entityName,
true,
columns);
var destinationEntities = XrmHelperFunctions.RetrieveMultipleByEntityName(
context.Destination,
entityName,
true,
columns);
AddComponentsToSolution(
sourceEntities,
destinationEntities,
solutionComponentType,
componentType,
context,
checkManaged);
}
示例3: Draw
// ComponentType to render
public static void Draw(GameTime gameTime, ComponentType RenderType)
{
// Update the time, create a temp list
Engine.GameTime = gameTime;
List<GameScreen> drawing = new List<GameScreen>();
// Clear the back buffer
GraphicsDevice.Clear(Color.Black);
// Populate the temp list if the screen is visible
foreach (GameScreen screen in GameScreens)
if (screen.Visible)
drawing.Add(screen);
// BlocksDraw and OverrideDrawBlocked logic
for (int i = GameScreens.Count - 1; i >= 0; i--)
if (GameScreens[i].BlocksDraw)
{
if (i > 0)
for (int j = i - 1; j >= 0; j--)
{
if (!GameScreens[j].OverrideDrawBlocked)
drawing.Remove(GameScreens[j]);
}
break;
}
// Draw the remaining screens
foreach (GameScreen screen in drawing)
if (screen.Initialized)
screen.Draw(RenderType);
}
示例4: Component
public Component(Vector2 center, ComponentType type)
{
this.myType = type;
this.currentState = ComponentState.notSelected;
this.Radius = 50.0f;
this.Center = center;
}
示例5: AddDradisComponentsControl
public AddDradisComponentsControl(ComponentType componentType)
{
InitializeComponent();
ComponentNameLabel.Text = componentType.ToString();
_componentType = componentType;
requestedNumberComboBox.SelectedIndex = 0;
}
示例6: Signal
public Signal(DateTime datetime, ComponentType sender, SignalType type, SignalSide side, double qty, double strategyPrice, Instrument instrument, string text)
: base()
{
this.BuyColor = Color.Blue;
this.BuyCoverColor = Color.SkyBlue;
this.SellColor = Color.Pink;
this.SellShortColor = Color.Red;
this.ToolTipEnabled = true;
this.ToolTipFormat = "dfdfs";
this.DateTime = datetime;
this.Sender = sender;
this.Type = type;
this.Side = side;
this.Qty = qty;
this.StrategyPrice = strategyPrice;
this.Instrument = instrument;
this.Price = this.Instrument.Price();
this.TimeInForce = TimeInForce.GTC;
this.Text = text;
this.Strategy = (Strategy)null;
this.Rejecter = ComponentType.Unknown;
this.StopPrice = 0.0;
this.LimitPrice = 0.0;
this.Status = SignalStatus.New;
}
示例7: TestRequest
protected static BootstrappingRequest TestRequest(
string path,
ComponentType ctype,
IEnumerable<CustomProperty> props)
{
return new BootstrappingRequest(path, ctype, new Guid(), new Guid(), string.Empty, string.Empty, string.Empty, props);
}
示例8: GetComputerComponents
public async Task<IEnumerable<ComponentsKey>> GetComputerComponents(string UnitID, ComponentType componentType)
{
await getJson();
switch (componentType)
{
case ComponentType.Graphic:
{
return computers.Where(x => x.UniqueId == UnitID).FirstOrDefault().Components.Graphic;
}
case ComponentType.Cpu:
{
return computers.Where(x => x.UniqueId == UnitID).FirstOrDefault().Components.Cpu;
}
case ComponentType.Memory:
{
return computers.Where(x => x.UniqueId == UnitID).FirstOrDefault().Components.Memory;
}
case ComponentType.Storage:
{
return computers.Where(x => x.UniqueId == UnitID).FirstOrDefault().Components.Storage;
}
default:
{
throw new Exception("ComponentType undefined");
}
}
}
示例9: Component
public Component(List<Member> members, List<Bearing> bearings, List<PlateConnector> plateConnectors, ComponentType componentType, string name = "")
{
this.Name = name;
this.Members = members;
this.Bearings = bearings;
this.PlateConnectors = plateConnectors;
}
示例10: ComponentTypeService_GetAsync_ReturnsComponentTypesByIds
public void ComponentTypeService_GetAsync_ReturnsComponentTypesByIds()
{
//Arrange
var mockDbContextScopeFac = new Mock<IDbContextScopeFactory>();
var mockDbContextScope = new Mock<IDbContextReadOnlyScope>();
var mockEfDbContext = new Mock<EFDbContext>();
mockDbContextScopeFac.Setup(x => x.CreateReadOnly(DbContextScopeOption.JoinExisting)).Returns(mockDbContextScope.Object);
mockDbContextScope.Setup(x => x.DbContexts.Get<EFDbContext>()).Returns(mockEfDbContext.Object);
var dbEntry1 = new ComponentType { Id = "dummyEntryId1", CompTypeName = "Name1", CompTypeAltName = "NameAlt1", IsActive_bl = false };
var dbEntry2 = new ComponentType { Id = "dummyEntryId2", CompTypeName = "Name2", CompTypeAltName = "NameAlt2", IsActive_bl = true };
var dbEntry3 = new ComponentType { Id = "dummyEntryId3", CompTypeName = "Name3", CompTypeAltName = "NameAlt3", IsActive_bl = true };
var dbEntries = (new List<ComponentType> { dbEntry1, dbEntry2, dbEntry3 }).AsQueryable();
var mockDbSet = new Mock<DbSet<ComponentType>>();
mockDbSet.As<IDbAsyncEnumerable<ComponentType>>().Setup(m => m.GetAsyncEnumerator()).Returns(new MockDbAsyncEnumerator<ComponentType>(dbEntries.GetEnumerator()));
mockDbSet.As<IQueryable<ComponentType>>().Setup(m => m.Provider).Returns(new MockDbAsyncQueryProvider<ComponentType>(dbEntries.Provider));
mockDbSet.As<IQueryable<ComponentType>>().Setup(m => m.Expression).Returns(dbEntries.Expression);
mockDbSet.As<IQueryable<ComponentType>>().Setup(m => m.ElementType).Returns(dbEntries.ElementType);
mockDbSet.As<IQueryable<ComponentType>>().Setup(m => m.GetEnumerator()).Returns(dbEntries.GetEnumerator());
mockDbSet.Setup(x => x.Include(It.IsAny<string>())).Returns(mockDbSet.Object);
mockEfDbContext.Setup(x => x.ComponentTypes).Returns(mockDbSet.Object);
var compTypeService = new ComponentTypeService(mockDbContextScopeFac.Object, "dummyUserId");
//Act
var serviceResult = compTypeService.GetAsync(new string[] { "dummyEntryId3" }).Result;
//Assert
Assert.IsTrue(serviceResult.Count == 1);
Assert.IsTrue(serviceResult[0].CompTypeAltName.Contains("NameAlt3"));
}
示例11: Versions
public Versions(ComponentType component, string name, string version)
{
string[] temp = version.Split(new char[] { '.' });
this.Component = component;
this.Name = name;
this.MajorVersion = temp[0];
this.MinorVersion = temp[1];
}
示例12: ComponentBase
public ComponentBase(ComponentType type, int x, int y, int ID)
{
base.ID = ID;
this.ComponentType = type;
this.area = new Rectangle(x, y, 30, 30);
this.Ports = new List<Port>();
InitPort();
}
示例13: Function
/// <summary>
/// Initializes a new instance of the <see cref="Function"/> class.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="name">The name.</param>
/// <param name="sizef">The sizef.</param>
/// Created by SMK
public Function(ComponentType type, string name, Point pnt, SizeF sizef)
: base(name, type)
{
this.sizef = sizef;
area = new Rectangle(pnt.X, pnt.Y, Convert.ToInt32(sizef.Width) + Config.FUNCTION_DELTA_WIDTH + Config.FUNCTION_TYPE_WIDTH + Config.IMAGE_SPRITE_WIDTH,
Config.FUNCTION_HEIGHT);
InitPort();
}
示例14: ComponentsForType
public List<ImAbstractComponent> ComponentsForType(ComponentType type)
{
List<ImAbstractComponent> comps = new List<ImAbstractComponent>();
foreach (string key in components_.Keys) {
if (components_[key].componentType == type) comps.Add(components_[key]);
}
return comps;
}
示例15: RemoveComponent
public void RemoveComponent(Entity entity, ComponentType type)
{
if (entity.ComponentBits[type.Index])
{
_componentsByType[type.Index][entity.Id] = null;
entity.ComponentBits[type.Index] = false;
}
}