public void ResetPersonalizationState(SPWebPartInstance webPart)
        {
            if (webPart == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A web part must be supplied as the first argument.");
            }

            m_limitedWebPartManager.ResetPersonalizationState(webPart.WebPart);
        }
        public void SaveChanges(SPWebPartInstance webPart)
        {
            if (webPart == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A web part must be supplied as the first argument.");
            }

            m_limitedWebPartManager.SaveChanges(webPart.WebPart);
        }
        public void MoveWebPart(SPWebPartInstance webPart, string zoneId, int zoneIndex)
        {
            if (webPart == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A web part must be supplied as the first argument.");
            }

            m_limitedWebPartManager.MoveWebPart(webPart.WebPart, zoneId, zoneIndex);
        }
        public string GetZoneId(SPWebPartInstance webPart)
        {
            if (webPart == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A web part must be supplied as the first argument.");
            }

            return(m_limitedWebPartManager.GetZoneID(webPart.WebPart));
        }
Example #5
0
        public int IndexOf(SPWebPartInstance value)
        {
            if (value == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A web part must be provided as the first argument.");
            }

            return(m_limitedWebPartCollection.IndexOf(value.WebPart));
        }
        public GuidInstance GetStorageKey(SPWebPartInstance webPart)
        {
            if (webPart == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A web part must be supplied as the first argument.");
            }

            var result = m_limitedWebPartManager.GetStorageKey(webPart.WebPart);

            return(new GuidInstance(this.Engine.Object.InstancePrototype, result));
        }
        public Base64EncodedByteArrayInstance ExportWebPart(SPWebPartInstance webPart)
        {
            if (webPart == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A web part must be supplied as the first argument.");
            }

            using (var ms = new MemoryStream())
            {
                var writer = XmlWriter.Create(ms);
                m_limitedWebPartManager.ExportWebPart(webPart.WebPart, writer);
                writer.Flush();
                return(new Base64EncodedByteArrayInstance(this.Engine.Object.InstancePrototype, ms.ToArray()));
            }
        }