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( ',' ); }
///////////////////////////////////////////////////////////////////////////// //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; }
/// <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; }
public Panel(ObjectInfo info) { this._info = info; this._plot = new Plot(); this.Content = this._plot; this.Padding = new Padding(10); }
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; }
/// <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; }
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; }
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); } }
///////////////////////////////////////////////////////////////////////////// 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; }
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 ); }
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; }
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; }
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; }
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; } }
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; }
/// <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; }
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; }
public virtual IDbObjectHandler CreateDbObjectHandler(Type srcType, ObjectInfo oi) { Type t = GetDbObjectHandler(srcType, oi); var o = (EmitObjectHandlerBase)ClassHelper.CreateInstance(t); o.Init(oi); return o; }
public void ClearItem(){ id = 0; num = 0; info = null; numLabel.enabled =false; }
public void ClearInfo() { id = 0; num = 0; info = null; numLabel.gameObject.SetActive(false); }
public SimpleObjectSaver(ObjectInfo info, QueryComposer composer, DataProvider provider, IDbObjectHandler handler) { this.Info = info; this.Composer = composer; this.Provider = provider; this.Handler = handler; }
/// <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; }
public static void Initialize() { m_ObjectInfo = new ObjectInfo[326]; for (int i = 0; i < 326; i++) m_ObjectInfo[i] = new ObjectInfo(); m_WebClient = new WebClient(); }
public static IList FindAll( ObjectInfo state ) { IList parentResults = findAllPrivate( state ); if (state.EntityInfo.ChildEntityList.Count > 0) { return findAllFromChild( parentResults, state ); } return parentResults; }
public void setInventory(int id){ this.id = id; objectinfoxu = ObjectsInfo._instance.GetObjectInfo (id); if (objectinfoxu.type == ObjectType.Drug) { iconsprite.gameObject.SetActive (true); iconsprite.spriteName = objectinfoxu.iconname; typexu = shortcuttype.Drug;//快捷方式类型 } }
string GetDrugDes(ObjectInfo info){ string str = ""; str+="名称:"+info.name+"\n"; str += "HP回复:" + info.hp + "\n"; str += "MP回复:" + info.mp + "\n"; str+="出售价:"+info.price_sell+"\n"; str += "购买价:" + info.price_buy + "\n"; return str; }
public static Query Find( String condition, ObjectInfo state ) { Includer includer = state.Includer; if (strUtil.HasText( includer.SelectedProperty ) && (includer.SelectedProperty != "*")) { Query query = new Query( condition, state ); return query.select( includer.SelectedProperty ); } return new Query( condition, state ); }
string GetDrugDes(ObjectInfo info) { string des = ""; des += "名称:" + info.name + "\n"; des += "+HP:" + info.hp + "\n"; des += "+MP:" + info.mp + "\n"; des += "出售价:" + info.sellPrice + "\n"; des += "购买价:" + info.buyPrice + "\n"; return des; }
public static IList FindDataOther( Type throughType, Type t, String order, int id ) { // 1029 ObjectInfo state = new ObjectInfo( throughType ); String relationPropertyName = state.EntityInfo.GetRelationPropertyName( t ); EntityPropertyInfo info = state.EntityInfo.FindRelationProperty( t ); state.Order = order; state.include( info.Name ); return ObjectDB.Find( state, relationPropertyName + ".Id=" + id ).listChildren( info.Name ); }
public AutoSchemeFixerCreateTable(DataProvider provider, ObjectInfo info) { this.Provider = provider; _createTables = GetCreateTables(info); }
public void For_ReturnsTupleObjectInfo_ForTypeOfTupleT1() { var objectInfo = ObjectInfo.For(typeof(Tuple <int>)); Assert.IsType <TupleObjectInfo>(objectInfo); }
static void Main(string[] args) { MtpResponse res; MtpCommand command = new MtpCommand(); // 接続されているデバイスIDを取得する string[] deviceIds = command.GetDeviceIds(); if (deviceIds.Length == 0) { return; } // RICOH THETA S デバイスを取得する string targetDeviceId = String.Empty; foreach (string deviceId in deviceIds) { if ("RICOH THETA S".Equals(command.GetDeviceFriendlyName(deviceId))) { targetDeviceId = deviceId; break; } } if (targetDeviceId.Length == 0) { return; } command.Open(targetDeviceId); // イベントを受け取れるようにする command.MtpEvent += MtpEventListener; // DeviceInfo res = command.Execute(MtpOperationCode.GetDeviceInfo, null, null); DeviceInfo deviceInfo = new DeviceInfo(res.Data); // DevicePropDesc(StillCaptureMode) res = command.Execute(MtpOperationCode.GetDevicePropDesc, new uint[1] { (uint)MtpDevicePropCode.StillCaptureMode }, null); DevicePropDesc dpd = new DevicePropDesc(res.Data); // シャッター優先 command.Execute(MtpOperationCode.SetDevicePropValue, new uint[1] { (uint)MtpDevicePropCode.ExposureProgramMode }, BitConverter.GetBytes((ushort)ExposureProgramMode.ShutterPriorityProgram)); // シャッター速度(Get) res = command.Execute(MtpOperationCode.GetDevicePropValue, new uint[1] { (uint)MtpDevicePropCode.ShutterSpeed }, null); ShutterSpeed ss = new ShutterSpeed(res.Data); // シャッター速度(Set) ss = new ShutterSpeed(1, 100); // 1/100 res = command.Execute(MtpOperationCode.SetDevicePropValue, new uint[1] { (uint)MtpDevicePropCode.ShutterSpeed }, ss.Data); // シャッター速度(Get) res = command.Execute(MtpOperationCode.GetDevicePropValue, new uint[1] { (uint)MtpDevicePropCode.ShutterSpeed }, null); ss = new ShutterSpeed(res.Data); // DevicePropDesc(ExposureIndex) res = command.Execute(MtpOperationCode.GetDevicePropDesc, new uint[1] { (uint)MtpDevicePropCode.ExposureIndex }, null); dpd = new DevicePropDesc(res.Data); // StillCaptureMode res = command.Execute(MtpOperationCode.GetDevicePropValue, new uint[1] { (uint)MtpDevicePropCode.StillCaptureMode }, null); StillCaptureMode mode = (StillCaptureMode)BitConverter.ToUInt16(res.Data, 0); // ストレージIDをとる res = command.Execute(MtpOperationCode.GetStorageIDs, null, null); uint[] storageIds = Utils.GetUIntArray(res.Data); // ストレージ情報をとる res = command.Execute(MtpOperationCode.GetStorageInfo, new uint[1] { storageIds[0] }, null); StorageInfo storageInfo = new StorageInfo(res.Data); // オブジェクト数をとる res = command.Execute(MtpOperationCode.GetNumObjects, new uint[3] { storageIds[0], 0, 0 }, null); uint num = res.Parameter1; // GetObjectHandles res = command.Execute(MtpOperationCode.GetObjectHandles, new uint[3] { storageIds[0], 0, 0 }, null); uint[] objectHandles = Utils.GetUIntArray(res.Data); // 静止画か動画をデスクトップに保存する // objectHandlesの最初の3つはフォルダのようなので4つ目を取得する if (objectHandles.Length > 3) { // ファイル名を取得する res = command.Execute(MtpOperationCode.GetObjectInfo, new uint[1] { objectHandles[3] }, null); ObjectInfo objectInfo = new ObjectInfo(res.Data); // ファイルを取得する res = command.Execute(MtpOperationCode.GetObject, new uint[1] { objectHandles[3] }, null); if (res.ResponseCode == MtpResponseCode.OK) { // デスクトップへ保存する using (FileStream fs = new FileStream( Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\" + objectInfo.Filename, // ファイル名 FileMode.Create, FileAccess.Write)) { fs.Write(res.Data, 0, res.Data.Length); } } } // 撮影する res = command.Execute(MtpOperationCode.InitiateCapture, new uint[2] { 0, 0 }, null); // デバイスよさようなら command.Close(); }
void IPlasticAPI.CalculateAcl(string server, ObjectInfo obj, out AclInfo aclInfo, out AclEntry[] calculatedPermissions, out bool bIsOwner) { throw new NotImplementedException(); }
void IPlasticAPI.SetPermissions(string server, ObjectInfo obj, SEID seid, Permissions granted, Permissions denied, Permissions overrideGranted, Permissions overrideDenied) { throw new NotImplementedException(); }
void ReadInfo() { try { string text = objectInfoListText.text; string[] strArray = text.Split('\n'); foreach (string str in strArray) { string[] proArray = str.Split(','); ObjectInfo info = new ObjectInfo(); int id = int.Parse(proArray[0]); string name = proArray[1]; string icon_name = proArray[2]; string str_type = proArray[3]; ObjcetType type = ObjcetType.Drug; switch (str_type) { case "Drug": type = ObjcetType.Drug; break; case "Equip": type = ObjcetType.Equip; break; case "Mat": type = ObjcetType.Mat; break; } info.id = id; info.name = name; info.icon_name = icon_name; info.type = type; if (type == ObjcetType.Drug) { int hp = int.Parse(proArray[4]); int mp = int.Parse(proArray[5]); int price_sell = int.Parse(proArray[6]); int price_buy = int.Parse(proArray[7]); info.price_buy = price_buy; info.hp = hp; info.mp = mp; info.price_sell = price_sell; info.coldTime = int.Parse(proArray[8]); } else if (type == ObjcetType.Equip) { info.attack = int.Parse(proArray[4]); info.def = int.Parse(proArray[5]); info.speed = int.Parse(proArray[6]); info.price_sell = int.Parse(proArray[9]); info.price_buy = int.Parse(proArray[10]); string str_dresstype = proArray[7]; switch (str_dresstype) { case "Headgear": info.dressType = DressType.Headgear; break; case "Armor": info.dressType = DressType.Armor; break; case "LeftHand": info.dressType = DressType.LeftHand; break; case "RightHand": info.dressType = DressType.RightHand; break; case "Shoe": info.dressType = DressType.Shoe; break; case "Accessory": info.dressType = DressType.Accessory; break; } string str_apptype = proArray[8]; switch (str_apptype) { case "Swordman": info.applicationType = ApplicationType.Swordman; break; case "Magician": info.applicationType = ApplicationType.Magician; break; case "Common": info.applicationType = ApplicationType.Common; break; } } objectInfoDict.Add(id, info); } } catch { } }
/// <summary> /// 读取数据创建字典 /// </summary> void ReadInfo() { string text = objectsInfoListText.text; //获得文本所有信息 string[] strArray = text.Split('\n'); //获得每个物品的所有信息 //获得每个物品中的属性,并保存到objectInfoDic中 foreach (string str in strArray) { string[] proArray = str.Split(','); ObjectInfo info = new ObjectInfo(); info.ID = int.Parse(proArray[0]); info.name = proArray[1]; info.name_Icon = proArray[2]; string str_type = proArray[3]; //设置一个缓存,在判断是哪种类型物品 switch (str_type) { case "Drug": info.type = objectType.Drug; break; case "Equip": info.type = objectType.Equip; break; case "Mat": info.type = objectType.Mat; break; } if (info.type == objectType.Drug) { info.recover_HP = int.Parse(proArray[4]); info.recover_MP = int.Parse(proArray[5]); info.price_Sell = int.Parse(proArray[6]); info.price_Buy = int.Parse(proArray[7]); } else if (info.type == objectType.Equip) { info.attackValue = int.Parse(proArray[4]); info.defValue = int.Parse(proArray[5]); info.speedValue = int.Parse(proArray[6]); string temp = proArray[7]; switch (temp) { case "Armor": info.equipmentType = EquipmentType.Armor; break; case "Headgear": info.equipmentType = EquipmentType.Headgear; break; case "Shoe": info.equipmentType = EquipmentType.Shoe; break; case "LeftHand": info.equipmentType = EquipmentType.LeftHand; break; case "RightHand": info.equipmentType = EquipmentType.RightHand; break; case "Accessory": info.equipmentType = EquipmentType.Accessory; break; } temp = null; temp = proArray[8]; switch (temp) { case "Swordman": info.appType = AppType.Swordman; break; case "Magician": info.appType = AppType.Magician; break; case "Common": info.appType = AppType.Common; break; } info.price_Sell = int.Parse(proArray[9]); info.price_Buy = int.Parse(proArray[10]); } objectInfoDic.Add(info.ID, info); } }
/// <summary> /// Object property /// </summary> internal ObjectProperty(Type ObjectType, ObjectInfo Info) : base() { this.objectType = ObjectType; this.info = Info; }
public object GetDefaultObject(ObjectInfo <object> info) { return(EMPTY); }
protected override void Awake() { base.Awake(); // _objType = ObjectType.ClockingBox; //_obj = new GameObject[20]; _obj.Clear(); list.Clear(); _obj.AddRange(GameObject.FindGameObjectsWithTag("Object")); // 오브젝트 갯수 파악 Debug.Log(_obj.Count); for (int i = 0; i < _obj.Count; i++) { //오브젝트 갯수 만큼 for문 ObjectInfo[] _objectInfo = new ObjectInfo[_obj.Count]; // 오브젝트 갯수만큼 _objectInfo[i] = _obj[i].GetComponent <ObjectInfo>(); // objectinfo 생성 if (_objectInfo[i] == null) { continue; } Debug.Log(_objectInfo[i].transform.name); // objectinfo 갖고있는거 체크 _objType = _objectInfo[i].ObjectType; // 타입체크 if (_objType == ObjectType.Platforms) //만약 그게 클로킹박스면 { _objDistance = Vector3.Distance(transform.position, _obj[i].transform.position); // 드론과 박스의 거리차이 확인 list.Add(_obj[i]); // 리스트 추가 list.Sort(delegate(GameObject g1, GameObject g2) { return(Vector3.Distance(g1.transform.position, transform.position).CompareTo(Vector3.Distance(g2.transform.position, transform.position))); }); } } listcount = list.Count; _patrolcount = 0; SetGizmoColor(Color.blue); //_cc = GetComponent<CharacterController>(); _cc = GetComponent <CapsuleCollider>(); _rigid = GetComponent <Rigidbody>(); _stat = GetComponent <DroneStat>(); _anim = GetComponentInChildren <Animator>(); _playercc = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterController>(); _playercs = GameObject.FindGameObjectWithTag("Player").GetComponent <CapsuleCollider>(); _playerTransform = _playercs.transform; DroneState[] stateValues = (DroneState[])System.Enum.GetValues(typeof(DroneState)); foreach (DroneState s in stateValues) { System.Type FSMType = System.Type.GetType("Drone" + s.ToString()); DroneFSMState state = (DroneFSMState)GetComponent(FSMType); if (null == state) { state = (DroneFSMState)gameObject.AddComponent(FSMType); } _states.Add(s, state); state.enabled = false; } }
/// <summary> /// A helper method required because you can't do typeof(dynamic). /// </summary> private static IObjectInfo ObjectInfoHelper <T>() { var objectInfo = ObjectInfo.For(typeof(T)); return(objectInfo); }
ObjectInfo FinishObjectCreation(Object obj) { // Generate a name if (obj is Control && !_asyncObjectCreation) { Control c = (Control)obj; c.Name = CompNumber.GetCompName(obj.GetType()); // This one can't have the text set to anything but a date if (!(c is DateTimePicker)) { c.Text = c.Name; } } ObjectInfo objInfo = _targetNode.AddNewObject(obj, _sourceNode); // This is the case when the control is created not by dragging // it to the design panel, but dragging it to the object // tree somewhere if (_sourceNode is IDesignSurfaceNode) { IDesignSurfaceNode dNode = (IDesignSurfaceNode)_sourceNode; if (obj is Control) { Control control = (Control)obj; // Some of them don't have them, need to pick something // so its visible Size defaultSize; PropertyInfo p = typeof(Control).GetProperty("DefaultSize", ReflectionHelper.ALL_BINDINGS); defaultSize = (Size)p.GetValue(control, null); if (defaultSize.Equals(Size.Empty)) { TraceUtil.WriteLineWarning(this, "No DefaultSize specified for " + control); control.Size = new Size(200, 200); } if (dNode.OnDesignSurface) { // Give the user a change with AxWebBrowser if (control.GetType().Name.Equals("AxWebBrowser")) { ErrorDialog.Show ("Before calling methods on the WebBrowser " + "object, please turn off Design Mode. " + "This works around a known problem where " + "the browser control does not work " + "initially correctly in design mode. " + "The problem only occurs on the " + "first method invocation; you may turn on " + "design mode after the first method call " + "is completely finished.", "Please turn off Design Mode", MessageBoxIcon.Warning); } try { // The control may complain if it does not // like where it is being added ObjectBrowser.ImagePanel.AddControl(objInfo, control); } catch (Exception ex) { _targetNode.RemoveObject(objInfo.Obj); throw new Exception ("There was an error adding this control " + "to the design surface. You might want " + "using the Action menu (right-click) " + "to not have the control created " + "on the design surface", ex); } } control.Show(); } } return(objInfo); }
public AutoSchemeFixerRemoveColumns(DataProvider provider, ObjectInfo info) : base(provider, info) { }
/// <summary> /// 获得该Dll所有引出函数信息 /// </summary> /// <returns></returns> public ObjectInfo[] GetFunctionsInfo() { ObjectInfo[] objectInfos = new ObjectInfo[17]; objectInfos[0].Name = "Fun_ts_mzys_blcflr"; objectInfos[0].Text = "病历处方"; objectInfos[0].Remark = ""; objectInfos[1].Name = "Fun_ts_mzys_jzlscx"; objectInfos[1].Text = "病人就诊历史查询"; objectInfos[1].Remark = "仅查询当前医生登陆科室的接诊历史"; objectInfos[2].Name = "Fun_ts_mzys_jzlscx_all"; objectInfos[2].Text = "病人就诊历史查询"; objectInfos[2].Remark = "查询所有医生接诊历史"; objectInfos[3].Name = "Fun_ts_mzys_blcflr_grmb"; objectInfos[3].Text = "个人模板维护"; objectInfos[3].Remark = "个人模板维护"; objectInfos[4].Name = "Fun_ts_mzys_blcflr_kjmb"; objectInfos[4].Text = "科级模板维护"; objectInfos[4].Remark = "院级模板维护"; objectInfos[5].Name = "Fun_ts_mzys_blcflr_yjmb"; objectInfos[5].Text = "院级模板维护"; objectInfos[5].Remark = "院级模板维护"; objectInfos[6].Name = "Fun_ts_mzys_blcflr_zyzdj"; objectInfos[6].Text = "住院证登记"; objectInfos[6].Remark = "住院证登记"; objectInfos[7].Name = "Fun_ts_mzys_blcflr_wtsq"; objectInfos[7].Text = "委托申请"; objectInfos[7].Remark = "委托申请"; objectInfos[8].Name = "Fun_ts_zyys_blcflr"; objectInfos[8].Text = "住院医生门诊处方录入"; objectInfos[8].Remark = "住院医生门诊处方录入"; objectInfos[9].Name = "Fun_ts_mzys_zymbwh"; objectInfos[9].Text = "处方备注模板维护"; objectInfos[9].Remark = "处方备注模板维护"; //Add By zp 2014-02-07 objectInfos[10].Name = "Fun_ts_mztfsh"; objectInfos[10].Text = "门诊退费审核"; objectInfos[10].Remark = "门诊退费审核";//Fun_ts_mzys_yyjbsh objectInfos[11].Name = "Fun_ts_mzys_yyjbsh"; objectInfos[11].Text = "用药级别审核"; objectInfos[11].Remark = "用药级别审核"; objectInfos[12].Name = "Fun_ts_zyzCx"; objectInfos[12].Text = "住院证查询"; objectInfos[12].Remark = "住院证查询"; //add by zouchihua 医生退费申请可以挂菜单,由本科室医生进行申请 2014-9-14 objectInfos[13].Name = "Fun_ts_mztfsq_ys"; objectInfos[13].Text = "门诊退费申请"; objectInfos[13].Remark = "门诊退费申请";//Fun_ts_mzys_yyjbsh //add by zouchihua 医生退费申请可以挂菜单,由本科室医生进行申请 2014-9-14 objectInfos[14].Name = "Fun_ts_mztfsq_hj"; objectInfos[14].Text = "门诊退费申请(划价)"; objectInfos[14].Remark = "门诊退费申请(划价)";//Fun_ts_mzys_yyjbsh objectInfos[15].Name = "Fun_ts_mzys_blcflr_xdcf_yj"; objectInfos[15].Text = "院级协定处方维护"; objectInfos[15].Remark = "院级协定处方维护"; objectInfos[16].Name = "Fun_ts_mzys_blcflr_xdcf_kj"; objectInfos[16].Text = "科级协定处方维护"; objectInfos[16].Remark = "科级协定处方维护"; return(objectInfos); }
/// <summary> /// 获得该Dll所有引出函数信息 /// </summary> /// <returns></returns> public ObjectInfo[] GetFunctionsInfo() { ObjectInfo[] objectInfos = new ObjectInfo[20]; objectInfos[0].Name = "Fun_MZHJ"; objectInfos[0].Text = "药房划价"; objectInfos[0].Remark = ""; objectInfos[1].Name = "Fun_MZSF"; objectInfos[1].Text = "门诊收费"; objectInfos[1].Remark = ""; objectInfos[2].Name = "Fun_MZ_InvoiceQuery"; objectInfos[2].Text = "门诊发票查询"; objectInfos[2].Remark = ""; objectInfos[3].Name = "Fun_MZ_PrescriptionQuery"; objectInfos[3].Text = "门诊处方查询"; objectInfos[3].Remark = ""; objectInfos[4].Name = "Fun_MZ_Account"; objectInfos[4].Text = "门诊个人交款表"; objectInfos[4].Remark = ""; objectInfos[5].Name = "Fun_MZ_AllAccount"; objectInfos[5].Text = "门诊交款表汇总"; objectInfos[5].Remark = ""; objectInfos[6].Name = "Fun_MZ_GH"; objectInfos[6].Text = "门诊挂号"; objectInfos[6].Remark = ""; objectInfos[7].Name = "Fun_MZ_InvoiceManager"; objectInfos[7].Text = "门诊票据管理"; objectInfos[7].Remark = ""; objectInfos[8].Name = "Fun_MZYS"; objectInfos[8].Text = "门诊划价"; objectInfos[8].Remark = ""; objectInfos[9].Name = "Fun_MZ_Discharge"; objectInfos[9].Text = "门诊退费"; objectInfos[9].Remark = ""; objectInfos[10].Name = "Fun_MZ_CardManager"; objectInfos[10].Text = "门诊病人信息管理"; objectInfos[10].Remark = ""; objectInfos[11].Name = "Fun_MZ_PersonSetting"; objectInfos[11].Text = "门诊个人设置"; objectInfos[11].Remark = ""; objectInfos[12].Name = "Fun_MZ_IncomeReport"; objectInfos[12].Text = "门诊收入统计"; objectInfos[12].Remark = ""; objectInfos[13].Name = "Fun_MZ_RegReport"; objectInfos[13].Text = "门诊挂号人次统计"; objectInfos[13].Remark = ""; objectInfos[14].Name = "Fun_MZ_DownloadData"; objectInfos[14].Text = "基础数据下载"; objectInfos[14].Remark = "下载单机收费模式所需的基础数据"; objectInfos[15].Name = "Fun_MZ_PatientFeeQuery"; objectInfos[15].Text = "门诊病人费用查询"; objectInfos[15].Remark = "查询门诊病人来院就诊的费用情况"; objectInfos[16].Name = "Fun_MZ_PatientFeeReport"; objectInfos[16].Text = "门诊病人费用统计"; objectInfos[16].Remark = "统计门诊病人费用情况"; objectInfos[17].Name = "Fun_FrmPerformSectionReport"; objectInfos[17].Text = "执行科室门诊收入统计"; objectInfos[17].Remark = "统计门诊科室和执行科室的收入表"; objectInfos[18].Name = "Fun_FrmChargerFeeReport"; objectInfos[18].Text = "门诊收费员工作量统计"; objectInfos[18].Remark = "门诊收费员工作量统计"; objectInfos[19].Name = "Fun_FrmItemFeeQuery"; objectInfos[19].Text = "门诊收费项目收入统计"; objectInfos[19].Remark = "门诊收费项目收入统计"; return(objectInfos); }
private void WriteObjectImpl(ObjectInfo objectInfo) { //Assumption: the label has already been printed on the line. // if you _output.WriteLine, the value will not appear // on same line as the label var objToAppend = objectInfo.Value; if (objToAppend == null) { _output.Write(NullValue); return; } Type typeOfOjbToAppend = objectInfo.Type; //Avoid referential loops by not letting an object be dumped as a descendent in the graph //TODO: when value types create circular references, this fails // because ReferenceEquals will box the value type and thus never have the same reference if (_objStack.Any(o => ReferenceEquals(objToAppend, o))) { _output.Write("avoid circular loop for this [" + typeOfOjbToAppend.Name + "]: hashcode { " + objToAppend.GetHashCode() + " }"); return; } //Avoid StackOverflow caused by recursive value types like Linq2Sql or ConfigurationException.Errors if (_currentDepth >= _config.MaxDepth) { _output.Write("Maximum recursion depth (" + _config.MaxDepth + ") reached"); return; } //*** continue recursive printing of the object _objStack.Push(objToAppend); var stringToAppend = objToAppend as string; if (stringToAppend != null) { //in case the string contains line returns, the next line will be indented from the member name _output.Indent(); _output.Write(stringToAppend); _output.Outdent(); } else { object singleValue; List <ObjectInfo> properties; if (TryGetSingleValue(objectInfo, out singleValue, out properties)) { _output.Write(singleValue ?? NullValue); } else { _output.Write("[" + typeOfOjbToAppend.Name + "]: hashcode { " + objToAppend.GetHashCode() + " }"); if (_config.IncludeLogging) { var inspectorName = objectInfo.Inspector == null ? NullValue : objectInfo.Inspector.GetType().Name; _output.Write(" - Inspector { " + inspectorName + " } "); } _objectInfosPrinter.Write(properties); } } //we are done printing the descendents of this object. //free it to be printed in another section. _objStack.Pop(); }
void IPlasticAPI.RemovePermissions(string server, ObjectInfo obj, SEID seid) { throw new NotImplementedException(); }
private void WriteObject(ObjectInfo objectInfo) { _currentDepth++; WriteObjectImpl(objectInfo); _currentDepth--; }
SEID IPlasticAPI.GetOwner(string server, ObjectInfo obj) { throw new NotImplementedException(); }
/// <summary> /// Writes the log. /// </summary> /// <param name="context">The context.</param> /// <param name="stream">The stream.</param> /// <param name="callback">The callback for UI updates.</param> public void WriteLog(IExecutionContext context, Stream stream, ProgressCallback callback) { SortedList oidInfo = new SortedList(); IList CombatWaitMessage = new ArrayList(); Hashtable styleIcons = new Hashtable(); Hashtable plrInfo = new Hashtable(); weapons = new StoC_0x02_InventoryUpdate.Item[4]; PlayerInfo playerInfo = null; // = new PlayerInfo(); int playerOid = -1; string nameKey = ""; string statKey = ""; string plrName = ""; string plrClass = ""; int plrLevel = 0; int countBC = 0; using (StreamWriter s = new StreamWriter(stream)) { foreach (PacketLog log in context.LogManager.Logs) { for (int i = 0; i < log.Count; i++) { if (callback != null && (i & 0xFFF) == 0) // update progress every 4096th packet { callback(i, log.Count - 1); } Packet pak = log[i]; // Enter region (get new self OID) if (pak is StoC_0x20_PlayerPositionAndObjectID) { StoC_0x20_PlayerPositionAndObjectID plr = (StoC_0x20_PlayerPositionAndObjectID)pak; playerOid = plr.PlayerOid; oidInfo.Clear(); oidInfo[plr.PlayerOid] = new ObjectInfo(eObjectType.player, "You", 0); s.WriteLine("{0, -16} playerOid:0x{1:X4}", pak.Time.ToString(), playerOid); } // Fill objects OID else if (pak is StoC_0xD4_PlayerCreate) { StoC_0xD4_PlayerCreate player = (StoC_0xD4_PlayerCreate)pak; oidInfo[player.Oid] = new ObjectInfo(eObjectType.player, player.Name, player.Level); } else if (pak is StoC_0x4B_PlayerCreate_172) { StoC_0x4B_PlayerCreate_172 player = (StoC_0x4B_PlayerCreate_172)pak; oidInfo[player.Oid] = new ObjectInfo(eObjectType.player, player.Name, player.Level); } else if (pak is StoC_0x12_CreateMovingObject) { StoC_0x12_CreateMovingObject obj = (StoC_0x12_CreateMovingObject)pak; oidInfo[obj.ObjectOid] = new ObjectInfo(eObjectType.movingObject, obj.Name, 0); } else if (pak is StoC_0x6C_KeepComponentOverview) { StoC_0x6C_KeepComponentOverview keep = (StoC_0x6C_KeepComponentOverview)pak; oidInfo[keep.Uid] = new ObjectInfo(eObjectType.keep, string.Format("keepId:0x{0:X4} componentId:{1}", keep.KeepId, keep.ComponentId), 0); } else if (pak is StoC_0xDA_NpcCreate) { StoC_0xDA_NpcCreate npc = (StoC_0xDA_NpcCreate)pak; oidInfo[npc.Oid] = new ObjectInfo(eObjectType.npc, npc.Name, npc.Level); } else if (pak is StoC_0xD9_ItemDoorCreate) { StoC_0xD9_ItemDoorCreate item = (StoC_0xD9_ItemDoorCreate)pak; eObjectType type = eObjectType.staticObject; if (item.ExtraBytes > 0) { type = eObjectType.door; } oidInfo[item.Oid] = new ObjectInfo(type, item.Name, 0); } // Fill current weapons else if (pak is StoC_0x02_InventoryUpdate) { StoC_0x02_InventoryUpdate invPack = (StoC_0x02_InventoryUpdate)pak; if (invPack.PreAction == 1 || invPack.PreAction == 0) { VisibleSlots = invPack.VisibleSlots; for (int j = 0; j < invPack.SlotsCount; j++) { StoC_0x02_InventoryUpdate.Item item = (StoC_0x02_InventoryUpdate.Item)invPack.Items[j]; switch (item.slot) { case 10: weapons[0] = item; break; case 11: weapons[1] = item; break; case 12: weapons[2] = item; break; case 13: weapons[3] = item; break; default: break; } } } } // Fill character stats else if (pak is StoC_0x16_VariousUpdate) { // name, level, class StoC_0x16_VariousUpdate stat = (StoC_0x16_VariousUpdate)pak; if (stat.SubCode == 3) { StoC_0x16_VariousUpdate.PlayerUpdate subData = (StoC_0x16_VariousUpdate.PlayerUpdate)stat.SubData; nameKey = "N:" + subData.playerName + "L:" + subData.playerLevel; statKey = ""; plrName = subData.playerName; plrLevel = subData.playerLevel; plrClass = subData.className; s.WriteLine("{0, -16} 0x16:3 nameKey:{1} plrName:{2} {3} {4}", pak.Time.ToString(), nameKey, plrName, plrLevel, plrClass); } // mainhand spec, mainhand DPS else if (stat.SubCode == 5) { StoC_0x16_VariousUpdate.PlayerStateUpdate subData = (StoC_0x16_VariousUpdate.PlayerStateUpdate)stat.SubData; string key = string.Format("WD:{0}.{1}WS:{2}", subData.weaponDamageHigh, subData.weaponDamageLow, (subData.weaponSkillHigh << 8) + subData.weaponSkillLow); if (nameKey != "") { if (plrInfo.ContainsKey(nameKey + key)) { playerInfo = (PlayerInfo)plrInfo[nameKey + key]; } else { playerInfo = new PlayerInfo(); playerInfo.name = plrName; playerInfo.level = plrLevel; playerInfo.className = plrClass; playerInfo.weaponDamage = string.Format("{0,2}.{1,-3}", subData.weaponDamageHigh, subData.weaponDamageLow); playerInfo.weaponSkill = (subData.weaponSkillHigh << 8) + subData.weaponSkillLow; plrInfo.Add(nameKey + key, playerInfo); } plrInfo[nameKey + key] = playerInfo; } statKey = key; s.WriteLine("{0, -16} 0x16:5 S:{1} {2} {3} {4} {5}", pak.Time.ToString(), statKey, playerInfo.name, playerInfo.level, playerInfo.weaponDamage, playerInfo.weaponSkill); } // Fill styles if (stat.SubCode == 1) { StoC_0x16_VariousUpdate.SkillsUpdate subData = (StoC_0x16_VariousUpdate.SkillsUpdate)stat.SubData; styleIcons.Clear(); if (log.Version < 186) { styleIcons.Add((ushort)0x01F4, "Bow prepare"); styleIcons.Add((ushort)0x01F5, "Lefthand hit"); styleIcons.Add((ushort)0x01F6, "Bothhands hit"); styleIcons.Add((ushort)0x01F7, "Bow shoot"); // styleIcons.Add((ushort)0x01F9, "Volley aim ?"); // styleIcons.Add((ushort)0x01FA, "Volley ready ?"); // styleIcons.Add((ushort)0x01FB, "Volley shoot ?"); } else { styleIcons.Add((ushort)0x3E80, "Bow prepare"); styleIcons.Add((ushort)0x3E81, "Lefthand hit"); styleIcons.Add((ushort)0x3E82, "Bothhands hit"); styleIcons.Add((ushort)0x3E83, "Bow shoot"); // styleIcons.Add((ushort)0x3E85, "Volley aim ?"); // styleIcons.Add((ushort)0x3E86, "Volley ready ?"); // styleIcons.Add((ushort)0x3E87, "Volley shoot ?"); } foreach (StoC_0x16_VariousUpdate.Skill skill in subData.data) { if (skill.page == StoC_0x16_VariousUpdate.eSkillPage.Styles) { styleIcons[skill.icon] = skill.name; // s.WriteLine("{0, -16} 0x16:1 icon:0x{1:X4} name:{2}", pak.Time.ToString(), skill.icon, styleIcons[skill.icon]); } } /* foreach (DictionaryEntry entry in styleIcons) * { * ushort icon = (ushort)entry.Key; * s.WriteLine("{0, -16} 0x16:1 icon:0x{1:X4} name:{2}", pak.Time.ToString(), icon, entry.Value); * }*/ } } // Combat animation else if (pak is StoC_0xBC_CombatAnimation && (playerInfo != null)) { StoC_0xBC_CombatAnimation combat = (StoC_0xBC_CombatAnimation)pak; CombatWaitMessage.Clear(); ObjectInfo targetObj = oidInfo[combat.DefenderOid] as ObjectInfo; string styleName = (combat.StyleId == 0 /* || (combat.Result & 0x7F) != 0x0B)*/) ? "" : (styleIcons[combat.StyleId] == null ? "not found " + combat.StyleId.ToString() : (styleIcons[combat.StyleId]).ToString()); string targetName = targetObj == null ? "" : " target:" + targetObj.name + " (" + targetObj.type + ")"; if (combat.Stance == 0 && combat.AttackerOid == playerOid /* && combat.DefenderOid != 0*/) { switch (combat.Result & 0x7F) { case 0: CombatWaitMessage.Add(new WaitMessage(0x11, "You miss!")); CombatWaitMessage.Add(new WaitMessage(0x11, "You were strafing in combat and miss!")); break; case 1: if (targetObj != null) { CombatWaitMessage.Add(new WaitMessage(0x11, targetObj.GetFirstFullName + " parries your attack!")); } break; case 2: // if (targetObj != null)//TODO // CombatWaitMessage.Add(new WaitMessage(0x11, targetObj.GetFirstFullName + " The Midgardian Assassin attacks you and you block the blow!")); break; case 3: if (targetObj != null) { CombatWaitMessage.Add(new WaitMessage(0x11, targetObj.GetFirstFullName + " evades your attack!")); } break; case 4: CombatWaitMessage.Add(new WaitMessage(0x11, "You fumble the attack and take time to recover!")); break; case 0xA: if (targetObj != null) { CombatWaitMessage.Add( new WaitMessage(0x11, "You attack " + targetObj.GetFullName + " with your % and hit for % damage!")); } break; case 0xB: CombatWaitMessage.Add(new WaitMessage(0x11, "You perform your " + styleName + " perfectly. %")); if (targetObj != null) { CombatWaitMessage.Add( new WaitMessage(0x11, "You attack " + targetObj.GetFullName + " with your % and hit for % damage!")); } break; case 0x14: if (targetObj != null) { CombatWaitMessage.Add(new WaitMessage(0x11, "You hit " + targetObj.GetFullName + " for % damage!")); } break; default: break; } } if (combat.AttackerOid == playerOid) { s.WriteLine("{0, -16} 0xBC attackerOid:0x{1:X4}(You) defenderOid:0x{2:X4} style:0x{4:X4} result:0x{3:X2}{5}{6}", pak.Time.ToString(), combat.AttackerOid, combat.DefenderOid, combat.Result, combat.StyleId, styleName == "" ? "" : " styleName:" + styleName, targetName); foreach (WaitMessage msg in CombatWaitMessage) { s.WriteLine(" WAITING 0xAF 0x{0:X2} {1}", msg.msgType, msg.message); } countBC++; } } // Messages else if (pak is StoC_0xAF_Message) { StoC_0xAF_Message msg = (StoC_0xAF_Message)pak; switch (msg.Type) { // case 0x10: // Your cast combat case 0x11: // Your Melee combat // case 0x1B: // resist // case 0x1D: // X hits you // case 0x1E: // X miss you s.WriteLine("{0, -16} 0xAF 0x{1:X2} {2} ", pak.Time.ToString(), msg.Type, msg.Text); break; default: break; } } } } if (nameKey != "" && statKey != "") { plrInfo[nameKey + statKey] = playerInfo; } } }
/// <summary> /// 获得该Dll所有引出函数信息 /// </summary> /// <returns></returns> public ObjectInfo[] GetFunctionsInfo() { ObjectInfo[] objectInfos = new ObjectInfo[18]; objectInfos[0].Name = "Fun_Ts_zyys_yzgl"; objectInfos[0].Text = "医嘱管理"; objectInfos[0].Remark = "医嘱管理"; objectInfos[1].Name = "Fun_Ts_zyys_mzyz"; objectInfos[1].Text = "医嘱录入"; objectInfos[1].Remark = "医嘱录入"; objectInfos[2].Name = "Fun_Ts_zyys_hsyz"; objectInfos[2].Text = "护士医嘱"; objectInfos[2].Remark = "护士医嘱"; objectInfos[3].Name = "Fun_Ts_zyys_hszd"; objectInfos[3].Text = "护士账单"; objectInfos[3].Remark = "护士账单"; objectInfos[4].Name = "Fun_Ts_zyys_dlwh"; objectInfos[4].Text = "医嘱滴量维护"; objectInfos[4].Remark = "医嘱滴量维护"; objectInfos[5].Name = "Fun_Ts_zyys_qxwh"; objectInfos[5].Text = "医嘱权限维护"; objectInfos[5].Remark = "医嘱权限维护"; objectInfos[6].Name = "Fun_Ts_zyys_qxmxwh"; objectInfos[6].Text = "医嘱权限明细维护"; objectInfos[6].Remark = "医嘱权限明细维护"; objectInfos[7].Name = "Fun_Ts_zyys_qxmxwh_ks"; objectInfos[7].Text = "医嘱开立权限控制"; objectInfos[7].Remark = "医嘱开立权限控制"; objectInfos[8].Name = "Fun_Ts_ksSpr"; objectInfos[8].Text = "科室审核人管理"; objectInfos[8].Remark = "科室审核人管理"; objectInfos[9].Name = "Fun_Ts_ksssh"; objectInfos[9].Text = "限制级抗菌药物审核"; objectInfos[9].Remark = "限制级抗菌药物审核"; objectInfos[10].Name = "Fun_Ts_zyys_kjwdy"; objectInfos[10].Text = "特殊抗菌物打印"; objectInfos[10].Remark = "特殊抗菌物打印"; objectInfos[11].Name = "Fun_Ts_SsYp"; objectInfos[11].Text = "手术药品管理"; objectInfos[11].Remark = "手术药品管理"; objectInfos[12].Name = "Fun_Ts_zyys_tsksShr"; objectInfos[12].Text = "特殊级抗菌药物维护人员"; objectInfos[12].Remark = "特殊级抗菌药物维护人员"; objectInfos[13].Name = "Fun_Ts_zyys_tsksSh"; objectInfos[13].Text = "特殊级抗菌药物审核"; objectInfos[13].Remark = "特殊级抗菌药物审核"; objectInfos[14].Name = "Fun_Ts_zyys_KssYymd"; objectInfos[14].Text = "用药目的维护"; objectInfos[14].Remark = "用药目的维护"; objectInfos[15].Name = "Fun_Ts_zyys_QueryDisease"; objectInfos[15].Text = "诊断查询"; objectInfos[15].Remark = "诊断查询"; objectInfos[16].Name = "Fun_Ts_zyys_KssItem"; objectInfos[16].Text = "切口等级对应抗生素"; objectInfos[16].Remark = "切口等级对应抗生素"; objectInfos[17].Name = "Fun_Ts_zyys_H7N9"; objectInfos[17].Text = "H7N9开单权限控制"; objectInfos[17].Remark = "H7N9开单权限控制"; return(objectInfos); }
public void PrintWithInvalidEnumerationLength() { // Act & Assert ExceptionAssert.ThrowsArgGreaterThan(() => ObjectInfo.Print(null, enumerationLength: -1), "enumerationLength", "0"); }
public object GetDefaultObject(ObjectInfo <object> info) { return(new FilterMatchedPeptidesSettings(false, false, false, false, false, false, false)); }
private static ObjectInfo GetObjectInfo(ref ArrayEntry objectEntry, SM3DWorldZone zone) { Dictionary <string, DictionaryEntry> properties = new Dictionary <string, DictionaryEntry>(); Dictionary <string, DictionaryEntry> links = new Dictionary <string, DictionaryEntry>(); ObjectInfo info = new ObjectInfo(); foreach (DictionaryEntry entry in objectEntry.IterDictionary()) { switch (entry.Key) { case "Comment": case "IsLinkDest": case "LayerConfigName": break; //ignore these case "Id": info.ID = entry.Parse(); break; case "Links": foreach (DictionaryEntry linkEntry in entry.IterDictionary()) { links.Add(linkEntry.Key, linkEntry); } break; case "ModelName": info.ModelName = entry.Parse() ?? ""; break; case "Rotate": dynamic _data = entry.Parse(); info.Rotation = new Vector3( _data["X"], _data["Y"], _data["Z"] ); break; case "Scale": _data = entry.Parse(); info.Scale = new Vector3( _data["X"], _data["Y"], _data["Z"] ); break; case "Translate": _data = entry.Parse(); info.Position = new Vector3( _data["X"] / 100f, _data["Y"] / 100f, _data["Z"] / 100f ); break; case "UnitConfigName": info.ObjectName = entry.Parse(); break; case "UnitConfig": _data = entry.Parse(); info.DisplayTranslation = new Vector3( _data["DisplayTranslate"]["X"] / 100f, _data["DisplayTranslate"]["Y"] / 100f, _data["DisplayTranslate"]["Z"] / 100f ); info.DisplayRotation = new Vector3( _data["DisplayRotate"]["X"], _data["DisplayRotate"]["Y"], _data["DisplayRotate"]["Z"] ); info.DisplayScale = new Vector3( _data["DisplayScale"]["X"], _data["DisplayScale"]["Y"], _data["DisplayScale"]["Z"] ); info.ClassName = _data["ParameterConfigName"]; break; default: properties.Add(entry.Key, entry); break; } } info.PropertyEntries = properties; info.LinkEntries = links; return(info); }
/// <summary> /// Parses a 3d World from an ArrayEntry /// </summary> /// <param name="objectEntry"></param> /// <param name="zone"></param> /// <param name="objectsByReference"></param> /// <returns></returns> public static I3dWorldObject ParseObject(ArrayEntry objectEntry, SM3DWorldZone zone, Dictionary <long, I3dWorldObject> objectsByReference, out bool alreadyInLinks, Dictionary <string, I3dWorldObject> linkedObjsByID, bool isLinked = false) { ObjectInfo info = GetObjectInfo(ref objectEntry, zone); I3dWorldObject obj; bool loadLinks; if (Enum.GetNames(typeof(Rail.RailObjType)).Contains(info.ClassName)) { obj = new Rail(info, zone, out loadLinks); } else { obj = new General3dWorldObject(info, zone, out loadLinks); } if (linkedObjsByID != null && isLinked) { if (!linkedObjsByID.ContainsKey(info.ID)) { linkedObjsByID.Add(info.ID, obj); } else { alreadyInLinks = true; obj = linkedObjsByID[info.ID]; if (!isLinked) { alreadyInLinks = !zone.LinkedObjects.Remove(obj); } //in case this object was already read in another file if (!objectsByReference.ContainsKey(objectEntry.Position)) { objectsByReference.Add(objectEntry.Position, obj); } return(obj); } } alreadyInLinks = false; if (!objectsByReference.ContainsKey(objectEntry.Position)) { objectsByReference.Add(objectEntry.Position, obj); } else if (!isLinked) { obj = objectsByReference[objectEntry.Position]; zone.LinkedObjects.Remove(obj); return(obj); } if (loadLinks) { obj.Links = new Dictionary <string, List <I3dWorldObject> >(); foreach (DictionaryEntry link in info.LinkEntries.Values) { obj.Links.Add(link.Key, new List <I3dWorldObject>()); foreach (ArrayEntry linked in link.IterArray()) { if (objectsByReference.ContainsKey(linked.Position)) { obj.Links[link.Key].Add(objectsByReference[linked.Position]); objectsByReference[linked.Position].AddLinkDestination(link.Key, obj); } else { I3dWorldObject _obj = ParseObject(linked, zone, objectsByReference, out bool linkedAlreadyReferenced, linkedObjsByID, true); _obj.AddLinkDestination(link.Key, obj); obj.Links[link.Key].Add(_obj); if (zone != null && !linkedAlreadyReferenced) { zone.LinkedObjects.Add(_obj); } } } } if (obj.Links.Count == 0) { obj.Links = null; } } return(obj); }
public void For_ReturnsTupleObjectInfo_ForTypeOfTupleT3() { var objectInfo = ObjectInfo.For(typeof(Tuple <int, string, DateTime>)); Assert.IsType <TupleObjectInfo>(objectInfo); }
public void For_ReturnsTupleObjectInfo_ForTypeOfTupleT7() { var objectInfo = ObjectInfo.For(typeof(Tuple <int, string, DateTime, bool, decimal, double, Guid>)); Assert.IsType <TupleObjectInfo>(objectInfo); }
public void PrintWithNegativeDepthThrows() { // Act & Assert ExceptionAssert.ThrowsArgGreaterThanOrEqualTo(() => ObjectInfo.Print(null, depth: -1), "depth", "0"); }
public static void CreateBundle(string vfsUrl, IOdbBackend backend, ObjectId[] objectIds, ISet <ObjectId> disableCompressionIds, Dictionary <string, ObjectId> indexMap, IList <string> dependencies) { if (objectIds.Length == 0) { throw new InvalidOperationException("Nothing to pack."); } // Early exit if package didn't change (header-check only) if (VirtualFileSystem.FileExists(vfsUrl)) { try { using (var packStream = VirtualFileSystem.OpenStream(vfsUrl, VirtualFileMode.Open, VirtualFileAccess.Read)) { var bundle = ReadBundleDescription(packStream); // If package didn't change since last time, early exit! if (ArrayExtensions.ArraysEqual(bundle.Dependencies, dependencies) && ArrayExtensions.ArraysEqual(bundle.Assets.OrderBy(x => x.Key).ToList(), indexMap.OrderBy(x => x.Key).ToList()) && ArrayExtensions.ArraysEqual(bundle.Objects.Select(x => x.Key).OrderBy(x => x).ToList(), objectIds.OrderBy(x => x).ToList())) { return; } } } catch (Exception) { // Could not read previous bundle (format changed?) // Let's just mute this error as new bundle will overwrite it anyway } } using (var packStream = VirtualFileSystem.OpenStream(vfsUrl, VirtualFileMode.Create, VirtualFileAccess.Write)) { var header = new Header(); header.MagicHeader = Header.MagicHeaderValid; var binaryWriter = new BinarySerializationWriter(packStream); binaryWriter.Write(header); // Write dependencies binaryWriter.Write(dependencies.ToList()); // Save location of object ids var objectIdPosition = packStream.Position; // Write empty object ids (reserve space, will be rewritten later) var objects = new List <KeyValuePair <ObjectId, ObjectInfo> >(); for (int i = 0; i < objectIds.Length; ++i) { objects.Add(new KeyValuePair <ObjectId, ObjectInfo>(objectIds[i], new ObjectInfo())); } binaryWriter.Write(objects); objects.Clear(); // Write index binaryWriter.Write(indexMap.ToList()); for (int i = 0; i < objectIds.Length; ++i) { using (var objectStream = backend.OpenStream(objectIds[i])) { // Prepare object info var objectInfo = new ObjectInfo { StartOffset = packStream.Position, SizeNotCompressed = objectStream.Length }; // re-order the file content so that it is not necessary to seek while reading the input stream (header/object/refs -> header/refs/object) var inputStream = objectStream; var originalStreamLength = objectStream.Length; var streamReader = new BinarySerializationReader(inputStream); var chunkHeader = ChunkHeader.Read(streamReader); if (chunkHeader != null) { // create the reordered stream var reorderedStream = new MemoryStream((int)originalStreamLength); // copy the header var streamWriter = new BinarySerializationWriter(reorderedStream); chunkHeader.Write(streamWriter); // copy the references var newOffsetReferences = reorderedStream.Position; inputStream.Position = chunkHeader.OffsetToReferences; inputStream.CopyTo(reorderedStream); // copy the object var newOffsetObject = reorderedStream.Position; inputStream.Position = chunkHeader.OffsetToObject; inputStream.CopyTo(reorderedStream, chunkHeader.OffsetToReferences - chunkHeader.OffsetToObject); // rewrite the chunk header with correct offsets chunkHeader.OffsetToObject = (int)newOffsetObject; chunkHeader.OffsetToReferences = (int)newOffsetReferences; reorderedStream.Position = 0; chunkHeader.Write(streamWriter); // change the input stream to use reordered stream inputStream = reorderedStream; inputStream.Position = 0; } // compress the stream if (!disableCompressionIds.Contains(objectIds[i])) { objectInfo.IsCompressed = true; var lz4OutputStream = new LZ4Stream(packStream, CompressionMode.Compress); inputStream.CopyTo(lz4OutputStream); lz4OutputStream.Flush(); } else // copy the stream "as is" { // Write stream inputStream.CopyTo(packStream); } // release the reordered created stream if (chunkHeader != null) { inputStream.Dispose(); } // Add updated object info objectInfo.EndOffset = packStream.Position; objects.Add(new KeyValuePair <ObjectId, ObjectInfo>(objectIds[i], objectInfo)); } } // Rewrite header header.Size = packStream.Length; packStream.Position = 0; binaryWriter.Write(header); // Rewrite object locations packStream.Position = objectIdPosition; binaryWriter.Write(objects); } }
public DbObjectSaver(ObjectInfo info, QueryComposer composer, DataProvider provider, IDbObjectHandler handler) : base(info, composer, provider, handler) { }
public ObjectPanel(ObjectInfo info) { if(info == null) { this.Content = null; return; } TabControl _tabs = new TabControl(); var tabs = ExtensionManager.GetExtensions<IObjectTab>() .OrderBy(tab => tab.Order); foreach(var tab in tabs) { if(tab.Active(info)) { _tabs.Pages.Add(tab.Create(info)); } } if (_tabs.Pages.Count > 0) this.Content = _tabs; else this.Content = null; }