private void Start() { elementOfType = new Dictionary <ActionType, ActionElement>(); root = GetComponent <UIDocument>().rootVisualElement.Q("ActionContainer"); //Action setup if (actions.Count > 0) { foreach (ActionType a in actions) { ActionElement element = new ActionElement { Action_Name_Text = a.actionName, Action_Cost = 0, Icon = a.icon, }; root.Add(element); elementOfType.Add(a, element); } activeIndex = DEFAULT_I; elementOfType[Active].Is_Active = true; } else { Debug.LogWarning($"{nameof(actions)} was empty", this); } //Money Setup PlayerInventory inventory = PlayerManager.Instance.Local.GetComponent <PlayerInventory>(); inventory.OnValueChange.AddListener(e => CheckCanAfford(inventory)); CheckCanAfford(inventory); }
public DashBoardPage Login(string userID, string Password) { ActionElement.EnterTextInTextBox(UserIDTextBox, userID); ActionElement.EnterTextInTextBox(UserPasswordTextBox, Password); ActionElement.ButtonClick(LoginSubmitButton); return(new DashBoardPage()); }
public void InvokeAction(ActionElement action){ if (action.GetType()==typeof(SubmitElement)){ _submitForm((SubmitElement)action); } else { _invokeAction(action.Action, action); } }
public IRuleAction CompileAction(ActionElement element, List <Declaration> declarations, List <DependencyElement> dependencies, IndexMap tupleFactMap) { var activationFactMap = IndexMap.CreateMap(element.Imports, declarations); var factMap = IndexMap.Compose(tupleFactMap, activationFactMap); var dependencyIndexMap = IndexMap.CreateMap(element.Imports, dependencies.Select(x => x.Declaration)); if (dependencyIndexMap.HasData) { var optimizedExpression = ExpressionOptimizer .Optimize <Action <IContext, Tuple, IDependencyResolver, IResolutionContext> >( element.Expression, factMap, dependencies, dependencyIndexMap); var @delegate = ExpressionCompiler.Compile(optimizedExpression); var argumentMap = new ArgumentMap(factMap, element.Expression.Parameters.Count - 1); var action = new RuleActionWithDependencies(element.Expression, @delegate, argumentMap, element.ActionTrigger); return(action); } else { var optimizedExpression = ExpressionOptimizer.Optimize <Action <IContext, Tuple> >( element.Expression, 1, factMap, tupleInput: true, factInput: false); var @delegate = ExpressionCompiler.Compile(optimizedExpression); var argumentMap = new ArgumentMap(factMap, element.Expression.Parameters.Count - 1); var action = new RuleAction(element.Expression, @delegate, argumentMap, element.ActionTrigger); return(action); } }
public LookAroundAction(ActionElement backAction) { actions = new ActionElement[] { backAction }; }
/// <summary> /// Adds a rule action to the group. /// </summary> /// <param name="expression">Rule action expression.</param> public void Action(LambdaExpression expression) { IEnumerable <Declaration> declarations = expression.Parameters.Skip(1).Select(p => Scope.Lookup(p.Name, p.Type)); var actionElement = new ActionElement(declarations, expression); _actions.Add(actionElement); }
private bool Write(ActionElement action) { if (action == null) { return(false); } /* * string[] lines = BreakIntoLines(action.Content.ToString(), _settings.WritablePageWidth()); * if (!HaveRoomFor(lines.Length)) * NewPage(); */ WriteContentNode(action.Content, PageSettings.InPoints(_settings.WritablePageWidth()), x => 0, l => { if (l > 0) { MoveDown(1); WriteRightAlignedLine("(CONTINUED)"); } NewPage(); }); /* * foreach (string line in lines) { * WriteLine(line); * } * EmptyLine(); */ return(true); }
public void Logout() { if (ActionElement.IsElementPresent(SingOff) == true) { ActionElement.LinkClick(SingOff); } }
private static void LoadActionAttributes(ConfigurationDataSet.ActionRow row, ActionElement action, Guid?parentActionId) { row.BuiltIn = action.BuiltIn; if (action.ActionType != ActionType.NotSet) { row.ActionTypeId = (int)action.ActionType; } row.ParentActionId = (parentActionId.HasValue ? parentActionId.Value : ((action.ActionType == ActionType.Page) ? PagesAndControlsActionId : GlobalNavigationLinksActionId)); row.Handle = action.Handle; switch ((ActionType)row.ActionTypeId) { case ActionType.Page: LoadPageAttributes(row, action); break; case ActionType.Control: LoadControlAttributes(row, action); break; case ActionType.GlobalNavigationLink: LoadGlobalNavigationLinkAttributes(row, action); break; } }
private static void LoadPageAttributes(ConfigurationDataSet.ActionRow row, ActionElement action) { row.LearnMoreUrl = action.LearnMoreUrl; row.VideoUrl = action.VideoUrl; LoadGlobalNavigationLinkAttributes(row, action); LoadSubmenuAttributes(row, action.Submenu); }
public void Start(ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { element.paused = false; } }
public void Paused(bool pause, ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { element.paused = pause; } }
public TrampAction(ActionElement backAction) { actions = new ActionElement[] { backAction }; TextActions = new string[] { "Взять" }; }
public void InvokeAction(ActionElement action) { if (action.GetType() == typeof(SubmitElement)) { _submitForm((SubmitElement)action); } else { _invokeAction(action.Action, action); } }
public static IRuleAction CompileAction(ActionElement element, IEnumerable <Declaration> declarations, IEnumerable <Declaration> dependencies) { var optimizer = new ExpressionMultiParameterOptimizer <Action <IContext, object[]> >(); var optimizedExpression = optimizer.CompactParameters(element.Expression, 1); var @delegate = optimizedExpression.Compile(); var fastDelegate = Create(@delegate, element.Expression.Parameters.Count - 1); var tupleFactMap = IndexMap.CreateMap(element.Imports, declarations); var dependencyIndexMap = IndexMap.CreateMap(element.Imports, dependencies); var action = new RuleAction(element.Expression, fastDelegate, tupleFactMap, dependencyIndexMap, element.ActionTrigger); return(action); }
private void RemoveAction(int index, ActionElement element) { CollectionUtils.RemoveAt(element.actions, index); if (element.actionIndex >= index) { element.actionIndex--; } if (element.actions.Count==0) { DeleteElement(element); } }
private void RemoveAction(int index, ActionElement element) { CollectionUtils.RemoveAt(element.actions, index); if (element.actionIndex >= index) { element.actionIndex--; } if (element.actions.Count == 0) { DeleteElement(element); } }
public void AddAction(ActionEvent action, ActionBind actObject, bool paused) { ActionElement element = (ActionElement)actions.Get(actObject); if (element == null) { element = new ActionElement(actObject, paused); actions.Put(actObject, element); } CollectionUtils.Add(element.actions, action); action.Start(actObject); }
public void RemoveAllActions(ActionBind actObject) { if (actObject == null) { return; } ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { element.actions.Clear(); DeleteElement(element); } }
/// <summary> /// Adds a rule action to the group. /// </summary> /// <param name="expression">Rule action expression. /// The first parameter of the action expression must be <see cref="IContext"/>. /// Names and types of the rest of the expression parameters must match the names and types defined in the pattern declarations.</param> public void Action(LambdaExpression expression) { if (expression.Parameters.Count == 0 || expression.Parameters.First().Type != typeof(IContext)) { throw new ArgumentException( $"Action expression must have {typeof(IContext)} as its first parameter"); } IEnumerable <ParameterExpression> parameters = expression.Parameters.Skip(1); IEnumerable <Declaration> references = parameters.Select(p => Scope.Lookup(p.Name, p.Type)); var actionElement = new ActionElement(Scope.VisibleDeclarations, references, expression); _actions.Add(actionElement); }
// [System.Reflection.ObfuscationAttribute(Feature = "renaming")] public static string EnableCode(ActionElement action) { StringBuilder sb = new StringBuilder(); sb.Append(LinkAction.EnableLink(action)); //sb.Append(Environment.NewLine); //sb.Append(JSEvent(action, true)); if (action.Condition != String.Empty && action.DisabledImage != null) { sb.Append(Environment.NewLine); sb.Append(LoadBitmap(action, action.Image)); } sb.Append(Environment.NewLine); sb.Append(EnableImage(action)); return sb.ToString(); }
// [System.Reflection.ObfuscationAttribute(Feature = "renaming")] public static string DisableCode(ActionElement action) { StringBuilder sb = new StringBuilder(); sb.Append(LinkAction.DisableLink(action)); //sb.Append(Environment.NewLine); //sb.Append(JSEvent(action,false)); if (action.DisabledImage != null) { sb.Append(Environment.NewLine); sb.Append(LoadBitmap(action, action.DisabledImage)); } sb.Append(Environment.NewLine); sb.Append(DisableImage(action)); sb.Append(Environment.NewLine); sb.Append(ClearTooltip(action)); return sb.ToString(); }
public void RemoveAction(ActionEvent action) { if (action == null) { return; } ActionElement element = (ActionElement)actions.Get(action .GetOriginal()); if (element != null) { int i = element.actions.IndexOf(action); if (i != -1) { RemoveAction(i, element); } } }
public void Update(long elapsedTime) { int size = actions.Size(); for (int i = size - 1; i > -1; --i) { ActionElement currentTarget = (ActionElement)actions.Get(i); if (currentTarget == null) { continue; } lock (currentTarget) { if (!currentTarget.paused) { for (currentTarget.actionIndex = 0; currentTarget.actionIndex < currentTarget.actions .Count; currentTarget.actionIndex++) { currentTarget.currentAction = currentTarget.actions [currentTarget.actionIndex]; if (currentTarget.currentAction == null) { continue; } if (!currentTarget.currentAction.isInit) { currentTarget.currentAction.isInit = true; currentTarget.currentAction.OnLoad(); } currentTarget.currentAction.Step(elapsedTime); if (currentTarget.currentAction.IsComplete()) { currentTarget.currentAction.Stop(); RemoveAction(currentTarget.currentAction); } currentTarget.currentAction = null; } } if (currentTarget.actions.Count == 0) { DeleteElement(currentTarget); } } } }
public static IActionImplementation GetActionImplementation(ActionElement action) { if (action.MultiRowSelection) return new StandaloneMultiRowAction(action); if (action.InGrid) { if (action.Image != null) return new GridImageAction(action); else return new GridTextAction(action); } else { if (action.Image != null) return new StandaloneImageAction(action); else return new StandaloneButtonAction(action); } }
public void clearList() { /* foreach (Transform child in scroll.content.transform) * { * ActionElement act = child.GetComponent<ActionElement>(); * if(act) * { * act.deleteElement(); * } * } */ for (int i = scroll.content.transform.childCount - 1; i >= 0; i--) { ActionElement act = scroll.content.GetChild(i).GetComponent <ActionElement>(); if (act) { act.deleteElement(); } } }
internal static void FillRolesActions(ConfigurationDataSet dataSet, ActionElement action) { ArrayList roleList = GetRoleIdListByShortNames(dataSet.Role, action.Roles); foreach (Guid roleId in roleList) { if ((!FrameworkConfiguration.Current.WebApplication.EnableMultipleInstances) && (roleId == InstanceAdministratorRoleId)) { continue; } if (dataSet.RolesActions.FindByRoleIdActionId(roleId, action.Id) == null) { ConfigurationDataSet.RolesActionsRow rolesActionsRow = dataSet.RolesActions.NewRolesActionsRow(); rolesActionsRow.ActionId = action.Id; rolesActionsRow.RoleId = roleId; dataSet.RolesActions.AddRolesActionsRow(rolesActionsRow); } } }
/// <summary> /// Creates an action element that represents an action taken by the engine when the rule fires. /// </summary> /// <param name="expression">Action expression. It must have <see cref="IContext"/> as it's first parameter.</param> /// <param name="actionTrigger">Action trigger that indicates when the action should execute.</param> /// <returns>Created element.</returns> public static ActionElement Action(LambdaExpression expression, ActionTrigger actionTrigger) { if (expression == null) { throw new ArgumentNullException(nameof(expression), "Action expression not provided"); } if (actionTrigger == ActionTrigger.None) { throw new ArgumentException("Action trigger not provided"); } if (expression.Parameters.Count == 0 || expression.Parameters.First().Type != typeof(IContext)) { throw new ArgumentException($"Action expression must have {typeof(IContext)} as its first parameter. Action={expression}"); } var element = new ActionElement(expression, actionTrigger); return(element); }
public void RemoveAction(object tag, ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { if (element.actions != null) { int limit = element.actions.Count; for (int i = 0; i < limit; i++) { ActionEvent a = element.actions[i]; if (a.GetTag() == tag && a.GetOriginal() == actObject) { RemoveAction(i, element); } } } } }
public ActionEvent GetAction(object tag, ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { if (element.actions != null) { int limit = element.actions.Count; for (int i = 0; i < limit; i++) { ActionEvent a = element.actions[i]; if (a.GetTag() == tag) { return(a); } } } } return(null); }
public BaseAction(ActionElement action) { m_Action = action; }
public static string LoadBitmap(ActionElement action, Image image) { return String.Format("{0}.FromImage({1})", action.ControlName(), image.Name); }
protected internal override void VisitAction(Context context, ActionElement element) { }
private void _configureDialog(JsonValue json, JsonObject valuesJson){ if (json.ContainsKey("grouped")) { Style = bool.Parse(json["grouped"].ToString()) ? UITableViewStyle.Grouped : UITableViewStyle.Plain; } if (json.ContainsKey("title")) Title = json["title"]; if (json.ContainsKey("dataroot")) DataRootName = json["dataroot"]; if (json.ContainsKey("rightbaritem")){ var item = (JsonObject)json["rightbaritem"]; string datavalue = null, id = null; id = item.s("id"); if (valuesJson!=null && !string.IsNullOrEmpty(id)){ datavalue = valuesJson.s(id); } if (item.ContainsKey("action")) { rightBarItem = item.ContainsKey("url") ? new SubmitElement(item.s("caption"), datavalue ?? item.s("url"), null, null) : new ActionElement(item.s("caption"), datavalue ?? item.s("action"), null); rightBarItem.ID = id; } if (item.ContainsKey("image")){ NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIImage.FromBundle(item.s("image")), UIBarButtonItemStyle.Plain, (object o, EventArgs a)=>{ InvokeAction(this.rightBarItem); }); } else { NavigationItem.RightBarButtonItem = new UIBarButtonItem(item.s("caption"), UIBarButtonItemStyle.Plain, (object o, EventArgs a)=>{ InvokeAction(this.rightBarItem); }); } } if (json.ContainsKey("leftbaritem")){ var item = (JsonObject)json["leftbaritem"]; if (item.ContainsKey("action")) { leftBarItem = item.ContainsKey("url") ? new SubmitElement(item.s("caption"), item.s("url"), null, null) : new ActionElement(item.s("caption"), item.s("action"), null); leftBarItem.ID = item.s("id"); } NavigationItem.LeftBarButtonItem = new UIBarButtonItem(item.s("caption"), UIBarButtonItemStyle.Plain, (object o, EventArgs a)=>{ InvokeAction(this.leftBarItem); }); } }
private void DeleteElement(ActionElement element) { element.actions.Clear(); actions.Remove(element.key); }
public static bool IsStandard(ActionElement action) { return (IsStandard(action.Name)); }
public StandaloneButtonAction(ActionElement action) : base(action) { }
public static string ClearTooltip(ActionElement action) { return String.Format("{0}.Tooltiptext = ''", action.ControlName()); }
public static string EnableImage(ActionElement action) { return String.Format("{0}.Enabled = true", action.ControlName()); }
public static string JSEvent(ActionElement action, bool Enable) { return String.Format("{0}.JSEvent('onclick',!'{1}')", action.ControlName(), Enable.ToString().ToLower()); }
private void ImplementAction(ActionElement action) { action.CheckStandardAction(); action.CreateImplementation(); }
private void CreateDefaultAction(IGridObject gridObject, string name, string mode, string condition,string codeEnable, List<ActionElement> newActions) { if (gridObject.Actions.FindAction(name) == null) { // Resolve "default" mode value from settings file. if (mode == ModesElement.InsertValue.Default) { SettingsActionElement settingsAction = Settings.StandardActions.FindAction(name); if (settingsAction != null && ((settingsAction.DefaultMode && !(gridObject is PromptElement)) || (settingsAction.PromptMode && (gridObject is PromptElement)))) mode = ModesElement.InsertValue.True; } if (mode == ModesElement.InsertValue.True) { ActionElement action = new ActionElement(name); action.Condition = condition; action.CodeEnable = codeEnable; newActions.Add(action); } } }
private bool Write(ActionElement action) { if (action == null) return false; /* string[] lines = BreakIntoLines(action.Content.ToString(), _settings.WritablePageWidth()); if (!HaveRoomFor(lines.Length)) NewPage(); */ WriteContentNode(action.Content, PageSettings.InPoints(_settings.WritablePageWidth()), x => 0, l => { if(l > 0) { MoveDown(1); WriteRightAlignedLine("(CONTINUED)"); } NewPage(); }); /* foreach (string line in lines) { WriteLine(line); } EmptyLine(); */ return true; }
public GridAction(ActionElement action) : base(action) { }
private static void LoadControlAttributes(ConfigurationDataSet.ActionRow row, ActionElement action) { row.ActionId = action.Id; row.Name = action.Name; row.Description = action.Description; }
public StandaloneImageAction(ActionElement action) : base(action) { }
private static void LoadGlobalNavigationLinkAttributes(ConfigurationDataSet.ActionRow row, ActionElement action) { row.NavigateUrl = action.NavigateUrl; row.OrderNumber = action.OrderNumber; row.AuthenticationRequired = action.AuthenticationRequired; row.OrganizationRequired = action.OrganizationRequired; row.InstanceRequired = action.InstanceRequired; row.Visible = action.Visible; LoadControlAttributes(row, action); LoadDetailMenuAttributes(row, action.DetailMenu); }
public StandaloneMultiRowAction(ActionElement action) : base(action) { }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as ProcessRequest; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (ActionElement != null) { dest.ActionElement = (Code <Hl7.Fhir.Model.ProcessRequest.ActionList>)ActionElement.DeepCopy(); } if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Ruleset != null) { dest.Ruleset = (Hl7.Fhir.Model.Coding)Ruleset.DeepCopy(); } if (OriginalRuleset != null) { dest.OriginalRuleset = (Hl7.Fhir.Model.Coding)OriginalRuleset.DeepCopy(); } if (CreatedElement != null) { dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); } if (Target != null) { dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); } if (Provider != null) { dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); } if (Organization != null) { dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); } if (Request != null) { dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); } if (Response != null) { dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); } if (NullifyElement != null) { dest.NullifyElement = (Hl7.Fhir.Model.FhirBoolean)NullifyElement.DeepCopy(); } if (ReferenceElement != null) { dest.ReferenceElement = (Hl7.Fhir.Model.FhirString)ReferenceElement.DeepCopy(); } if (Item != null) { dest.Item = new List <Hl7.Fhir.Model.ProcessRequest.ItemsComponent>(Item.DeepCopy()); } if (IncludeElement != null) { dest.IncludeElement = new List <Hl7.Fhir.Model.FhirString>(IncludeElement.DeepCopy()); } if (ExcludeElement != null) { dest.ExcludeElement = new List <Hl7.Fhir.Model.FhirString>(ExcludeElement.DeepCopy()); } if (Period != null) { dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); } return(dest); }
private void AddSuggestActions(ActionsElement actions, HPatternSettings settings,bool trn,bool prt,bool tab) { foreach (SettingsSuggestActionElement act in settings.SuggestActions) { if ((act.SuggestSelection && trn == false && prt == false && tab == false) || (act.SuggestTransaction && trn == true) || (act.SuggestPrompt && prt == true) || (act.SuggestViewTab && tab == true)) { ActionElement action = new ActionElement(); action.Name = act.Name; action.Caption = act.Caption; action.Legend = act.Legend; action.Gxobject = act.Gxobject; action.InGrid = act.InGrid; action.MultiRowSelection = act.MultiRowSelection; action.Image = act.Image; action.DisabledImage = act.DisabledImage; action.Tooltip = act.Tooltip; action.Condition = act.Condition; action.ButtonClass = act.ButtonClass; action.EventCode = act.EventCode; action.CodeEnable = act.CodeEnable; action.Position = act.Position; action.Width = act.Width; action.GridHeight = act.GridHeight; action.GridWidth = act.GridWidth; // Parametros foreach (SettingsSuggestParameterElement par in act.Parameters) { ParameterElement pare = new ParameterElement(); pare.Name = par.Name; pare.Domain = par.Domain; pare.Null = par.Null; action.Parameters.Add(pare); } actions.Add(action); } } }
public static string DisableLink(ActionElement action) { return String.Format(CultureInfo.InvariantCulture, "{0}.Link = \"\"", action.ControlName()); }
protected internal virtual void VisitAction(TContext context, ActionElement element) { }
public static string EnableLink(ActionElement action) { return String.Format(CultureInfo.InvariantCulture, "{0}.Link = {1}", action.ControlName(), action.FormatMethod("Link", action.Parameters.List())); }