public ScopeDisplayGroupInstance Create(string name, string description, UriInstance owningSiteUrl, bool displayInAdminUI) { var result = m_scopeDisplayGroupCollection.Create(name, description, owningSiteUrl.Uri, displayInAdminUI); return(result == null ? null : new ScopeDisplayGroupInstance(Engine, result)); }
public override int GetHashCode() { return(HashCode.Combine( UriInstance.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped), UriInstance.GetComponents(UriComponents.Path, UriFormat.Unescaped), UriInstance.GetComponents(UriComponents.Query, UriFormat.Unescaped), MethodInstance )); }
public ScopeInstance Create(string name, string description, UriInstance owningSiteUrl, bool displayInAdminUI, string scopeCompilationType, string alternateResultsPage, string filter) { ScopeCompilationType type; scopeCompilationType.TryParseEnum(true, ScopeCompilationType.AlwaysCompile, out type); var result = m_scopeCollection.Create(name, description, owningSiteUrl.Uri, displayInAdminUI, alternateResultsPage, type, filter); return(result == null ? null : new ScopeInstance(Engine, result)); }
public ScopeDisplayGroupInstance GetDisplayGroup(UriInstance siteUrl, string name) { if (siteUrl == null) { throw new JavaScriptException(Engine, "Error", "SiteUrl argument must be specified and an instance of UriInstance"); } var result = m_remoteScopes.GetDisplayGroup(siteUrl.Uri, name); return(result == null ? null : new ScopeDisplayGroupInstance(Engine, result)); }
public override string ToString() { var str = $"{Method} {UriInstance.ToString()}"; if (Fields.Count > 0) { str += $" ({Fields.Count} fields)"; } if (Headers.Count > 0) { str += $" ({Headers.Count} headers)"; } return(str); }
public bool MatchesExceptQuery(HttpResource that) { if (UriInstance.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped) != that.UriInstance.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped)) { return(false); } if (UriInstance.GetComponents(UriComponents.Path, UriFormat.Unescaped) != that.UriInstance.GetComponents(UriComponents.Path, UriFormat.Unescaped)) { return(false); } if (!MethodInstance.Equals(that.MethodInstance)) { return(false); } return(true); }
public override bool Equals(object obj) { if (!(obj is HttpResource)) { return(false); } var that = (HttpResource)obj; if (!MatchesExceptQuery(that)) { return(false); } if (UriInstance.GetComponents(UriComponents.Query, UriFormat.Unescaped) != that.UriInstance.GetComponents(UriComponents.Query, UriFormat.Unescaped)) { return(false); } return(true); }
public ArrayInstance GetUnusedScopesForSite(UriInstance siteUrl) { if (siteUrl == null) { throw new JavaScriptException(Engine, "Error", "SiteUrl argument must be specified and an instance of UriInstance"); } var scopes = m_remoteScopes.GetUnusedScopesForSite(siteUrl.Uri); if (scopes == null) { return(null); } var result = Engine.Array.Construct(); foreach (var scope in scopes.OfType <Scope>()) { ArrayInstance.Push(result, new ScopeInstance(Engine, scope)); } return(result); }