Exemple #1
0
        /// <summary>
        /// Handles the Click event of the copyIdItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="MenuItemEventArgs" /> instance containing the event data.</param>
        void copyIdItem_Click(object sender, MenuItemEventArgs e)
        {
            IExplorerNode  owner      = (IExplorerNode)e.Owner;
            IFieldNodeInfo annotation = owner.Annotations.GetValue <IFieldNodeInfo>();

            if (annotation.Id != null)
            {
                Clipboard.SetData(DataFormats.Text, annotation.Id.ToString("B"));
            }
        }
Exemple #2
0
 /// <summary>
 /// Nodes the properties requested.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="ExplorerNodePropertiesRequestedEventArgs" /> instance containing the event data.</param>
 void NodePropertiesRequested(object sender, ExplorerNodePropertiesRequestedEventArgs e)
 {
     try
     {
         IFieldNodeInfo info = e.Node.Annotations.GetValue <IFieldNodeInfo>();
         if (info.ListId == Guid.Empty && String.IsNullOrEmpty(info.ContentTypeName))
         {
             IDictionary <string, string> fieldProperties = e.Node.Context.SharePointConnection.ExecuteCommand <FieldNodeInfo, Dictionary <string, string> >(SiteColumnsSharePointCommandIds.GetProperties, info as FieldNodeInfo);
             object propertySource = e.Node.Context.CreatePropertySourceObject(fieldProperties);
             e.PropertySources.Add(propertySource);
         }
     }
     catch (Exception ex)
     {
         DTEManager.ProjectService.Logger.WriteLine("EXCEPTION: " + ex.Message, LogCategory.Error);
     }
 }