Skip to content

Commit

Permalink
Added the Beyond Dynamo GitHub Link
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelvanHerwaardenRHDHV committed Jan 25, 2019
1 parent f633344 commit b956ffb
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 64 deletions.
98 changes: 70 additions & 28 deletions src/BeyondDynamo/BeyondDynamoExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ public class BeyondDynamoExtension : IViewExtension
/// </summary>
private MenuItem OrderPlayerInput;

/// <summary>
/// Mark input nodes Menu Item
/// </summary>
private MenuItem MarkInputNodes;

/// <summary>
/// Unmark input nodes Menu Item
/// </summary>
private MenuItem UnmarkInputNodes;

/// <summary>
/// Mark output nodes Menu Item
/// </summary>
private MenuItem MarkOutputNodes;

/// <summary>
/// Unmark output nodes Menu Item
/// </summary>
private MenuItem UnmarkOutputNodes;

/// <summary>
/// About Window Menu Item
/// </summary>
Expand Down Expand Up @@ -79,7 +99,7 @@ public string Name
{
get
{
return "Remove Trace Data";
return "Beyond Dynamo 2.0";
}
}
#endregion
Expand All @@ -93,8 +113,7 @@ public void Loaded(ViewLoadedParams p)
BDmenuItem = new MenuItem { Header = "Beyond Dynamo" };
DynamoViewModel VM = p.DynamoWindow.DataContext as DynamoViewModel;

//This can be run anytime
#region
#region THIS CAN BE RUN ANYTIME

OrderPlayerInput = new MenuItem { Header = "Order Input/Output Nodes" };
OrderPlayerInput.Click += (sender, args) =>
Expand Down Expand Up @@ -128,30 +147,28 @@ public void Loaded(ViewLoadedParams p)
}
}
};
BDmenuItem.Items.Add(OrderPlayerInput);

BDmenuItem.Items.Add(new Separator());
BDmenuItem.Items.Add(new Separator());
#endregion

AboutItem = new MenuItem { Header = "About Beyond Dynamo" };
AboutItem.Click += (sender, args) =>
{
//Show the About dialog
About about = new About();
about.Show();
};
# endregion

//These can only run inside a Graph
#region
# region THESE FUNCTION ONLY WORK INSIDE A SCRIPT

GroupColor = new MenuItem { Header = "Change Group Color" };
GroupColor.Click += (sender, args) =>
{
BeyondDynamo.BeyondDynamoFunctions.ChangeGroupColor(VM.CurrentSpaceViewModel);
};
BDmenuItem.Items.Add(GroupColor);

ScriptImport = new MenuItem { Header = "Import From Script" };
ScriptImport.Click += (sender, args) =>
{
BeyondDynamoFunctions.ImportFromScript(VM);
};
BDmenuItem.Items.Add(ScriptImport);

EditNotes = new MenuItem { Header = "Edit Note Text" };
EditNotes.Click += (sender, args) =>
Expand All @@ -165,39 +182,64 @@ public void Loaded(ViewLoadedParams p)

BeyondDynamoFunctions.CallTextEditor(VM.Model);
};
BDmenuItem.Items.Add(EditNotes);

FreezeNodes = new MenuItem { Header = "Freeze Multiple Nodes" };
FreezeNodes.Click += (sender, args) =>
{
BeyondDynamoFunctions.FreezeNodes(VM.Model);
};
BDmenuItem.Items.Add(FreezeNodes);

UnfreezeNodes = new MenuItem { Header = "Unfreeze Multiple Nodes" };
UnfreezeNodes.Click += (sender, args) =>
{
BeyondDynamoFunctions.UnfreezeNodes(VM.Model);
};
#endregion

#region
//App Extensions
BDmenuItem.Items.Add(OrderPlayerInput);
BDmenuItem.Items.Add(new Separator());
BDmenuItem.Items.Add(new Separator());

//Graph Extensions
BDmenuItem.Items.Add(GroupColor);
BDmenuItem.Items.Add(ScriptImport);
BDmenuItem.Items.Add(EditNotes);
BDmenuItem.Items.Add(FreezeNodes);
BDmenuItem.Items.Add(UnfreezeNodes);

//Main Extension
//MarkInputNodes = new MenuItem { Header = "Mark Multiple Nodes as Input " };
//MarkInputNodes.Click += (sender, args) =>
//{
// BeyondDynamo.BeyondDynamoFunctions.MarkAsInput(VM.Model.CurrentWorkspace);
//};
//BDmenuItem.Items.Add(MarkInputNodes);

//UnmarkInputNodes = new MenuItem { Header = "Unmark Multiple Nodes as Input " };
//UnmarkInputNodes.Click += (sender, args) =>
//{
// BeyondDynamo.BeyondDynamoFunctions.UnMarkAsInput(VM.Model.CurrentWorkspace);
//};
//BDmenuItem.Items.Add(UnmarkInputNodes);

