/// <summary>
        /// Handles the ProjectItemPropertiesRequested event of the TypeDefinition control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Microsoft.VisualStudio.SharePoint.SharePointProjectItemPropertiesRequestedEventArgs"/> instance containing the event data.</param>
        void TypeDefinition_ProjectItemPropertiesRequested(object sender, SharePointProjectItemPropertiesRequestedEventArgs e)
        {
            SPMetalDefinitionProperties properties = e.ProjectItem.Annotations.GetValue <SPMetalDefinitionProperties>();

            if (properties == null)
            {
                properties = new SPMetalDefinitionProperties(this, e.ProjectItem, e.ProjectItem.ExtensionData);
                e.ProjectItem.Annotations.Add <SPMetalDefinitionProperties>(properties);
            }
            e.PropertySources.Add(properties);
        }
Example #2
0
        private void ProjectItemPropertiesRequested(object sender,
                                                    SharePointProjectItemPropertiesRequestedEventArgs e)
        {
            CustomActionProperties properties;

            // If the properties object already exists, get it from the project item's annotations.
            if (!e.ProjectItem.Annotations.TryGetValue(out properties))
            {
                // Otherwise, create a new properties object and add it to the annotations.
                properties = new CustomActionProperties(e.ProjectItem);
                e.ProjectItem.Annotations.Add(properties);
            }

            e.PropertySources.Add(properties);
        }
Example #3
0
        private void ProjectItemPropertiesRequested(object sender,
            SharePointProjectItemPropertiesRequestedEventArgs e)
        {
            CustomActionProperties properties;

            // If the properties object already exists, get it from the project item's annotations.
            if (!e.ProjectItem.Annotations.TryGetValue(out properties))
            {
                // Otherwise, create a new properties object and add it to the annotations.
                properties = new CustomActionProperties(e.ProjectItem);
                e.ProjectItem.Annotations.Add(properties);
            }

            e.PropertySources.Add(properties);
        }
        // Creates a custom property for this project item.
        void projectItemTypeDefinition_ProjectItemPropertiesRequested(object sender,
                                                                      SharePointProjectItemPropertiesRequestedEventArgs e)
        {
            SiteColumnProperties properties = null;

            // If the Properties object already exists, get it from the project item's annotations.
            if (!e.ProjectItem.Annotations.TryGetValue(out properties))
            {
                // Otherwise, create a new Properties object and add it to the annotations.
                properties = new SiteColumnProperties(e.ProjectItem);
                e.ProjectItem.Annotations.Add(properties);
            }

            e.PropertySources.Add(properties);
        }
        private void ProjectItemPropertiesRequested(object sender,
                                                    SharePointProjectItemPropertiesRequestedEventArgs e)
        {
            CustomActionProperties properties;

            // 如果项目对象已经存在,请从项目项的注释获取它。
            if (!e.ProjectItem.Annotations.TryGetValue(out properties))
            {
                // 否则,请创建一个新的属性对象,并将其添加到注释。
                properties = new CustomActionProperties(e.ProjectItem);
                e.ProjectItem.Annotations.Add(properties);
            }

            e.PropertySources.Add(properties);
        }
        private void ProjectItemPropertiesRequested(object sender,
            SharePointProjectItemPropertiesRequestedEventArgs e)
        {
            CustomActionProperties properties;

            // 如果项目对象已经存在,请从项目项的注释获取它。
            if (!e.ProjectItem.Annotations.TryGetValue(out properties))
            {
                // 否则,请创建一个新的属性对象,并将其添加到注释。
                properties = new CustomActionProperties(e.ProjectItem);
                e.ProjectItem.Annotations.Add(properties);
            }

            e.PropertySources.Add(properties);
        }
 /// <summary>
 /// Handles the ProjectItemPropertiesRequested event of the TypeDefinition control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="Microsoft.VisualStudio.SharePoint.SharePointProjectItemPropertiesRequestedEventArgs"/> instance containing the event data.</param>
 void TypeDefinition_ProjectItemPropertiesRequested(object sender, SharePointProjectItemPropertiesRequestedEventArgs e)
 {
     e.PropertySources.Add(new FullTrustProxyProperties(this, e.ProjectItem));
 }