コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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));
        }
コード例 #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));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        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()));
            }
        }