Skip to content

Commit

Permalink
remove SINGLE_FILE_GENERATOR
Browse files Browse the repository at this point in the history
  • Loading branch information
enricosada committed Apr 9, 2015
1 parent 815e280 commit 474d880
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 1,163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ public virtual DTE DTE

public virtual void RunCustomTool()
{
#if SINGLE_FILE_GENERATOR
this.FileNode.RunGenerator();
#endif
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,7 @@ internal FileNode(ProjectNode root, ProjectElement element, uint? hierarchyId =

public /*protected, but public for FSharp.Project.dll*/ override NodeProperties CreatePropertiesObject()
{
#if SINGLE_FILE_GENERATOR
ISingleFileGenerator generator = this.CreateSingleFileGenerator();

return generator == null ? new FileNodeProperties(this) : new SingleFileGeneratorNodeProperties(this);
#else
return new FileNodeProperties(this);
#endif
}

public override object GetIconHandle(bool open)
Expand Down Expand Up @@ -495,29 +489,6 @@ internal override DocumentManager GetDocumentManager()
}
}

// Exec on special filenode commands
if (cmdGroup == VsMenus.guidStandardCommandSet2K)
{
#if SINGLE_FILE_GENERATOR
switch ((VsCommands2K)cmd)
{
case VsCommands2K.RUNCUSTOMTOOL:
{
try
{
this.RunGenerator();
return VSConstants.S_OK;
}
catch (Exception e)
{
Trace.WriteLine("Running Custom Tool failed : " + e.Message);
throw;
}
}
}
#endif
}

return base.ExecCommandOnNode(cmdGroup, cmd, nCmdexecopt, pvaIn, pvaOut);
}

Expand Down Expand Up @@ -550,16 +521,6 @@ internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
#if SINGLE_FILE_GENERATOR
if ((VsCommands2K)cmd == VsCommands2K.RUNCUSTOMTOOL)
{
if (string.IsNullOrEmpty(this.ItemNode.GetMetadata(ProjectFileConstants.DependentUpon)) && (this.NodeProperties is SingleFileGeneratorNodeProperties))
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
#endif
}
else
{
Expand Down Expand Up @@ -938,17 +899,6 @@ public virtual string FileName
File.Move(oldName, newName);
}

#if SINGLE_FILE_GENERATOR
/// <summary>
/// factory method for creating single file generators.
/// </summary>
/// <returns></returns>
public /*protected, but public for FSharp.Project.dll*/ virtual ISingleFileGenerator CreateSingleFileGenerator()
{
return new SingleFileGenerator(this.ProjectMgr);
}
#endif

/// <summary>
/// This method should be overridden to provide the list of special files and associated flags for source control.
/// </summary>
Expand Down Expand Up @@ -1117,47 +1067,7 @@ private void RenameCaseOnlyChange(string newFileName)

#endregion

#region SingleFileGenerator Support methods
#if SINGLE_FILE_GENERATOR
/// <summary>
/// Event handler for the Custom tool property changes
/// </summary>
/// <param name="sender">FileNode sending it</param>
/// <param name="e">Node event args</param>
/*internal, but public for FSharp.Project.dll*/
internal virtual void OnCustomToolChanged(object sender, HierarchyNodeEventArgs e)
{
this.RunGenerator();
}

/// <summary>
/// Event handler for the Custom tool namespce property changes
/// </summary>
/// <param name="sender">FileNode sending it</param>
/// <param name="e">Node event args</param>
/*internal, but public for FSharp.Project.dll*/
internal virtual void OnCustomToolNameSpaceChanged(object sender, HierarchyNodeEventArgs e)
{
this.RunGenerator();
}
#endif
#endregion

#region helpers
#if SINGLE_FILE_GENERATOR
/// <summary>
/// Runs a generator.
/// </summary>
/*internal, but public for FSharp.Project.dll*/
public void RunGenerator()
{
ISingleFileGenerator generator = this.CreateSingleFileGenerator();
if (generator != null)
{
generator.RunGenerator(this.Url);
}
}
#endif

/// <summary>
/// Update the ChildNodes after the parent node has been renamed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,93 +776,6 @@ public override string GetClassName()
#endregion
}

