public void ExecuteProcedure(string io_nameProcedure) { try { CurrentObject.GetType().InvokeMember(io_nameProcedure, BindingFlags.InvokeMethod, null, CurrentObject, null); } catch (Exception lo_ex) { Debug.WriteLine(lo_ex.Message); } }
public NexoObjectToProcess(NexoItem item) { Item = item; CanModifyAction = true; Action = NexoNextAction.nothing; SuggestedAction = NexoNextAction.nothing; CurrentObject = NexoItem.AllocateObject(item.Category); CurrentObject.FromItem(item); //Response = new NexoResponseType(CurrentObject.Response); }
public void SetProperty(string io_nameProperty, object[] io_params) { try { CurrentObject.GetType().InvokeMember(io_nameProperty, BindingFlags.Public | BindingFlags.SetProperty, null, CurrentObject, io_params); } catch (Exception lo_ex) { QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, lo_ex.Message); Debug.WriteLine(lo_ex.Message); } }
private bool ValidateDataSources() { PrepareValidation(); bool isValid = _dataEditControl.Validate(); isValid &= CurrentObject.Validate(); return(isValid); }
//======================================================================================================= // Private Methods //======================================================================================================= #region AddNewProperty() private void AddNewProperty() { if (CurrentObject != null) { Property prop = new Property(CurrentObject); CurrentObject.AddNewProperty(prop); CurrentProps.Add(new PropertyCreator(prop)); OnPropertyChanged("CurrentProps"); } }
protected string SaveFile(UploadedFile uploadedFile) { //IObjectSpace os = ((DevExpress.ExpressApp.DetailView)(View)).ObjectSpace; Session sess = (View.ObjectSpace as DevExpress.ExpressApp.Xpo.XPObjectSpace).Session; fileuploads = new FileUploads(sess); string appDir = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath; string appUrl = "./"; if (uploadedFile.IsValid) { fileuploads.Name = uploadedFile.FileName; fileuploads.FileName = uploadedFile.FileName; fileuploads.FileSize = uploadedFile.ContentLength; fileuploads.FileType = uploadedFile.ContentType; //PostedFile fileuploads.FileExt = System.IO.Path.GetExtension(uploadedFile.FileName); string savePath; savePath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + @"Uploads\"; savePath += CurrentObject.GetType().Name + @"\"; if (!Directory.Exists(savePath)) { Directory.CreateDirectory(@savePath); } //Thêm số thứ tự vào tên file để tránh trùng lặp file if (File.Exists(string.Format("{0}{1}", savePath, fileuploads.FileName))) { int i = 1; string tmpFileName = string.Format("{0}.{1}{2}", fileuploads.FileName.Substring(0, fileuploads.FileName.Length - fileuploads.FileExt.Length), i, fileuploads.FileExt); while (File.Exists(string.Format("{0}{1}", savePath, tmpFileName))) { i++; tmpFileName = string.Format("{0}.{1}{2}", fileuploads.FileName.Substring(0, fileuploads.FileName.Length - fileuploads.FileExt.Length), i, fileuploads.FileExt); } fileuploads.FileName = tmpFileName; //File.Delete(string.Format("{0}{1}", savePath, fileuploads.FileName)); } uploadedFile.SaveAs(string.Format("{0}{1}", savePath, fileuploads.FileName)); //uncomment this line fileuploads.FileRealPath = savePath; if (HttpContext.Current != null) { appUrl = HttpContext.Current.Request.Url.Authority; } fileuploads.FileUrl = string.Format("{0}\\{1}{2}", appUrl, fileuploads.FileRealPath.Replace(appDir, ""), fileuploads.FileName); fileuploads.Save(); (CurrentObject as FleAttachments).FileAttachments.Add(fileuploads); (CurrentObject as FleAttachments).Save(); //sess.CommitTransaction(); //fileuploads.Session.CommitTransaction(); } return(fileuploads.Name); }
private void OnOverrideRemoved(object sender, ParameterEventArgs args) { //Debug if (CurrentObject.TryGetParameter(args.Parameter.Name, out IO.Swagger.Model.Parameter parameter)) { if (overrides.TryGetValue(args.Parameter.Name, out ActionObjectParameterOverride parameterOverride)) { parameterOverride.SetValue(Parameter.GetStringValue(parameter.Value, parameter.Type), false); } } }
protected override bool ValidatePage() { bool isValid = true; isValid &= base.ValidatePage(); isValid &= ValidateAccessControlLists(); isValid &= CurrentObjectHeaderControls.Validate(); isValid &= CurrentObject.Validate(); return(isValid); }
public Object1C ExecuteFunction(string io_nameFunction, object[] io_params = null) { try { return(new Object1C(CurrentObject.GetType().InvokeMember(io_nameFunction, BindingFlags.Public | BindingFlags.InvokeMethod, null, CurrentObject, io_params))); } catch (Exception lo_ex) { QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, lo_ex.Message); Debug.WriteLine(lo_ex.Message); } return(null); }
private bool SaveValues(bool interim) { var hasSaved = true; if (_dataEditControl != null) { hasSaved &= _dataEditControl.SaveValues(interim); } hasSaved &= CurrentObject.SaveValues(interim); return(hasSaved); }
public static WebObject.Base FindWebObjectByName(string Name, List <WebObject.Base> WebObjectList) { foreach (WebObject.Base CurrentObject in WebObjectList) { if (CurrentObject.GetName() == Name) { return(CurrentObject); } } return(new WebObject.Base("error", new WebProject(), "", "")); }
protected override void LoadValues(bool interim) { base.LoadValues(interim); LoadAccessControlLists(interim); CurrentObjectHeaderControls.BusinessObject = CurrentSecurableClassDefinition; CurrentObjectHeaderControls.LoadValues(interim); CurrentObject.BusinessObject = CurrentSecurableClassDefinition; CurrentObject.LoadValues(interim); }
private void SaveRotation(IMuteMap map) { var layer = map.GetLayer(CurrentObject.LayerHandle); var fs = layer.FeatureSet; var feature = fs.Features[CurrentObject.ObjectIndex]; if (feature == null) { return; } CurrentObject.SaveRotationField(layer); }
private void ButtonAtom_Click(object sender, EventArgs e) { SelectedTool = DiagramAction.PlaceAtom; MessageBoxText = "Atom tool selected."; AtomSelectionForm sForm = new AtomSelectionForm(); sForm.ShowDialog(); var par = CurrentObject.GetInternalParameters(); MessageBoxText = par["Symbol"] + " selected."; }
public void ShowModelOnEE() { if (model != null) { HideModelOnEE(); } model = CurrentObject.GetModelCopy(); if (model == null) { return; } UpdateModelOnEE(); }
public Object1C GetProperty(string io_nameParam) { object lo_resObject = null; try { lo_resObject = CurrentObject.GetType().InvokeMember(io_nameParam, BindingFlags.GetProperty, null, CurrentObject, null); } catch (Exception lo_ex) { QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, lo_ex.Message); Debug.WriteLine(lo_ex.Message); } return(new Object1C(lo_resObject)); }
public override void UpdateMenu() { base.UpdateMenu(); overrides.Clear(); createAPBtn.SetInteractivity(CurrentObject.ActionObjectMetadata.HasPose); foreach (Parameter param in CurrentObject.ObjectParameters.Values.ToList()) { ActionObjectParameterOverride overrideParam = Instantiate(ParameterOverridePrefab, Parameters.transform).GetComponent <ActionObjectParameterOverride>(); overrideParam.transform.SetAsLastSibling(); overrideParam.Init(param.GetStringValue(), false, param.ParameterMetadata, CurrentObject.Data.Id); Debug.LogError(CurrentObject.Overrides.Count); if (CurrentObject.Overrides.TryGetValue(param.Name, out Parameter p)) { Debug.LogError(p); overrideParam.SetValue(p.GetStringValue(), true); } overrides[param.Name] = overrideParam; } foreach (ActionPoint actionPoint in CurrentObject.GetActionPoints()) { Button button = GameManager.Instance.CreateButton(ActionPointsList.transform, actionPoint.Data.Name); button.onClick.AddListener(() => ShowActionPoint(actionPoint)); // Add EventTrigger OnPointerEnter and OnPointerExit - to be able to highlight corresponding AP when hovering over button OutlineOnClick APoutline = actionPoint.GetComponent <OutlineOnClick>(); EventTrigger eventTrigger = button.gameObject.AddComponent <EventTrigger>(); // Create OnPointerEnter entry EventTrigger.Entry OnPointerEnter = new EventTrigger.Entry { eventID = EventTriggerType.PointerEnter }; OnPointerEnter.callback.AddListener((eventData) => APoutline.Highlight()); eventTrigger.triggers.Add(OnPointerEnter); // Create OnPointerExit entry EventTrigger.Entry OnPointerExit = new EventTrigger.Entry { eventID = EventTriggerType.PointerExit }; OnPointerExit.callback.AddListener((eventData) => APoutline.UnHighlight()); eventTrigger.triggers.Add(OnPointerExit); } }
public DisposableAction PushObject(ObjectBuildRecord buildRecord) { if (IsDisposed) { throw new ObjectDisposedException("BuildSession"); } if (!buildRecord.Counted) { if (BuilderInstanceTracker.IncludeInCount(buildRecord.Type)) { ConstructedCount++; } buildRecord.Counted = true; } CurrentObject = CurrentObject.AddChild(buildRecord); _constructedNodes.Add(CurrentObject); return(new DisposableAction(PopObject)); }
public MovingWallE(GameObject wallE) { Hp = 180; Score = 10; Speed = 3f; StartingPosition = new Vector3(256.665f, 1f, 170.023f); Scale = new Vector3(0.2f, 0.2f, 0.2f); Rotation = Quaternion.Euler(0f, 90f, 0f); CurrentObject = Instantiate(wallE); CurrentObject.transform.position = StartingPosition; CurrentObject.transform.localScale = Scale; CurrentObject.transform.localRotation = Rotation; CurrentObject.GetComponent <Rigidbody>().drag = 0; CurrentObject.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); CurrentObject.GetComponent <Rigidbody>().freezeRotation = true; }
private void RotateSymbol(IMuteMap map, double dx, double dy, bool snapToFeatures = false, bool snapToAxes = false) { var layer = map.GetLayer(CurrentObject.LayerHandle); var fs = layer.FeatureSet; var feature = fs.Features[CurrentObject.ObjectIndex]; if (feature == null) { return; } var projCoordinate = _context.Map.PixelToProj(new Coordinate(dx, dy)); CurrentObject.UpdateRotationField(layer, projCoordinate.X, projCoordinate.Y, snapToFeatures, snapToAxes); map.Redraw(); }
public MovingElephant(GameObject elephant) { Hp = 150; Score = 6; Speed = 4f; StartingPosition = new Vector3(260f, 0.6f, 170.023f); Scale = new Vector3(100f, 100f, 100f); Rotation = Quaternion.Euler(0f, 180f, 0f); CurrentObject = Instantiate(elephant); CurrentObject.transform.position = StartingPosition; CurrentObject.transform.localScale = Scale; CurrentObject.transform.localRotation = Rotation; CurrentObject.GetComponent <Rigidbody>().drag = 0; CurrentObject.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); CurrentObject.GetComponent <Rigidbody>().freezeRotation = true; }
private object CreateObject(TeamEmployeeDisplay Item, object CurrentObjectValue) { object obj = null; obj = _ObjectSpace.CreateObject(MemberInfo.ListElementTypeInfo.Type); if (Item.Employee != null) { obj.SetPropertyValue("Employee", _ObjectSpace.FindObject <Employee>(new BinaryOperator("Oid", Item.ID))); } else { obj.SetPropertyValue("Team", _ObjectSpace.FindObject <Team>(new BinaryOperator("Oid", Item.ID))); } obj.SetPropertyValue(CurrentObject.GetType().BaseType.Name, _ObjectSpace.FindObject(CurrentObject.GetType(), new BinaryOperator("Oid", ((BaseObject)CurrentObject).Oid))); return(obj); }
public static List <TreeNode> PopulateTreeNodes(List <IContainer> ObjectList) { var TreeNodes = new List <TreeNode>(); foreach (var CurrentObject in ObjectList) { var CurrentNode = new TreeNode(CurrentObject.Name); CurrentNode.Tag = CurrentObject; if (CurrentObject.GetType().GetProperty("InnerStorage") != null) { CurrentNode.Nodes.AddRange( PopulateTreeNodes(CurrentObject.InnerStorage).ToArray() ); } TreeNodes.Add(CurrentNode); } return(TreeNodes); }
private void ObjectSpace_Committed(object sender, EventArgs e) { //检查规则,并执行。有条件、无条件情况 var actions = ActionInfos.Where(x => x.动作类型 == 动作类型.单据创建时执行 || x.动作类型 == 动作类型.单据满足条件时执行); foreach (var item in actions) { var isCondition = true; if (item.动作类型 == 动作类型.单据满足条件时执行) { isCondition = (bool)CurrentObject.Evaluate(item.生效条件); } if (isCondition) { var newOs = Application.CreateObjectSpace(); ExecuteAction(newOs, CurrentObject as 单据, item); } } }
private void ParseRhinoMeshes() { HashSet <RhinoObject> DocObjects = CollectExportedRhinoObjects(RhinoDocument, InstanceDefinitionHierarchyNodeDictionary.Values); // Make sure all render meshes are generated before attempting to export them. RhinoObject.GetRenderMeshes(DocObjects, /*okToCreate=*/ true, /*returnAllObjects*/ false); foreach (RhinoObject CurrentObject in DocObjects) { Mesh[] RenderMeshes = CurrentObject.GetMeshes(MeshType.Render); if (RenderMeshes != null && RenderMeshes.Length > 0) { List <Mesh> ExportedMeshes = new List <Mesh>(RenderMeshes); List <ObjectAttributes> MeshesAttributes = new List <ObjectAttributes>(RenderMeshes.Length); BrepObject CurrentBrep = (CurrentObject as BrepObject); if (CurrentBrep != null && CurrentBrep.HasSubobjectMaterials) { RhinoObject[] SubObjects = CurrentBrep.GetSubObjects(); for (int SubObjectIndex = 0; SubObjectIndex < SubObjects.Length; ++SubObjectIndex) { MeshesAttributes.Add(SubObjects[SubObjectIndex].Attributes); } } else { for (int RenderMeshIndex = 0; RenderMeshIndex < RenderMeshes.Length; ++RenderMeshIndex) { MeshesAttributes.Add(CurrentObject.Attributes); } } DatasmithMeshInfo MeshInfo = GenerateMeshInfo(CurrentObject.Id, ExportedMeshes, MeshesAttributes); if (MeshInfo != null) { ObjectIdToMeshInfoDictionary[CurrentObject.Id] = MeshInfo; } } } }
public void LoadResourceCDC(LoadRequestCDC loadRequest) { SceneCDC.progressLevel = 0; SceneCDC.progressLevels = 1; SceneCDC.ProgressStage = "Reading Data"; SRFile srFile = SRFile.Create(loadRequest.DataFile, loadRequest.ObjectListFile, loadRequest.GameType, loadRequest.ExportOptions, loadRequest.ChildIndex); if (srFile == null) { SceneCDC.progressLevel = 1; SceneCDC.ProgressStage = "Done"; } RenderResourceCDC renderResource; if (Resources.ContainsKey(srFile.Name)) { renderResource = (RenderResourceCDC)Resources[srFile.Name]; Resources.Remove(srFile.Name); CurrentObject?.UpdateModels(); CurrentScene?.UpdateModels(); renderResource.Dispose(); } renderResource = new RenderResourceCDC(srFile); renderResource.LoadModels(loadRequest.ExportOptions); SceneCDC.progressLevel = 1; renderResource.LoadTextures(loadRequest.TextureFile, loadRequest.ExportOptions); Resources.Add(renderResource.Name, renderResource); CurrentObject?.UpdateModels(); CurrentScene?.UpdateModels(); SceneCDC.progressLevel = SceneCDC.progressLevels; SceneCDC.ProgressStage = "Done"; loadRequest.ResourceName = srFile.Name; }
private void DoMemberSetters() { var unconstructed = CurrentObject.UnconstructedMembers .Select(member => new { Member = member, Setter = _builder.MemberSetters.FirstOrDefault(setter => setter.IsForMember(member, Builder, this)) }).Where(e => e.Setter != null).ToList(); foreach (var member in unconstructed) { CurrentObject.RegisterConstructed(member.Member); } foreach (var member in unconstructed) { using (PushMember(member.Member)) { member.Setter.Set(CurrentObject.Object, Builder, this); } } }
static void Main(string[] args) { GrObject[] Objects = new GrObject[] { new Circle(10), new Rectangle(10, 5), new Ellipse(10, 5), new Triangle(10, 10, 14.14), new Cube(10, 5, 2), new Cylinder(10, 5), new Sphere(10), new Pyramid(5, 10, 2) }; foreach (GrObject CurrentObject in Objects) { CurrentObject.Draw(); if (CurrentObject is Object2D) { Console.WriteLine("Object area: {0:F2}\n", ((Object2D)CurrentObject).CalculateArea()); } if (CurrentObject is Object3D) { Console.WriteLine("Object surface area: {0:F2}", ((Object3D)CurrentObject).CalculateSurfaceArea()); Console.WriteLine("Object volume: {0:F2}\n", ((Object3D)CurrentObject).CalculateVolume()); } } }
void apply(CurrentObject CO) { Title.text = CO._Name; Description.text = CO._Description; Image.sprite = CO._Img; if (curObj != null) { curObj.SetActive(false); Platform.SetActive(false); //Set the Extras foreach (GameObject Ex in curExtras) { Ex.SetActive(false); } } curObj = CO.Object; Platform = CO.PlatformObj; curExtras = CO.Extras; jucyLerp(); curObj.SetActive(true); Platform.SetActive(true); //RELOCATE PLAYER //GameObject.FindGameObjectWithTag("Player").transform.position = CO.Playerpos.position; //GameObject.FindGameObjectWithTag("Player").transform.rotation = CO.Playerpos.rotation; //Set the Extras foreach (GameObject Ex in curExtras) { Ex.SetActive(true); } CC.SetObjColor(); }
public void Dispose() { if (Mode == EngineMode.Synchronous) { if (_eventTimer != null) { _eventTimer.Stop(); _eventTimer.Elapsed -= EventTimerElapsed; _eventTimer.Dispose(); _eventTimer = null; } if (_fmod != null) { _fmod.Stop(_engineContext.SoundChannel); _fmod.Shutdown(); } } if (_plugInRouter != null) { try { if (_engineContext != null) { _plugInRouter.Shutdown(_engineContext.RouterContext); } } catch (Exception exception) { MessageBox.Show(Resources.engineShutDownError + exception.Message, Vendor.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand); } } ProgramEnd = null; SequenceChange = null; if (CurrentObject != null) { CurrentObject.Dispose(); } InstanceList.Remove(this); GC.SuppressFinalize(this); }