本文整理汇总了C#中ObjectInfo类的典型用法代码示例。如果您正苦于以下问题:C# ObjectInfo类的具体用法?C# ObjectInfo怎么用?C# ObjectInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectInfo类属于命名空间,在下文中一共展示了ObjectInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateDbObjectHandler
public virtual IDbObjectHandler CreateDbObjectHandler(Type srcType, ObjectInfo oi)
{
Type t = GetDbObjectHandler(srcType, oi);
var o = (EmitObjectHandlerBase)ClassHelper.CreateInstance(t);
o.Init(oi);
return o;
}
开发者ID:991899783,项目名称:DbEntry,代码行数:7,代码来源:AssemblyHandler.cs
示例2: GetSameTypeIds
public static String GetSameTypeIds( Type throughType, Type t, int id )
{
// 1029
ObjectInfo state = new ObjectInfo( throughType );
String relationPropertyName = state.EntityInfo.GetRelationPropertyName( t );
EntityPropertyInfo info = state.EntityInfo.FindRelationProperty( t );
String ids = ObjectDB.Find(state, relationPropertyName + ".Id=" + id ).get( info.Name + ".Id" );
EntityPropertyInfo property = state.EntityInfo.GetProperty( relationPropertyName );
String sql = String.Format( "select distinct {0} from {1} where {2} in ({3}) and {0}<>{4}", property.ColumnName, state.EntityInfo.TableName, info.ColumnName, ids, id );
IDbCommand command = DataFactory.GetCommand( sql, DbContext.getConnection( state.EntityInfo ) );
IDataReader rd = null;
StringBuilder builder = new StringBuilder();
try {
rd = command.ExecuteReader();
while (rd.Read()) {
builder.Append( rd[0] );
builder.Append( "," );
}
}
catch (Exception exception) {
logger.Error( exception.Message );
throw exception;
}
finally {
OrmHelper.CloseDataReader( rd );
}
return builder.ToString().TrimEnd( ',' );
}
开发者ID:nust03,项目名称:xcore,代码行数:30,代码来源:FindRelationOperation.cs
示例3: CloneObject
public GameObject CloneObject( Vector3 point, ObjectInfo placedObject, bool destroyOriginal )
{
if( placedObject.clonable ) {
audio.PlayOneShot( audioClone );
// Place the object
GameObject tempObject = Instantiate( prefab[placedObject.prefabIndex], point - placedObject.GetAnchor(), placedObject.transform.rotation ) as GameObject;
ObjectInfo tempOI = tempObject.GetComponent<ObjectInfo>();
tempOI.SetIteration( placedObject.GetIteration() - 1 );
if( destroyOriginal ) {
audio.PlayOneShot( audioDestroy );
Destroy( placedObject.gameObject );
}
if( LifeParticles != null )
Instantiate( LifeParticles, tempObject.transform.position, Quaternion.identity );
placedObject.Select( Vector3.zero );
return tempObject;
}
return null;
}
开发者ID:jeslinger,项目名称:game-off-2012,代码行数:27,代码来源:CloneController.cs
示例4: Panel
/// <summary>
/// Constructs a new device info tab panel
/// </summary>
/// <param name="info">The device to show information for</param>
public Panel(ObjectInfo info)
{
var obj = client.With<IDevice>(
info.DeviceInstance,
info.ObjectIdentifier);
var form = new FormBuilder()
.AddGroup(Constants.CorePropertiesHeader)
.AddRow(
createLabel(Constants.ObjectNameLabel),
bindEditor(obj, dev => dev.ObjectName, enabled: false))
.AddRow(
createLabel(Constants.VendorIdLabel),
bindEditor(obj, dev => dev.VendorIdentifier, enabled: false))
.AddRow(
createLabel(Constants.VendorNameLabel),
bindEditor(obj, dev => dev.VendorName, enabled: false)
)
.AddRow(
createLabel(Constants.ModelNameLabel),
bindEditor(obj, dev => dev.ModelName, enabled: false)
)
.AddRow(
createLabel(Constants.ApplicationSoftwareVersionLabel),
bindEditor(obj, dev => dev.ApplicationSoftwareVersion, enabled: false))
.End()
.End();
this.Content = form.Root;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:34,代码来源:DeviceInfoTab.cs
示例5: MakeSpaceObject
private void MakeSpaceObject(ObjectInfo oi)
{
Vector3 position = Random.onUnitSphere * (10 + oi.depth+Random.Range(0,0.5f));
GameObject newSpaceObject = Instantiate(prefab, position, Quaternion.identity) as GameObject;
newSpaceObject.transform.parent = spaceObjectContainer.transform;
newSpaceObject.transform.LookAt(Vector3.zero);
Material mat = newSpaceObject.transform.GetChild(0).GetComponent<MeshRenderer>().material;
mat.SetTexture(0, oi.texture);
Color newColor = Color.Lerp(oi.color1, oi.color2, Random.Range(0f, 1f));
newColor.a = 1f;
mat.color = newColor;
float newSize = Random.Range(oi.minSize, oi.maxSize);
newSpaceObject.transform.localScale = new Vector3(newSize, newSize, newSize);
if (oi.brightness > 0)
{
GameObject newLight = Instantiate(spaceObjectLightPrefab, position, Quaternion.identity) as GameObject;
Light light = newLight.GetComponent<Light>();
light.color = newColor;
light.intensity = oi.brightness;
newLight.transform.LookAt(Vector3.zero);
}
}
开发者ID:Zulban,项目名称:random-space-skybox,代码行数:25,代码来源:SpaceBackground.cs
示例6: SimpleObjectSaver
public SimpleObjectSaver(ObjectInfo info, QueryComposer composer, DataProvider provider, IDbObjectHandler handler)
{
this.Info = info;
this.Composer = composer;
this.Provider = provider;
this.Handler = handler;
}
开发者ID:991899783,项目名称:DbEntry,代码行数:7,代码来源:SimpleObjectSaver.cs
示例7: Main
public static int Main ()
{
var objects = new List<ObjectInfo> ();
long a = 1;
long b = 2;
ObjectInfo aa = new ObjectInfo ();
aa.Code = a;
ObjectInfo bb = new ObjectInfo ();
bb.Code = b;
objects.Add (aa);
objects.Add (bb);
int r1 = objects[0].Code.CompareTo (objects[1].Code);
int r2 = a.CompareTo (b);
if (r1 != r2) {
Console.WriteLine ("FAIL!");
return 1;
}
Console.WriteLine ("OK!");
return 0;
}
开发者ID:nobled,项目名称:mono,代码行数:25,代码来源:test-830.cs
示例8: Panel
public Panel(ObjectInfo info)
{
var obj = client.With<IAnalogValue>(
info.DeviceInstance,
info.ObjectIdentifier);
var form = new FormBuilder()
.AddGroup(Constants.CorePropertiesHeader)
.AddRow(
createLabel(Constants.ObjectNameLabel),
bindEditor(obj, av => av.ObjectName)
)
.Split()
.AddRow(
createLabel(Constants.PresentValueLabel),
bindEditor(obj, av => av.PresentValue),
createLabel(Constants.UnitsLabel),
bindEditor(obj, av => av.Units))
.End()
.AddGroup(Constants.AdditionalPropertiesHeader)
.AddRow(
createLabel(Constants.LowLimitLabel),
bindEditor(obj, av => av.LowLimit),
createLabel(Constants.HighLimitLabel),
bindEditor(obj, av => av.HighLimit))
.AddRow(
createLabel(Constants.DeadbandLabel),
bindEditor(obj, av => av.Deadband, enabled: false),
createLabel(Constants.CovIncrementLabel),
bindEditor(obj, av => av.CovIncrement, enabled: false))
.End()
.End();
this.Content = form.Root;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:35,代码来源:AnalogValueInfoTab.cs
示例9: GetMethodInvoker
/////////////////////////////////////////////////////////////////////////////
//public static TypeHelperDictionary TypeHelpers { get { return ThreadContext.TypeHelpers; } }
/////////////////////////////////////////////////////////////////////////////
public static Invoker GetMethodInvoker( object parent, string methodName, TypeHelperDictionary typeHelpers )
{
// ******
var objInfo = new ObjectInfo( parent, methodName );
if( objInfo.IsMethod ) {
return new MethodInvoker( objInfo );
}
// ******
INmpDynamic dyn = parent as INmpDynamic;
if( null != dyn ) {
if( dyn.HasMethod(methodName) ) {
return new DynamicMethodInvoker( parent, methodName );
}
}
// ******
object standin = typeHelpers.GetHelper( parent );
if( null != standin ) {
objInfo = new ObjectInfo( standin, methodName );
if( objInfo.IsMethod ) {
return new MethodInvoker( objInfo );
}
}
// ******
return null;
}
开发者ID:jmclain,项目名称:Nmp,代码行数:35,代码来源:Invokers.cs
示例10: findById_Private
private static IEntity findById_Private( long id, ObjectInfo state )
{
if (id < 0) return null;
IEntity result = null;
SqlBuilder sh = new SqlBuilder( state.EntityInfo );
processIncluder( state.Includer );
String sql = sh.GetFindById( id, state.Includer.SelectedProperty );
IDbCommand cmd = DataFactory.GetCommand( sql, DbContext.getConnection( state.EntityInfo ) );
IList list = new ArrayList();
IDataReader rd = null;
try {
rd = cmd.ExecuteReader();
while (rd.Read()) {
list.Add( FillUtil.Populate( rd, state ) );
}
}
catch (Exception ex) {
logger.Error( ex.Message );
logger.Error( ex.StackTrace );
throw new OrmException( ex.Message, ex );
}
finally {
OrmHelper.CloseDataReader( rd );
}
if (list.Count > 0) result = list[0] as IEntity;
result = setEntityProperty( result, id, state );
return result;
}
开发者ID:bae2014,项目名称:wojilu,代码行数:33,代码来源:FindByIdOperation.cs
示例11: ReadInfos
void ReadInfos()
{
string text = objectsInfoListText.text;
string[] strArr = text.Split('\n');
foreach(string str in strArr)
{
string[] propArr = str.Split(',');
int id = int.Parse(propArr[0]);
ObjectInfo info = new ObjectInfo();
info.id = id;
info.name = propArr[1];
info.iconName = propArr[2];
info.type = GetType(propArr[3]);
if(info.type == ObjectType.Drug)
{
info.hp = int.Parse(propArr[4]);
info.mp = int.Parse(propArr[5]);
info.sellPrice = int.Parse(propArr[6]);
info.buyPrice = int.Parse(propArr[7]);
}
objects[id] = info;
}
}
开发者ID:jiangsyk,项目名称:RPGProject,代码行数:25,代码来源:ObjectsInfo.cs
示例12: Create
/// <summary>
/// Creates the tab page
/// </summary>
/// <param name="objectInfo">The object info to create the tab for</param>
/// <returns>The tab page instance</returns>
public TabPage Create(ObjectInfo objectInfo)
{
var page = new TabPage();
page.Text = Constants.InfoTabText;
page.Content = new Panel(objectInfo);
return page;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:12,代码来源:BinaryInputInfoTab.cs
示例13: Panel
public Panel(ObjectInfo info)
{
this._info = info;
this._plot = new Plot();
this.Content = this._plot;
this.Padding = new Padding(10);
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:7,代码来源:TrendLogChartTab.cs
示例14: findAllPrivate
private static IList findAllPrivate( ObjectInfo state ) {
String sql = "select * from " + state.EntityInfo.TableName;
logger.Info( LoggerUtil.SqlPrefix + "[" + state.EntityInfo.Name + "_FindAll]" + sql );
return EntityPropertyUtil.FindList( state, sql );
}
开发者ID:mfz888,项目名称:xcore,代码行数:7,代码来源:FindAllOperation.cs
示例15: findAllFromChild
private static IList findAllFromChild( IList parents, ObjectInfo state ) {
ArrayList results = new ArrayList();
foreach (EntityInfo info in state.EntityInfo.ChildEntityList) {
ObjectInfo childState = new ObjectInfo( info);
childState.includeAll();
IList children = ObjectDb.FindAll( childState );
for (int i = 0; i < children.Count; i++) {
IEntity child = children[i] as IEntity;
// state
//child.state.Order = state.Order;
results.Add( child );
parents.RemoveAt( Query.getIndexOfObject( parents, child ) );
}
}
if (parents.Count > 0) results.AddRange( parents );
results.Sort();
return results;
}
开发者ID:mfz888,项目名称:xcore,代码行数:25,代码来源:FindAllOperation.cs
示例16: GetIndexerInvoker
/////////////////////////////////////////////////////////////////////////////
public static Invoker GetIndexerInvoker( object parent, string indexerName, TypeHelperDictionary typeHelpers )
{
// ******
var objInfo = new ObjectInfo( parent, indexerName );
if( objInfo.IsIndexer ) {
return new IndexerInvoker( objInfo );
}
// ******
INmpDynamic dyn = parent as INmpDynamic;
if( null != dyn && dyn.HasIndexer(indexerName) ) {
return new DynamicIndexerInvoker( parent, indexerName);
}
// ******
object standin = typeHelpers.GetHelper( parent );
if( null != standin ) {
objInfo = new ObjectInfo( standin, indexerName );
if( objInfo.IsIndexer ) {
return new IndexerInvoker( objInfo );
}
}
// ******
return null;
}
开发者ID:jmclain,项目名称:Nmp,代码行数:28,代码来源:Invokers.cs
示例17: Create
/// <summary>
/// Creates the tab page
/// </summary>
/// <param name="deviceInfo">The device info to create the tab for</param>
/// <returns>The tab page instance</returns>
public TabPage Create(ObjectInfo deviceInfo)
{
var page = new TabPage();
page.Text = Constants.AlarmsTabText;
page.Content = new Panel(deviceInfo);
return page;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:12,代码来源:DeviceAlarmsTab.cs
示例18: MessageInfo
/// <summary>
/// Initializes a new instance of the <see cref="MessageInfo"/> class.
/// </summary>
/// <param name="source">The source.</param>
/// <param name="target">The target.</param>
/// <param name="methodCallName">Name of the method call.</param>
/// <param name="methodCallInfo">The method call info.</param>
internal MessageInfo(ObjectInfo source, ObjectInfo target, string methodCallName, MethodCallInfo methodCallInfo)
{
this.Source = source;
this.Target = target;
this.MethodCallName = methodCallName;
this.MethodCallInfo = methodCallInfo;
}
开发者ID:WrongDog,项目名称:Sequence,代码行数:14,代码来源:MessageInfo.cs
示例19: Panel
public Panel(ObjectInfo info)
{
var obj = client.With<IBinaryValue>(
info.DeviceInstance,
info.ObjectIdentifier);
var form = new FormBuilder()
.AddGroup(Constants.CorePropertiesHeader)
.AddRow(
createLabel(Constants.ObjectNameLabel),
bindEditor(obj, bv => bv.ObjectName)
)
.Split()
.AddRow(
createLabel(Constants.PresentValueLabel),
bindEditor(obj, bv => bv.PresentValue),
createLabel(Constants.OutOfServiceLabel),
bindEditor(obj, bv => bv.OutOfService))
.End()
.AddGroup(Constants.AdditionalPropertiesHeader)
.AddRow(
createLabel(Constants.ChangeOfStateCountLabel),
bindEditor(obj, bv => bv.ChangeOfStateCount, enabled: false),
createLabel(Constants.ChangeOfStateTimeLabel),
bindEditor(obj, bv => bv.ChangeOfStateTime, enabled: false))
.AddRow(
createLabel(Constants.ActiveTextLabel),
bindEditor(obj, bv => bv.ActiveText),
createLabel(Constants.InactiveTextLabel),
bindEditor(obj, bv => bv.InactiveText))
.End()
.End();
this.Content = form.Root;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:35,代码来源:BinaryValueInfoTab.cs
示例20: ParseDatatxt
public static DatatxtDesc ParseDatatxt(string st)
{
DatatxtDesc result = new DatatxtDesc();
StringReader sr = new StringReader(st);
string line;
while ((line = sr.ReadLine()) != null)
{
if (line.Trim().Length == 0) continue;
if (line.Trim() == "<object>")
while ((line = sr.ReadLine()) != null)
{
if (line.Trim() == "<object_end>") break;
ObjectInfo of = new ObjectInfo(GetTagAndIntValue(line, "id:"),
GetTagAndIntValue(line, "type:"),
GetTagAndStrValue(line, "file:"));
result.lObject.Add(of);
}
if (line.Trim() == "<background>")
while ((line = sr.ReadLine()) != null)
{
if (line.Trim() == "<background_end>") break;
BackgroundInfo bf = new BackgroundInfo(GetTagAndIntValue(line, "id:"), GetTagAndStrValue(line, "file:"));
result.lBackground.Add(bf);
}
}
sr.Close();
return result;
}
开发者ID:NightmareX1337,项目名称:lfs,代码行数:30,代码来源:DatFiles.cs
注:本文中的ObjectInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论