#if SINGLE_FILE_GENERATOR
[CLSCompliant(false), ComVisible(true)]
public class SingleFileGeneratorNodeProperties : FileNodeProperties
{
#region fields
private EventHandler<HierarchyNodeEventArgs> onCustomToolChanged;
private EventHandler<HierarchyNodeEventArgs> onCustomToolNameSpaceChanged;
public /*protected, but public for FSharp.Project.dll*/ string _customTool = "";
public /*protected, but public for FSharp.Project.dll*/ string _customToolNamespace = "";
#endregion

#region custom tool events
/*internal, but public for FSharp.Project.dll*/ public event EventHandler<HierarchyNodeEventArgs> OnCustomToolChanged
{
add { onCustomToolChanged += value; }
remove { onCustomToolChanged -= value; }
}

/*internal, but public for FSharp.Project.dll*/ public event EventHandler<HierarchyNodeEventArgs> OnCustomToolNameSpaceChanged
{
add { onCustomToolNameSpaceChanged += value; }
remove { onCustomToolNameSpaceChanged -= value; }
}

#endregion

#region properties
[SRCategoryAttribute(SR.Advanced)]
[LocDisplayName(SR.CustomTool)]
[SRDescriptionAttribute(SR.CustomToolDescription)]
public virtual string CustomTool
{
get
{
_customTool = this.Node.ItemNode.GetMetadata(ProjectFileConstants.Generator);
return _customTool;
}
set
{
_customTool = value;
if (!string.IsNullOrEmpty(_customTool))
{
this.Node.ItemNode.SetMetadata(ProjectFileConstants.Generator, _customTool);
HierarchyNodeEventArgs args = new HierarchyNodeEventArgs(this.Node);
if (onCustomToolChanged != null)
{
onCustomToolChanged(this.Node, args);
}
}
}
}

[SRCategoryAttribute(SR.Advanced)]
[LocDisplayName(SR.CustomToolNamespace)]
[SRDescriptionAttribute(SR.CustomToolNamespaceDescription)]
public virtual string CustomToolNamespace
{
get
{
_customToolNamespace = this.Node.ItemNode.GetMetadata(ProjectFileConstants.CustomToolNamespace);
return _customToolNamespace;
}
set
{
_customToolNamespace = value;
if (!string.IsNullOrEmpty(_customToolNamespace))
{
this.Node.ItemNode.SetMetadata(ProjectFileConstants.CustomToolNamespace, _customToolNamespace);
HierarchyNodeEventArgs args = new HierarchyNodeEventArgs(this.Node);
if (onCustomToolNameSpaceChanged != null)
{
onCustomToolNameSpaceChanged(this.Node, args);
}
}
}
}
#endregion

#region ctors
internal SingleFileGeneratorNodeProperties(HierarchyNode node)
: base(node)
{
}
#endregion
}
#endif

[CLSCompliant(false), ComVisible(true)]
public class ProjectNodeProperties : NodeProperties
, VSLangProj.ProjectProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
<Compile Include="..\RegistrationAttributes\WAProvideLanguagePropertyAttribute.cs" />
<Compile Include="..\RegistrationAttributes\WAProvideProjectFactoryAttribute.cs" />
<Compile Include="..\RegistrationAttributes\WAProvideProjectFactoryTemplateMappingAttribute.cs" />
<Compile Include="..\RegistrationAttributes\SingleFileGeneratorSupportRegistrationAttribute.cs" />
<Compile Include="Misc\ConnectionPointContainer.cs" />
<Compile Include="Misc\ExternDll.cs" />
<Compile Include="Misc\NativeMethods.cs" />
Expand Down Expand Up @@ -160,8 +159,6 @@
<Compile Include="PropertiesEditorLauncher.cs" />
<Compile Include="ReferenceContainerNode.cs" />
<Compile Include="ReferenceNode.cs" />
<Compile Include="SingleFileGenerator.cs" />
<Compile Include="SingleFileGeneratorFactory.cs" />
<Compile Include="SolutionListener.cs" />
<Compile Include="SolutionListenerForProjectEvents.cs" />
<Compile Include="SolutionListenerForProjectOpen.cs" />
Expand Down
Loading

0 comments on commit 474d880

Please sign in to comment.