本文整理汇总了C#中ObjectInfo类的典型用法代码示例。如果您正苦于以下问题:C# ObjectInfo类的具体用法?C# ObjectInfo怎么用?C# ObjectInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectInfo类属于命名空间,在下文中一共展示了ObjectInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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( ',' );
}
示例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;
}
示例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;
}
示例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);
}
}
示例6: SimpleObjectSaver
public SimpleObjectSaver(ObjectInfo info, QueryComposer composer, DataProvider provider, IDbObjectHandler handler)
{
this.Info = info;
this.Composer = composer;
this.Provider = provider;
this.Handler = handler;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例13: Panel
public Panel(ObjectInfo info)
{
this._info = info;
this._plot = new Plot();
this.Content = this._plot;
this.Padding = new Padding(10);
}
示例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 );
}
示例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;
}