博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Inside SharePoint 2010 (3): Developing a SharePoint Solution (Class Library Project)
阅读量:7294 次
发布时间:2019-06-30

本文共 2482 字,大约阅读时间需要 8 分钟。

#1, Create solution structure

 

 

#2:  feature.xml

<
Feature
Id
="86689158-7048-4421-AD21-E0DEF0D67C81"
Title
="Wingtip Lead Tracker"
Description
="A sample feature deployed using LocalhostDevProject1.wsp"
Version
="1.0.0.0"
Scope
="Web"
Hidden
="FALSE"
 
ReceiverAssembly
="LocalhostDevProject1, [four-part assembly name, use refector to get]"
 
ReceiverClass
="LocalhostDevProject1.FeatureReceiver"
ImageUrl
="LocalhostDevProject1/FeatureIcon.gif"
xmlns
="http://schemas.microsoft.com/sharepoint/"
 
>
  
<
ElementManifests
>
    
<
ElementManifest 
Location
="elements.xml"
/>
  
</
ElementManifests
>
</
Feature
>

 

 

 #3, elements.xml

<
Elements 
xmlns
="http://schemas.microsoft.com/sharepoint/"
>
  
<
ListInstance 
    
FeatureId
="00BFEA71-7E6D-4186-9BA8-C047AC750105"
 
    TemplateType
="105"
 
    Id
="SalesLeads"
 
    Title
="Sales Leads"
 
    Url
="SalsLeads"
 
    OnQuickLaunch
="true"
/>
</
Elements
>

 

 #4, FeatureReceiver.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
namespace LocalhostDevProject1
{
    public class FeatureReceiver : SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties props)
        {
            SPWeb site = props.Feature.Parent as SPWeb;
            if (site != null) {
                site.Title = "Feature Activated";
                site.SiteLogoUrl = @"_layouts/images/LocalhostDevProject1/SiteIcon.gif";
                site.Update();
            }
        }
        public override void FeatureDeactivating(SPFeatureReceiverProperties props)
        {
            SPWeb site = props.Feature.Parent as SPWeb;
            if (site != null)
            {
                site.Title = "Feature Deactivated";
                site.SiteLogoUrl = "";
                site.Update();
                SPList list = site.Lists.TryGetList("Sales Leads");
                if (list != null)
                {
                    list.Delete();
                }
            }
        }
    }
}

 

 #5, manifest.xml

<
Solution 
xmlns
="http://schemas.microsoft.com/sharepoint/"
          SolutionId
="0cee8f44-4892-4a01-b8f4-b07aa21e1ef2"
          Title
="Localhost Dev Project 1"
 
          DeploymentServerType
="WebFrontEnd"
 
          ResetWebServer
="true"
>
  
<
FeatureManifests
>
    
<
FeatureManifest 
Location
="LocalhostDevProject1\feature.xml"
/>
  
</
FeatureManifests
>
  
<
TemplateFiles
>
    
<
TemplateFile 
Location
="IMAGES\LocalhostDevProject1\FeatureIcon.gif"
/>
    
<
TemplateFile 
Location
="IMAGES\LocalhostDevProject1\SiteIcon.gif"
/>
  
</
TemplateFiles
>
  
<
Assemblies
>
    
<
Assembly 
Location
="LocalhostDevProject1.dll"
 DeploymentTarget
="GlobalAssemblyCache"
/>
  
</
Assemblies
>
  
<
ActivationDependencies
>
    
<
ActivationDependency 
SolutionId
=""
 SolutionName
=""
/>
  
</
ActivationDependencies
>
</
Solution
>

 

 

 

 

转载于:https://www.cnblogs.com/thlzhf/archive/2012/11/13/2769009.html

你可能感兴趣的文章
[Swift]UIKit学习之UISegSmentedControl的用法
查看>>
MySQL用户管理、常用SQL语句、MySQL数据库备份恢复
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
js怎么获取访问页数记录(知道的能不能告诉我一下)
查看>>
Android 插件化总结
查看>>
Ubuntu上安装TensorFlow(python2.7版)
查看>>
commons-logging和log4j
查看>>
TurboMail邮件系统支持HTTPS双向认证
查看>>
Apache Flink 官方文档--概览
查看>>
百度ueditor编辑器动态获取项目根目录
查看>>
Swift类扩展使用方法
查看>>
DSP/BIOS实时操作系统中PIP对象多任务间传递数据示例程序
查看>>
开发步骤 采用restful接口开发的开发步骤
查看>>
[置顶] Jquery为单选框checkbox绑定单击事件
查看>>
[置顶] Mybatis技术(二) MyBatis-Spring
查看>>
实用菜单
查看>>
Properties 配置文件参数 注入bean中
查看>>
多少人败给一个等字
查看>>
观后感《强风正劲》
查看>>