//MarkOutputNodes = new MenuItem { Header = "Mark Multiple Nodes as Output" };
//MarkOutputNodes.Click += (sender, args) =>
//{
// BeyondDynamo.BeyondDynamoFunctions.MarkAsOutput(VM.Model.CurrentWorkspace);
//};
//BDmenuItem.Items.Add(MarkOutputNodes);

//UnmarkOutputNodes = new MenuItem { Header = "Unmark Multiple Nodes as Output" };
//UnmarkOutputNodes.Click += (sender, args) =>
//{
// BeyondDynamo.BeyondDynamoFunctions.UnMarkAsOutput(VM.Model.CurrentWorkspace);
//};
//BDmenuItem.Items.Add(UnmarkOutputNodes);
#endregion

AboutItem = new MenuItem { Header = "About Beyond Dynamo" };
AboutItem.Click += (sender, args) =>
{
//Show the About dialog
About about = new About();
about.Show();
};
BDmenuItem.Items.Add(new Separator());
BDmenuItem.Items.Add(new Separator());
BDmenuItem.Items.Add(AboutItem);

p.dynamoMenu.Items.Add(BDmenuItem);
#endregion

}

}
Expand Down
36 changes: 14 additions & 22 deletions src/BeyondDynamo/BeyondDynamoFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public static void ImportFromScript(DynamoViewModel viewModel)
/// <param name="DynamoFilePath"></param>
private static void ImportXMLDynamo(DynamoViewModel viewModel, string DynamoFilePath)
{
WorkspaceViewModel workspaceViewModel = viewModel.CurrentSpaceViewModel;
WorkspaceModel model = viewModel.Model.CurrentWorkspace;

//Create two lists for the Selection of the imported model
Expand Down Expand Up @@ -128,8 +129,9 @@ private static void ImportXMLDynamo(DynamoViewModel viewModel, string DynamoFile
# region MAKE ALL IMPORTED ITEMS THE NEW SELECTION
//Check Groups
#region
foreach (AnnotationModel group in model.Annotations)
foreach (AnnotationViewModel groupView in workspaceViewModel.Annotations)
{
AnnotationModel group = groupView.AnnotationModel;
string itemGuid = group.GUID.ToString();
foreach (string guid in guidList)
{
Expand Down Expand Up @@ -513,59 +515,49 @@ public static void SortInputOutputNodesXML(string DynamoFilepath)
/// Mark all selected nodes as input nodes
/// </summary>
/// <param name="model"></param>
private static void MarkAsInput(WorkspaceModel model)
public static void MarkAsInput(WorkspaceModel model)
{
foreach (NodeModel node in model.CurrentSelection)
{
if (node.IsInputNode)
{
node.IsSetAsInput = true;
}
node.IsSetAsInput = true;
}
}

/// <summary>
/// Mark all selected nodes as output nodes
/// </summary>
/// <param name="model"></param>
private static void MarkAsOutput(WorkspaceModel model)
public static void MarkAsOutput(WorkspaceModel model)
{
foreach (NodeModel node in model.CurrentSelection)
{
if (node.IsOutputNode)
{
node.IsSetAsOutput = true;
}
node.IsSetAsOutput = true;
}
}

/// <summary>
/// Unmark all selected nodes as input nodes
/// </summary>
/// <param name="model"></param>
private static void UnMarkAsInput(WorkspaceModel model)
public static void UnMarkAsInput(WorkspaceModel model)
{
foreach (NodeModel node in model.CurrentSelection)
{
if (node.IsInputNode)
{
node.IsSetAsInput = false;
}
node.IsSetAsInput = false;
}
}

/// <summary>
/// Unmark all selected nodes as output nodes
/// </summary>
/// <param name="model"></param>
private static void UnMarkAsOutput(WorkspaceModel model)
public static void UnMarkAsOutput(WorkspaceModel model)
{
foreach (NodeModel node in model.CurrentSelection)
{
if (node.IsOutputNode)
{
node.IsSetAsOutput = false;
}
node.Description = "This is Description";
node.ToolTipText = "This is the ToolTip";

}
}
}
Expand Down
19 changes: 18 additions & 1 deletion src/BeyondDynamo/UI/About/About.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ private void ApplicationUI_MouseMove(object sender, MouseEventArgs e)
}
}
#endregion


#region GitHub Label Events
private void GitHub_Label_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("www.github.com/JoelvanHerwaarden/BeyondDynamo2.X");
}

private void GitHub_Label_MouseEnter(object sender, EventArgs e)
{
GitHub_Label.ForeColor = System.Drawing.ColorTranslator.FromHtml("#FFC8C8C8");
}

private void GitHub_Label_MouseLeave(object sender, EventArgs e)
{
GitHub_Label.ForeColor = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");
}
#endregion

}
}
29 changes: 16 additions & 13 deletions src/BeyondDynamo/UI/About/About.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b956ffb

Please sign in to comment.