/// <summary> /// Initializes a new instance of the <see cref="NodeAction" /> class. /// </summary> /// <param name="type">The type.</param> public NodeAction(NodeActionType type, Type actionSS = null, string caption = null) { this.ActionType = type; this.Caption = string.IsNullOrEmpty(caption) ? type.ToCaption() : caption; this.SelectionMode = PfeSelection.Single; bool hasActionIcon = type.GetType().GetField(type.ToString()).HasAttribute <NodeActionIconAttribute>(); this.ActionIcon = hasActionIcon ? type.GetType().GetField(type.ToString()).FirstAttribute <NodeActionIconAttribute>().Icon : NodeActionIcons.Default; if (actionSS != null) { if (actionSS.HasAttribute <RouteAttribute>()) { this.url = string.Format("{0}{1}", HierarchyNodeExtensions.GetStartUrl(actionSS), actionSS.FirstAttribute <RouteAttribute>().Path); if (this.url.Contains("{")) { this.url = this.url.Substring(0, this.url.IndexOf("{")); } } } //nastavenie IdField pre zname akcie (a ine nastavenia podla typu) switch (type) { case NodeActionType.ZmenaStavu: case NodeActionType.Delete: this.SelectionMode = PfeSelection.Multi; break; case NodeActionType.ZobrazitRozhodnutiaDcom: this.Url = "https://egov.intra.dcom.sk/DAP/#dap-roz"; break; case NodeActionType.ZobrazitCiselnikyDcom: this.Url = "https://egov.intra.dcom.sk/DAP/#dap-cis-ndas"; break; } }