Skip to content

Commit

Permalink
Adding readme files to each project
Browse files Browse the repository at this point in the history
Some renames of folders and files for consistency
Adding more comments
  • Loading branch information
ccifra committed Aug 4, 2016
1 parent 1146470 commit cc8ca91
Show file tree
Hide file tree
Showing 29 changed files with 1,073 additions and 1,050 deletions.
2 changes: 1 addition & 1 deletion ExamplePlugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExamplePlugins", "ExamplePl
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fan", "FanControl\Fan.csproj", "{685D89F2-690D-4F75-9F01-066A8168F97A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FanEditorExtensions", "FanDemo\FanEditorExtensions.csproj", "{BC278533-292A-4A6A-B650-62C50E817D26}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FanEditorExtensions", "FanPlugin\FanEditorExtensions.csproj", "{BC278533-292A-4A6A-B650-62C50E817D26}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgrammaticControl", "ProgrammaticControl\ProgrammaticControl.csproj", "{B7D36151-14CC-4AD7-BC19-58A5449419FD}"
EndProject
Expand Down
113 changes: 60 additions & 53 deletions ...ram/Design/ExampleDiagramNodeViewModel.cs → ...ampleDiagram/Design/BasicNodeViewModel.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,53 +1,60 @@
using System;
using System.Linq;
using NationalInstruments.Composition;
using NationalInstruments.Core;
using NationalInstruments.Controls.Shell;
using NationalInstruments.Design;
using NationalInstruments.SourceModel;
using NationalInstruments.Shell;
using ExamplePlugins.ExampleNode.Model;

namespace ExamplePlugins.ExampleDiagram.Design
{
/// <summary>
/// The ViewModel for the Example Diagram Node
/// The ViewModel controls the interaction with the user
/// </summary>
public class ExampleDiagramNodeViewModel : NodeViewModel
{
/// <summary>
/// Constructs a new instance
/// </summary>
/// <param name="model">The model element we are bound to</param>
public ExampleDiagramNodeViewModel(Node model) :
base(model)
{
}

/// <summary>
/// Returns the Uri (resource location) for our node foreground image
/// </summary>
protected override ViewModelUri ForegroundUri
{
get { return new ViewModelUri(GetType(), "Resources/Cow"); }
}

/// <summary>
/// Returns the render data for our node's foreground image
/// </summary>
public override NineGridData ForegroundImageData
{
get { return new ViewModelIconData(this) { ImageUri = ForegroundUri }; }
}

/// <summary>
/// Creates the content to put into the command bar when the node is selected
/// </summary>
/// <param name="context">The current presentation context</param>
public override void CreateCommandContent(ICommandPresentationContext context)
{
base.CreateCommandContent(context);
}
}
}
using System;
using System.Linq;
using NationalInstruments.Composition;
using NationalInstruments.Core;
using NationalInstruments.Controls.Shell;
using NationalInstruments.Design;
using NationalInstruments.SourceModel;
using NationalInstruments.Shell;
using ExamplePlugins.ExampleNode.Model;

namespace ExamplePlugins.ExampleDiagram.Design
{
/// <summary>
/// The ViewModel for the Basic Diagram Node
/// The ViewModel controls the interaction with the user
/// This node uses the standard static node view for the actual UI so there is not
/// a UI class that needs to be implemented.
/// </summary>
public class BasicNodeViewModel : NodeViewModel
{
/// <summary>
/// Constructs a new instance
/// </summary>
/// <param name="model">The model element we are bound to</param>
public BasicNodeViewModel(Node model) :
base(model)
{
}

/// <summary>
/// Returns the Uri (resource location) for our node foreground image
/// </summary>
protected override ViewModelUri ForegroundUri
{
get
{
// We are loading the vector ninegrid out of a resource
// this will be rendered on the default node visual.
return new ViewModelUri(GetType(), "Resources/Cow");
}
}

/// <summary>
/// Returns the render data for our node's foreground image
/// </summary>
public override NineGridData ForegroundImageData
{
get { return new ViewModelIconData(this) { ImageUri = ForegroundUri }; }
}

/// <summary>
/// Creates the content to put into the command bar when the node is selected
/// </summary>
/// <param name="context">The current presentation context</param>
public override void CreateCommandContent(ICommandPresentationContext context)
{
base.CreateCommandContent(context);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public override Document CreateDocument(Envoy envoy)
}
}

/// <summary>
/// This is the document for the diagram editor. The document is the root view model for the editor.
/// it is what owns and manages the editor. It
/// </summary>
public class ExampleDiagramDocument : SourceFileDocument
{
protected override IEnumerable<IDocumentEditControlInfo> CreateDefaultEditControls()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ExamplePluginsViewModelProvider : ViewModelProvider
{
public ExamplePluginsViewModelProvider()
{
AddSupportedModel<ExampleDiagramNode>(e => new ExampleDiagramNodeViewModel(e));
AddSupportedModel<BasicNode>(e => new BasicNodeViewModel(e));
AddSupportedModel<InteractiveNode>(e => new InteractiveNodeViewModel(e));
AddSupportedModel<Wire>(e => new ExampleDiagramWireViewModel(e));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@

namespace ExamplePlugins.ExampleDiagram.Design
{
/// <summary>
/// This class is the visual control that is used for the root diagram of the diagram editor
/// The base class handles the majority of the work but you can override various behaviors
/// </summary>
public class ExampleRootDiagramCanvas : RootDiagramCanvas
{
/// <summary>
/// The default constructor
/// </summary>
public ExampleRootDiagramCanvas()
{
// Set the background color of the diagram to something interesting
// This can be any color but it should not be null or transparent.
Background = Brushes.Azure;
}
}
Expand Down
Loading

0 comments on commit cc8ca91

Please sign in to comment.