Example #1
0
        public ObjectInstance CountWorkflowsInWeb(SPWebInstance web)
        {
            if (web == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "An instance of a SPWeb object must be supplied as the first argument.");
            }

            var result = m_workflowManager.CountWorkflows(web.Web);

            var obj = this.Engine.Object.Construct();

            foreach (var r in result)
            {
                obj.SetPropertyValue(r.Key.ToString(), r.Value, false);
            }
            return(obj);
        }