public override object ExecuteAction(BaseActionItem actionItem) { GithubConnector connector = (GithubConnector)this.RootNode.NodeConnector; switch (actionItem.Action) { case NodeActions.Open: OpenActionResult oar = new OpenActionResult(); oar.Source = connector.GetSource(this.Url); var els = this.Url.Split('.'); oar.Language = els[els.Length - 1]; return(oar); case NodeActions.Save: return(connector.GetSource(this.Url)); case NodeActions.Copy: if (actionItem.Name == "Copy link") { return(this._file.html_url); } else { return(null); } default: return(null); } }
public override object GetDefaultSource() { GithubConnector connector = (GithubConnector)this.RootNode.NodeConnector; OpenActionResult oar = new OpenActionResult(); oar.Source = connector.GetSource(this.Url); var els = this.Url.Split('.'); oar.Language = els[els.Length - 1]; return(oar); }