public override void OnInspectorGUI() { ensureTargetInit (); _editNodes = EditorGUILayout.Toggle ("Edit Nodes", _editNodes); if (_editNodes) { _actionRequest = (NodeAction)EditorGUILayout.EnumPopup ("Action", _actionRequest); if (GUILayout.Button ("Insert")) _actionRequest = NodeAction.Insert; if (GUILayout.Button ("Delete")) _actionRequest = NodeAction.Delete; if (_actionRequest == NodeAction.Delete && targ.Nodes.Count < 4) { _actionRequest = NodeAction.Nothing; } } targ.StepSize = EditorGUILayout.FloatField ("Step Size", targ.StepSize); targ.JaggySize = EditorGUILayout.FloatField ("Jaggy Size", targ.JaggySize); targ.FlipNormals = EditorGUILayout.Toggle ("Flip Normals", targ.FlipNormals); targ.UseJaggies = EditorGUILayout.Toggle ("Use Jaggies", targ.UseJaggies); if (GUILayout.Button ("Generate")) { generate (); } }
private bool ReSizeText(NodeAction Source) { ActionCounter cc = Source as ActionCounter; winner.Font = new Font("Arial", 10f + (float)cc.Current); winner.CurrentAbsolute = CurrentAbsolute.Subtract(winner.Size.Width/2, winner.Size.Height/2); return true; }
protected override void OnAction(BaseNode node, NodeAction action) { switch (action) { case NodeAction.New: FileFolderNode fileFolder = node as FileFolderNode; if (fileFolder != null) { MessageBox.Show(string.Format("New File in group \"{0}\" In Library {1}", fileFolder.Name, fileFolder.GetRoot<LibraryNode>().Name)); } else { MessageBox.Show(string.Format("New Library with default group \"{0}\"", node.GetRootNodeName<GroupsNode>())); } break; case NodeAction.Exclude: case NodeAction.Remove: LibraryNode library = node as LibraryNode; if (library != null) { MessageBox.Show(string.Format("Remove Library {0} from Inventory", library.Name)); } BuildFileNode file = node as BuildFileNode; if (file != null) { MessageBox.Show(string.Format("{0} BuildFile {1} from library {2} from group {3}", action, file.Name, file.GetRoot<LibraryNode>().Name, file.GetRoot<FileFolderNode>().Name)); } break; default: base.OnAction(node, action); break; } }
static IEnumerator MachineGunShootingCoroutine( NodeAction action, IEnumerable<Node> selectedNodes, bool isSimulated ) { GameManager GM = GameManager.Instance; Transform visuals = action.transform.FindChild( "Visuals" ); action.BeganWarmup.Invoke( action ); yield return new WaitForSeconds( action.WarmupDelay ); action.BeganDuration.Invoke( action ); var timeShot = 0.075f; var numIterations = Mathf.FloorToInt( action.Duration / timeShot ); for ( var i = 0; i < numIterations; i++ ) { var projectile = (Projectile)Object.Instantiate( GM.BulletPrefab ); projectile.transform.parent = action.transform; projectile.transform.localPosition = Vector3.zero; projectile.transform.localRotation = Quaternion.identity; projectile.transform.parent = null; projectile.GetComponent<Rigidbody>().velocity = 10f * Vector3.forward; } action.BeganCooldown.Invoke( action ); yield return new WaitForSeconds( action.CooldownDelay ); action.Ended.Invoke( action ); }
protected virtual void OnAction(BaseNode node, NodeAction action) { BaseContentInventoryNode contentNode = node as BaseContentInventoryNode; if (contentNode != null) { this.OnWrapperActionEvent(contentNode.Content, action); } }
public string AddNode(string node, NodeAction action) { var rawTransaction = BaseConnector.RequestServer(MethodName.addnode, new List <object>() { node, action.ToString() })["result"].ToString(); return(rawTransaction); }
public FSMLexerBuilder <N> Action(NodeAction action) { if (Fsm.HasState(CurrentState)) { Fsm.SetAction(CurrentState, action); } return(this); }
public ActionResult AddOrUpdateNodeActions() { String json = Request["data"]; var rows = (ArrayList)MiniJSON.Decode(json); foreach (Hashtable row in rows) { var id = new Guid(row["Id"].ToString()); //根据记录状态,进行不同的增加、删除、修改操作 String state = row["_state"] != null ? row["_state"].ToString() : ""; //更新:_state为空或modified if (state == "modified" || state == "") { var inputModel = new NodeAction(new Guid(row["Id"].ToString())) { NodeId = new Guid(row["NodeId"].ToString()), ActionId = new Guid(row["ActionId"].ToString()), IsAllowed = row["IsAllowed"].ToString(), IsAudit = row["IsAudit"].ToString() }; NodeDescriptor nodeDescriptor; if (!AcDomain.NodeHost.Nodes.TryGetNodeById(inputModel.NodeId.ToString(), out nodeDescriptor)) { throw new ValidationException("意外的节点标识" + inputModel.NodeId); } NodeAction entity = null; if (nodeDescriptor != null) { entity = new NodeAction(inputModel.Id) { ActionId = inputModel.ActionId, IsAllowed = inputModel.IsAllowed, IsAudit = inputModel.IsAudit, NodeId = inputModel.NodeId }; AcDomain.PublishEvent(new NodeActionUpdatedEvent(AcSession, entity)); } else { entity = new NodeAction(inputModel.Id) { NodeId = inputModel.NodeId, ActionId = inputModel.ActionId, IsAudit = inputModel.IsAudit, IsAllowed = inputModel.IsAllowed }; AcDomain.PublishEvent(new NodeActionAddedEvent(AcSession, entity)); } AcDomain.CommitEventBus(); } } return(this.JsonResult(new ResponseData { success = true })); }
//Something like a Node prototype array which is useful for Nodes which have certain identifiers would be useful when encountering nodes, //Such nodes would be parsed on a background thread if required for use by others including track reading, it would also reduce IO public bool TryApplyCachingPolocy(NodeAction n, bool combine = false, bool eraseCache = true) { try { ApplyCachingPolocy(n, combine, eraseCache); return(true); } catch { return(false); } }
public virtual void SetNodeAction(NodeAction nodeAction) { MaybeInitBuilder(); if (nodeAction == null) { builder.ClearNodeAction(); return; } builder.SetNodeAction(ConvertToProtoFormat(nodeAction)); }
public override void Apply(Vector2Int userNode, GridTerrainData terrainData, NodeAction action) { var userNodeValue = terrainData[userNode.x, userNode.y]; for (int x = 0; x < terrainData.Width; x++) { for (int y = 0; y < terrainData.Height; y++) { action(userNode, userNodeValue, new Vector2Int(x, y), terrainData); } } }
private void SetIHuman() { for (int i = 0; i < _behaviorTreeEntity.ActionNodeList.Count; ++i) { NodeAction nodeAction = _behaviorTreeEntity.ActionNodeList[i]; if (typeof(IHuman).IsAssignableFrom(nodeAction.GetType())) { IHuman iHuman = nodeAction as IHuman; iHuman.SetHuman(this); } } }
private static bool IsColumnAction(NodeAction action) { var diff = action.Difference as NodeDifference; if (diff == null) { return(false); } var item = diff.Source ?? diff.Target; return(item is StorageColumnInfo); }
public override void Apply(Vector2Int userNode, GridTerrainData terrainData, NodeAction action) { var userNodeValue = terrainData[userNode.x, userNode.y]; for (int x = Mathf.Max(userNode.x - _paintRadius, 0); x < Mathf.Min(userNode.x + _paintRadius + 1, terrainData.Width); x++) { for (int y = Mathf.Max(userNode.y - _paintRadius, 0); y < Mathf.Min(userNode.y + _paintRadius + 1, terrainData.Height); y++) { action(userNode, userNodeValue, new Vector2Int(x, y), terrainData); } } }
public static List <NodeAction> AddReportKniha(this List <NodeAction> list, IWebEasRepositoryBase baseRepository, bool addFaktur = true, string addZvysDklCaption = "") { bool addSep = false; var n = new NodeAction(NodeActionType.MenuButtonsAll) { Caption = "Zostavy", ActionIcon = NodeActionIcons.Zostavy, MenuButtons = new List <NodeAction>() }; if (addFaktur) { n.MenuButtons.Add(new NodeAction(NodeActionType.ReportKnihaFaktur) { Url = $"/office/crm/long/ReportKnihaFaktur" //GroupType = "ReportFilter" }); n.MenuButtons.Add(new NodeAction(NodeActionType.ViewReportKnihaFaktur) { Url = $"crm/KnihaFakturReport.trdx" }); n.MenuButtons.Add(new NodeAction(NodeActionType.PrintReportKnihaFaktur) { Url = $"/office/crm/long/ReportKnihaFaktur" }); addSep = true; } if (addZvysDklCaption != "") { n.MenuButtons.Add(new NodeAction(NodeActionType.ReportKnihaDokladov) { Caption = addZvysDklCaption + " - pdf", Url = $"/office/crm/long/ReportKnihaDokladov", //GroupType = "ReportFilter", Separator = addSep ? "-" : string.Empty }); n.MenuButtons.Add(new NodeAction(NodeActionType.ViewReportKnihaDokladov) { Caption = addZvysDklCaption + " - náhľad", Url = $"crm/KnihaDokladovReport.trdx" }); n.MenuButtons.Add(new NodeAction(NodeActionType.PrintReportKnihaDokladov) { Caption = addZvysDklCaption + " - tlač", Url = $"/office/crm/long/ReportKnihaDokladov" }); addSep = true; } list.Add(n); return(list); }
public static NodeAction GetAction( NodeAction nodeActionPrefab, float warmup, float duration, float cooldown, float angle, int energyCost, int hpCost, List<NodeBehaviour> nodeBehaviour, List<CollisionBehaviour> collisionImpactBehaviours = null, List<CollisionBehaviour> collisionDeflectBehaviours = null, List<SelectionFilter> selectionFilters = null ) { var action = (NodeAction)Object.Instantiate( nodeActionPrefab ); action.WarmupDelay = warmup; action.Duration = duration; action.CooldownDelay = cooldown; action.Angle = angle; action.EnergyCost = energyCost; action.HPCost = hpCost; if ( nodeBehaviour == null ) { nodeBehaviour = new List<NodeBehaviour>(); } if ( collisionImpactBehaviours == null ) { collisionImpactBehaviours = new List<CollisionBehaviour>(); } if ( collisionDeflectBehaviours == null ) { collisionDeflectBehaviours = new List<CollisionBehaviour>(); } if ( selectionFilters == null ) { selectionFilters = new List<SelectionFilter>(); } nodeBehaviour .ForEach( behaviour => action.NodeBehaviours.Add( behaviour ) ); collisionImpactBehaviours .ForEach( behaviour => action.CollisionImpactBehaviours.Add( behaviour ) ); collisionDeflectBehaviours .ForEach( behaviour => action.CollisionDeflectBehaviours.Add( behaviour ) ); selectionFilters .ForEach( behaviour => action.SelectionFilters.Add( behaviour ) ); action.name = action.ToString(); return action; }
public virtual void SetNodeAction(NodeAction nodeAction) { MaybeInitBuilder(); if (nodeAction == null) { builder.ClearNodeAction(); } else { builder.SetNodeAction(ConvertToProtoFormat(nodeAction)); } rebuild = true; }
//constructor for new node public Node(Node parent, State state, NodeAction action, int cost, int pathCost, int hCost) { this.parent = parent; this.state = state; this.action = action; this.cost = cost; this.gCost = pathCost; this.hCost = hCost; fCost = hCost + pathCost; //calculating fCost for A* algo setDepth(); children = new List <Node>(); }
/// <summary> /// Appends the specified action to the action sequence that is building now. /// </summary> /// <param name="actionType">Type of the action.</param> /// <param name="action">The action to append.</param> /// <exception cref="ArgumentOutOfRangeException"><c>actionType</c> is out of range.</exception> /// <exception cref="InvalidOperationException">Invalid <c>Context.DependencyRootType</c>.</exception> protected void AddAction(UpgradeActionType actionType, NodeAction action) { action.Difference = Context.Difference; var dependencyRootType = Context.DependencyRootType; if (dependencyRootType == null || actionType == UpgradeActionType.Regular) { action.Execute(CurrentModel); Context.Actions.Add(action); } else if (actionType == UpgradeActionType.Rename) { var parentDifference = Context.Difference.Parent; EnumerableUtils.Unfold(Context, c => c.Parent) .Where(c => c.Parent.Difference == parentDifference) .Take(1) .ForEach(c => c.Renames.Add(action)); } else { foreach (var ctx in EnumerableUtils.Unfold(Context, c => c.Parent)) { var difference = ctx.Difference; var any = difference.Target ?? difference.Source; var type = any == null ? WellKnownTypes.Object : any.GetType(); if (type == dependencyRootType) { switch (actionType) { case UpgradeActionType.PreCondition: action.Execute(CurrentModel); ctx.PreConditions.Add(action); break; case UpgradeActionType.PostCondition: ctx.PostConditions.Add(action); break; default: throw new ArgumentOutOfRangeException(nameof(actionType)); } return; } } throw new InvalidOperationException(string.Format( Strings.ExDifferenceRelatedToXTypeIsNotFoundOnTheUpgradeContextStack, dependencyRootType.GetShortName())); } }
public new void CustomizeModel(PfeDataModel model, IWebEasRepositoryBase repository, HierarchyNode node, string filter, HierarchyNode masterNode, string kodPolozkyModulu) { base.CustomizeModel(model, repository, node, filter, masterNode, kodPolozkyModulu); var eSAMRezim = repository.GetNastavenieI("cfe", "eSAMRezim"); var isoZdroj = repository.GetNastavenieI("cfe", "ISOZdroj"); var isoZdrojNazov = repository.GetNastavenieS("cfe", "ISOZdrojNazov"); if (model.Fields != null) { if (eSAMRezim != 1 && repository.Session.AdminLevel != AdminLevel.SysAdmin) { model.Fields.FirstOrDefault(p => p.Name == nameof(DCOM)).Text = "_DCOM"; } } if (eSAMRezim == 1) { var na = new NodeAction(NodeActionType.MenuButtonsAll) { ActionIcon = NodeActionIcons.Refresh, Caption = "DCOM", MenuButtons = new List <NodeAction>() { new NodeAction(NodeActionType.DoposlanieUhradDoDcomu) { SelectionMode = PfeSelection.Multi, IdField = "D_BiznisEntita_Id", Url = "/office/reg/long/DoposlanieUhradDoDcomu" } } }; node.Actions.Add(na); } if (isoZdroj > 0 && repository.Session.Roles.Where(w => w.Contains("REG_MIGRATOR")).Any() && model.Type != PfeModelType.Form) { if (node.Actions.Any(x => x.ActionType == NodeActionType.MenuButtonsAll)) { var polozkaMenuAll = node.Actions.Where(x => x.ActionType == NodeActionType.MenuButtonsAll && x.Caption == "ISO").FirstOrDefault(); if (polozkaMenuAll != null) { polozkaMenuAll.Caption = isoZdrojNazov; } } } else { node.Actions.RemoveAll(x => x.ActionType == NodeActionType.MenuButtonsAll && x.Caption == "ISO"); } }
private void ActionReceiver_OnAction(NodeAction sender, NodeActionEvent action, Context context, NodeActionProvider trigger, TraverseAction traverser, IntPtr userdata) { // Locked in edit or render (render) by caller if ((action == NodeActionEvent.IS_TRAVERSABLE) || (action == NodeActionEvent.IS_NOT_TRAVERSABLE)) { pendingActivations.Add(new ActivationInfo(action, trigger as Node)); } else { trigger?.ReleaseNoDelete(); // We are getting ref counts on objects in scene graph and these need to be released immediately } traverser?.ReleaseNoDelete(); context?.ReleaseNoDelete(); }
static IEnumerator CollisionDamageCoroutine( NodeAction action, Collision collision, bool isSimulated ) { GameManager GM = GameManager.Instance; var health = collision.transform.GetComponent<Health>(); if ( health != null ) { health.ApplyDamage( 10 ); } action.Ended.Invoke( action ); // Just to satisfy the damn coroutine. yield return null; }
public void Init() { if (actions != null && actions.Count > 0) { foreach (NodeAction action in actions) { action.Init(); } current = actions[0]; } else { current = null; } }
static private void OnAction_callback(IntPtr instance, NodeActionEvent action, IntPtr native_context_ref, IntPtr native_trigger_ref, IntPtr native_traverser_ref, IntPtr userdata) { NodeAction na = ReferenceDictionary <NodeAction> .GetObject(instance); if (na != null) { if (action != NodeActionEvent.REMOVE) { na.OnAction?.Invoke(na, action, CreateObject(native_context_ref) as Context, CreateObject(native_trigger_ref) as NodeActionProvider, CreateObject(native_traverser_ref) as TraverseAction, userdata); } else { na.OnAction?.Invoke(na, action, CreateObject(native_context_ref) as Context, null, CreateObject(native_traverser_ref) as TraverseAction, native_trigger_ref); } } }
private void DoVisitInOrder(BinaryTreeNode <T> node, NodeAction <T> nodeCallback) { if (node.Left != null) { DoVisitInOrder(node.Left, nodeCallback); } if (nodeCallback != null) { nodeCallback(node); } if (node.Right != null) { DoVisitInOrder(node.Right, nodeCallback); } }
public bool Uninitialize() { if (!_initialized) { return(false); } // Stop manager DynamicLoaderManager.StopManager(); ResetMap(); // Remove actions DynamicLoader.OnDynamicLoad -= DynamicLoader_OnDynamicLoad; _actionReceiver.OnAction -= ActionReceiver_OnAction; NodeLock.WaitLockEdit(); try // We are now locked in edit { _native_camera.Debug(_native_context, false); _native_camera.Dispose(); _native_camera = null; _native_context.Dispose(); _native_context = null; _native_scene.Dispose(); _native_scene = null; _actionReceiver.Dispose(); _actionReceiver = null; } finally { NodeLock.UnLock(); } // Drop platform streamer GizmoSDK.Gizmo3D.Platform.Uninitialize(); _initialized = false; return(true); }
static IEnumerator GrowCoroutine( NodeAction action, IEnumerable<Node> selectedNodes, bool isSimulated ) { Debug.Log( "Grow action fired!" ); action.BeganWarmup.Invoke( action ); yield return new WaitForSeconds( action.WarmupDelay ); action.BeganDuration.Invoke( action ); yield return new WaitForSeconds( action.Duration ); action.Node.Grow(); action.BeganCooldown.Invoke( action ); yield return new WaitForSeconds( action.CooldownDelay ); action.Ended.Invoke( action ); }
private bool AreChildrenChecked(TreeNode treeNode, NodeAction nodeAction = null) { bool foundCheck = false; foreach (TreeNode n in treeNode.Nodes) { if (n.Checked || AreChildrenChecked(n)) { foundCheck = true; break; } } if (nodeAction != null) { nodeAction(treeNode, foundCheck); } return(foundCheck); }
private static bool IsUnsafeTypeChangeAction(NodeAction action) { var propertyChangeAction = action as PropertyChangeAction; if (propertyChangeAction == null) { return(false); } if (!IsTypeChangeAction(propertyChangeAction)) { return(false); } return(!TypeConversionVerifier.CanConvertSafely( (StorageTypeInfo)propertyChangeAction.Difference.Source, (StorageTypeInfo)propertyChangeAction.Difference.Target)); }
public bool InitializeInternal() { _actionReceiver = new NodeAction("DynamicLoadManager"); _actionReceiver.OnAction += ActionReceiver_OnAction; _zflipMatrix = new Matrix4x4(new Vector4(1, 0, 0), new Vector4(0, 1, 0), new Vector4(0, 0, -1), new Vector4(0, 0, 0, 1)); GizmoSDK.GizmoBase.Message.Send("SceneManager", MessageLevel.DEBUG, "Loading Graph"); NodeLock.WaitLockEdit(); try // We are now locked in edit { _native_camera = new PerspCamera("Test"); _native_camera.RoiPosition = true; MapControl.SystemMap.Camera = _native_camera; _native_scene = new Scene("TestScene"); _native_context = new Context(); #if DEBUG_CAMERA _native_camera.Debug(_native_context); // Enable to debug view #endif // DEBUG_CAMERA _native_traverse_action = new CullTraverseAction(); DynamicLoader.OnDynamicLoad += DynamicLoader_OnDynamicLoad; _native_camera.Scene = _native_scene; } finally { NodeLock.UnLock(); } DynamicLoader.UsePreCache(true); // Enable use of mipmap creation on dynamic loading DynamicLoaderManager.SetNumberOfActiveLoaders(4); // Lets start with 4 parallell threads DynamicLoaderManager.StartManager(); return(true); }
protected override void OnAction(BaseNode node, NodeAction action) { switch (action) { case NodeAction.New: MessageBox.Show(string.Format("New Library Category with default group \"{0}\"", node.GetRootNodeName<GroupsNode>())); break; case NodeAction.Remove: LibraryCategoryNode libcat = node as LibraryCategoryNode; if (libcat != null) { MessageBox.Show(string.Format("Remove Library Category {0} from Inventory", libcat.Name)); } break; default: base.OnAction(node, action); break; } }
protected override void OnAction(BaseNode node, NodeAction action) { switch (action) { case NodeAction.Manage: using (PKStudio.Dialogs.ManageProjectWizard.ManageProjectWizard mManageProjectComponentsWizard = new Dialogs.ManageProjectWizard.ManageProjectWizard()) { ProjectNode PN = node.GetRoot <ProjectNode>(); SolutionNode SN = node.GetRoot <SolutionNode>(); if ((PN != null) && (SN != null)) { mManageProjectComponentsWizard.SetProject(SN.TypedContent, PN.TypedContent); mManageProjectComponentsWizard.ShowDialog(this); } } break; case NodeAction.New: SolutionNode solution = node as SolutionNode; if (solution != null) { //MessageBox.Show(string.Format("Add Project in Solution {0}", solution.Name)); using (PKStudio.Dialogs.ManageProjectWizard.NewProjectWizard mNewProjectWizard = new Dialogs.ManageProjectWizard.NewProjectWizard(solution.TypedContent)) { mNewProjectWizard.ShowDialog(this); } } break; case NodeAction.Remove: ProjectNode project = node as ProjectNode; if (project != null) { MessageBox.Show(string.Format("Remove Project {0} from Solution", project.Name)); } break; default: base.OnAction(node, action); break; } }
public static bool Initialize() { bool result = GizmoBase.Platform.Initialize(); if (result) { result = Platform_initialize(); } if (result) { InitializeFactories(); DynamicLoader.Initialize(); NodeAction.Initialize(); } return(result); }
protected override void OnAction(BaseNode node, NodeAction action) { switch (action) { case NodeAction.New: MessageBox.Show(string.Format("New Feature with default group \"{0}\"", node.GetRootNodeName<GroupsNode>())); break; case NodeAction.Remove: FeatureNode feature = node as FeatureNode; if (feature != null) { MessageBox.Show(string.Format("Remove Feature {0} from Inventory", feature.Name)); } break; default: base.OnAction(node, action); break; } }
static public void UnInitializeFactories() { Node.UnInitializeFactory(); Group.UnInitializeFactory(); Transform.UnInitializeFactory(); Lod.UnInitializeFactory(); State.UnInitializeFactory(); Geometry.UnInitializeFactory(); Scene.UnInitializeFactory(); PerspCamera.UnInitializeFactory(); DynamicLoader.UnInitializeFactory(); CullTraverseAction.UnInitializeFactory(); NodeAction.UnInitializeFactory(); Context.UnInitializeFactory(); Texture.UnInitializeFactory(); Roi.UnInitializeFactory(); RoiNode.UnInitializeFactory(); ExtRef.UnInitializeFactory(); }
static IEnumerator CreateNodeCoroutine( NodeAction action, IEnumerable<Node> selectedNodes, bool isSimulated ) { GameManager GM = GameManager.Instance; Debug.Log( "Create Node action fired!" ); action.BeganWarmup.Invoke( action ); yield return new WaitForSeconds( action.WarmupDelay ); action.BeganDuration.Invoke( action ); yield return new WaitForSeconds( action.Duration ); GM.FinalizePlaceNode( GM.StartPlaceNode( action.Node ) ); action.BeganCooldown.Invoke( action ); yield return new WaitForSeconds( action.CooldownDelay ); action.Ended.Invoke( action ); }
public static bool Uninitialize(bool forceShutdown = false, bool shutdownBase = false) { try { NodeLock.WaitLockEdit(); NodeAction.Uninitialize(); DynamicLoader.Uninitialize(); UninitializeFactories(); } finally { NodeLock.UnLock(); } bool result = Platform_uninitialize(forceShutdown, shutdownBase); return(result); }
static public void InitializeFactories() { Node.InitializeFactory(); Group.InitializeFactory(); Transform.InitializeFactory(); Lod.InitializeFactory(); State.InitializeFactory(); Geometry.InitializeFactory(); Scene.InitializeFactory(); PerspCamera.InitializeFactory(); DynamicLoader.InitializeFactory(); CullTraverseAction.InitializeFactory(); NodeAction.InitializeFactory(); Context.InitializeFactory(); Texture.InitializeFactory(); Roi.InitializeFactory(); RoiNode.InitializeFactory(); ExtRef.InitializeFactory(); Crossboard.InitializeFactory(); }
protected override void OnAction(BaseNode node, NodeAction action) { switch (action) { case NodeAction.New: MessageBox.Show(string.Format("New Feature with default group \"{0}\"", node.GetRootNodeName <GroupsNode>())); break; case NodeAction.Remove: FeatureNode feature = node as FeatureNode; if (feature != null) { MessageBox.Show(string.Format("Remove Feature {0} from Inventory", feature.Name)); } break; default: base.OnAction(node, action); break; } }
protected override void OnAction(BaseNode node, NodeAction action) { switch (action) { case NodeAction.New: MessageBox.Show(string.Format("New Library Category with default group \"{0}\"", node.GetRootNodeName <GroupsNode>())); break; case NodeAction.Remove: LibraryCategoryNode libcat = node as LibraryCategoryNode; if (libcat != null) { MessageBox.Show(string.Format("Remove Library Category {0} from Inventory", libcat.Name)); } break; default: base.OnAction(node, action); break; } }
protected override void OnAction(BaseNode node, NodeAction action) { switch (action) { case NodeAction.Manage: using (PKStudio.Dialogs.ManageProjectWizard.ManageProjectWizard mManageProjectComponentsWizard = new Dialogs.ManageProjectWizard.ManageProjectWizard()) { ProjectNode PN = node.GetRoot<ProjectNode>(); SolutionNode SN = node.GetRoot<SolutionNode>(); if ((PN != null) && (SN != null)) { mManageProjectComponentsWizard.SetProject(SN.TypedContent, PN.TypedContent); mManageProjectComponentsWizard.ShowDialog(this); } } break; case NodeAction.New: SolutionNode solution = node as SolutionNode; if (solution != null) { //MessageBox.Show(string.Format("Add Project in Solution {0}", solution.Name)); using (PKStudio.Dialogs.ManageProjectWizard.NewProjectWizard mNewProjectWizard = new Dialogs.ManageProjectWizard.NewProjectWizard(solution.TypedContent)) { mNewProjectWizard.ShowDialog(this); } } break; case NodeAction.Remove: ProjectNode project = node as ProjectNode; if (project != null) { MessageBox.Show(string.Format("Remove Project {0} from Solution", project.Name)); } break; default: base.OnAction(node, action); break; } }
static IEnumerator PingPongAimingCoroutine( NodeAction action, IEnumerable<Node> selectedNodes, bool isSimulated ) { GameManager GM = GameManager.Instance; Transform visuals = action.transform.FindChild( "Visuals" ); action.BeganWarmup.Invoke( action ); yield return new WaitForSeconds( action.WarmupDelay ); action.BeganDuration.Invoke( action ); var time = 0f; while ( time < action.Duration ) { var angle = action.Angle * ( Mathf.PingPong( time, 0.5f ) - 0.25f ); visuals.transform.localRotation = Quaternion.Euler( 0f, angle, 0f ); time += Time.deltaTime; } visuals.transform.localRotation = Quaternion.identity; action.BeganCooldown.Invoke( action ); yield return new WaitForSeconds( action.CooldownDelay ); action.Ended.Invoke( action ); }
public NodeEventArgs(NodeAction action) { this.Action = action; }
/// <summary> /// Конструктор /// </summary> public NodeInfo(NodeAction nodeAction) { NodeAction = nodeAction; Params = null; Form = null; }
/// <summary> /// Adds an item to a list. /// </summary> /// <param name="list">Handle to a List.</param> /// <param name="node">Handle to a Node.</param> /// <param name="action">an Action.</param> private void AddToList(List<NodeAction> list, CCNode node, Func<List<CCTouch>, CCEvent, bool> action) { var nodeAction = new NodeAction(); var index = 0; nodeAction.Node = node; nodeAction.Action = action; if (list.Count != 0) { index = list.FindIndex((x) => x.Node.ZOrder <= node.ZOrder); } else { index = 0; } list.Insert(index, nodeAction); }
protected virtual void OnAction(BaseNode node, NodeAction action) { if (this.NodeActionEvent != null) { this.NodeActionEvent(node, new NodeEventArgs(action)); } }
protected NodeActionState(Drawable target, NodeAction action) { Target = target; Action = action; }
/// <summary> /// Visit all entities contained in the storage applying a user provided action /// </summary> /// <exception cref="T:OpenMcdf.CFDisposedException">Raised when visiting items of a closed compound file</exception> /// <param name="action">User <see cref="T:OpenMcdf.VisitedEntryAction">action</see> to apply to visited entities</param> /// <param name="recursive"> Visiting recursion level. True means substorages are visited recursively, false indicates that only the direct children of this storage are visited</param> /// <example> /// <code> /// const String STORAGE_NAME = "report.xls"; /// CompoundFile cf = new CompoundFile(STORAGE_NAME); /// /// FileStream output = new FileStream("LogEntries.txt", FileMode.Create); /// TextWriter tw = new StreamWriter(output); /// /// VisitedEntryAction va = delegate(CFItem item) /// { /// tw.WriteLine(item.Name); /// }; /// /// cf.RootStorage.VisitEntries(va, true); /// /// tw.Close(); /// </code> /// </example> public void VisitEntries(VisitedEntryAction action, bool recursive) { CheckDisposed(); if (action != null) { List<BinaryTreeNode<CFItem>> subStorages = new List<BinaryTreeNode<CFItem>>(); internalAction = delegate(BinaryTreeNode<CFItem> targetNode) { action(targetNode.Value as CFItem); if (targetNode.Value.DirEntry.Child != DirectoryEntry.NOSTREAM) subStorages.Add(targetNode); return; }; this.Children.VisitTreeInOrder(internalAction); if (recursive && subStorages.Count > 0) foreach (BinaryTreeNode<CFItem> n in subStorages) { ((CFStorage)n.Value).VisitEntries(action, recursive); } } }
public NodeActionUpdatedEvent(IAcSession acSession, NodeAction source) : base(acSession, source) { this.IsAllowed = source.IsAllowed; this.IsAudit = source.IsAudit; }
public Task AddNode(string node, NodeAction action) { return _rpcConnector.MakeRequestAsync<string>(RpcMethods.addnode, node, action.ToString()); }
void OnSceneGUI() { ensureTargetInit (); if (Event.current.type == EventType.mouseUp) { _hasDeleted = false; } drawGrid (); Handles.color = Color.white; Handles.DrawLine (targ.transform.position + targ.Nodes [targ.Nodes.Count - 1].AsVector3 (), targ.transform.position + targ.Nodes [0].AsVector3 ()); int? actionIndex = null; Vector2 actionPos = Vector2.zero; for (int i = 0; i < targ.Nodes.Count; ++i) { if (_editNodes) { if (!_hasDeleted) { var oldPos = targ.transform.position + targ.Nodes [i].AsVector3 (); var newPos = Handles.PositionHandle (targ.transform.position + targ.Nodes [i].AsVector3 (), Quaternion.identity); targ.Nodes [i] = newPos - targ.transform.position; if ((oldPos - newPos).sqrMagnitude > 1e-9) { actionIndex = i; actionPos = oldPos; } } else { Handles.PositionHandle (targ.transform.position + targ.Nodes [i].AsVector3 (), Quaternion.identity); } } if (i > 0) { Handles.DrawLine (targ.transform.position + targ.Nodes [i - 1].AsVector3 (), targ.transform.position + targ.Nodes [i].AsVector3 ()); } } if (actionIndex.HasValue) { switch (_actionRequest) { case NodeAction.Insert: targ.Nodes.Insert (actionIndex.Value, actionPos); break; case NodeAction.Delete: targ.Nodes.RemoveAt (actionIndex.Value); _hasDeleted = true; break; } _actionRequest = NodeAction.Nothing; // generate(); } }
/// <summary> /// Perform an action step /// </summary> /// <returns>true = completed</returns> public bool PerformStep() { if (current == null) return true; // Perform a step bool complete = current.PerformStep(); // Bind if (current.OnBind != null) current.OnBind(current); // Completed logic, move to next or exit if (complete) { if (actions.IndexOf(current) == actions.Count-1) { return true; } else { current = actions[actions.IndexOf(current) + 1]; } } return false; }
public String AddNode(String node, NodeAction action) { return _baseConnector.RequestServer(MethodName.addnode, new List<object> { node, action.ToString() })["result"].ToString(); }
public void Add(NodeAction newNodeAction) { actions.Add(newNodeAction); }
public String AddNode(String node, NodeAction action) { return _rpcConnector.MakeRequest<String>(RpcMethods.addnode, node, action.ToString()); }
private bool AreChildrenChecked(TreeNode treeNode, NodeAction nodeAction = null) { bool foundCheck = false; foreach (TreeNode n in treeNode.Nodes) { if (n.Checked || AreChildrenChecked(n)) { foundCheck = true; break; } } if (nodeAction != null) nodeAction(treeNode, foundCheck); return foundCheck; }
public NodeActionRemovedEvent(IAcSession acSession, NodeAction source) : base(acSession, source) { }
/// <summary> /// Performs a child-adding action with error checks. /// </summary> private XmlNode CheckedChildOperation(DOMNode/*!*/ newNode, DOMNode auxNode, NodeAction/*!*/ action) { newNode.Associate(XmlNode.OwnerDocument != null ? XmlNode.OwnerDocument : (XmlDocument)XmlNode); // check for readonly node if (XmlNode.IsReadOnly || (newNode.XmlNode.ParentNode != null && newNode.XmlNode.ParentNode.IsReadOnly)) { DOMException.Throw(ExceptionCode.DomModificationNotAllowed); return null; } // check for owner document mismatch if (XmlNode.OwnerDocument != null ? XmlNode.OwnerDocument != newNode.XmlNode.OwnerDocument : XmlNode != newNode.XmlNode.OwnerDocument) { DOMException.Throw(ExceptionCode.WrongDocument); return null; } XmlNode result; try { result = action(newNode, auxNode); } catch (InvalidOperationException) { // the current node is of a type that does not allow child nodes of the type of the newNode node // or the newNode is an ancestor of this node. DOMException.Throw(ExceptionCode.BadHierarchy); return null; } catch (ArgumentException) { // check for newNode == this which System.Xml reports as ArgumentException if (newNode.XmlNode == XmlNode) DOMException.Throw(ExceptionCode.BadHierarchy); else { // the refNode is not a child of this node DOMException.Throw(ExceptionCode.NotFound); } return null; } return result; }