本文整理汇总了C#中ComponentType类的典型用法代码示例。如果您正苦于以下问题:C# ComponentType类的具体用法?C# ComponentType怎么用?C# ComponentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComponentType类属于命名空间,在下文中一共展示了ComponentType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:noahfalk,项目名称:corefx,代码行数:28,代码来源:NetEventSource.cs
示例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);
}
开发者ID:asifulm,项目名称:xrmdiff,代码行数:43,代码来源:XrmMetadataDiff.cs
示例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);
}
开发者ID:jwoschitz,项目名称:Lava,代码行数:34,代码来源:Engine.cs
示例4: Component
public Component(Vector2 center, ComponentType type)
{
this.myType = type;
this.currentState = ComponentState.notSelected;
this.Radius = 50.0f;
this.Center = center;
}
开发者ID:AntMartz,项目名称:fat-cats-final,代码行数:7,代码来源:Component.cs
示例5: AddDradisComponentsControl
public AddDradisComponentsControl(ComponentType componentType)
{
InitializeComponent();
ComponentNameLabel.Text = componentType.ToString();
_componentType = componentType;
requestedNumberComboBox.SelectedIndex = 0;
}
开发者ID:MaxPeck,项目名称:DeckManager,代码行数:7,代码来源:AddDradisComponentsControl.cs
示例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;
}
开发者ID:heber,项目名称:FreeOQ,代码行数:26,代码来源:Signal.cs
示例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);
}
开发者ID:apprenda,项目名称:Log4Net-Onboarder,代码行数:7,代码来源:AbstractBootstrapPolicyTestFixture.cs
示例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");
}
}
}
开发者ID:villers,项目名称:NET_Framework_UAP,代码行数:31,代码来源:DataSource.cs
示例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;
}
开发者ID:jth41,项目名称:TrussFree,代码行数:7,代码来源:Component.cs
示例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"));
}
开发者ID:naishan,项目名称:SDDB,代码行数:34,代码来源:Tests_ComponentTypeService.cs
示例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];
}
开发者ID:iliantova,项目名称:Telerik-Homework,代码行数:8,代码来源:Versions.cs
示例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();
}
开发者ID:huutruongqnvn,项目名称:vnecoo01,代码行数:8,代码来源:ComponentBase.cs
示例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();
}
开发者ID:huutruongqnvn,项目名称:vnecoo01,代码行数:15,代码来源:Function.cs
示例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;
}
开发者ID:wtrebella,项目名称:ImmunityGame,代码行数:8,代码来源:ImEntity.cs
示例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;
}
}
开发者ID:bnwasteland,项目名称:diana,代码行数:8,代码来源:ComponentManager.cs
示例16: AddComponent
public void AddComponent(Entity entity, ComponentType componentType, IComponent component)
{
_componentsByType.EnsureCapacity(componentType.Index+1);
var components = GetComponentsOfType(componentType);
components[entity.Id] = component;
entity.ComponentBits.Set(componentType.Index, true);
}
开发者ID:bnwasteland,项目名称:diana,代码行数:8,代码来源:ComponentManager.cs
示例17: GraphNode
/// <summary>
/// Initializes a new instance of the <see cref="GraphNode"/> class.
/// </summary>
/// <param name="nodeType">Type of the node.</param>
/// <param name="texts">The texts.</param>
/// <param name="pnt">The PNT.</param>
/// <param name="sizef">The sizef.</param>
/// Created by SMK
public GraphNode(ComponentType nodeType, string texts, Point pnt, SizeF sizef)
: base(texts, nodeType, sizef)
{
this.sizef = sizef;
area = new Rectangle(pnt.X, pnt.Y, Convert.ToInt32(sizef.Width) + Config.FUNCTION_DELTA_WIDTH + Config.GRAPH_NODE_TYPE_WIDTH,
Config.FUNCTION_HEIGHT_UNIT);
InitPort();
}
开发者ID:huutruongqnvn,项目名称:vnecoo01,代码行数:16,代码来源:GraphNode.cs
示例18: SolverNodeInfo
/// <summary>
/// Creates SolverNodeInfo instance.
/// </summary>
/// <param name="type">Type of the component.</param>
/// <param name="solvableProblems">Collection of solvable problem types.</param>
/// <param name="numberOfThreads">Number of threads provided by the component.</param>
public SolverNodeInfo(ComponentType type, ICollection<string> solvableProblems, byte numberOfThreads)
: base(type, numberOfThreads)
{
if (type != ComponentType.ComputationalNode && type != ComponentType.TaskManager)
throw new ArgumentException("Component type is neither Task Manager nor Computational Node.");
SolvableProblems = solvableProblems;
}
开发者ID:progala2,项目名称:DVRP,代码行数:14,代码来源:SolverNodeInfo.cs
示例19: ComponentForType
public SBAbstractComponent ComponentForType(ComponentType componentType)
{
foreach (SBAbstractComponent component in components) {
if (component.componentType == componentType) return component;
}
return null;
}
开发者ID:wtrebella,项目名称:SuperBlackout,代码行数:8,代码来源:SBEntity.cs
示例20: Component
/// <summary>
/// Initializes a new instance of the <see cref="Component"/> class.
/// </summary>
/// <param name="ctype">The ctype.</param>
public Component(ComponentType ctype)
: this(CreateCppInstance<IComponent>())
{
var descriptor = new ComponentDescriptor();
Native.Construct(ref descriptor, ctype);
Initialize(descriptor);
}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:12,代码来源:Component.cs
注:本文中的ComponentType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论