conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
public Task<IAppEntity?> GetAppAsync(DomainId appId)
=======
public async Task<IAppEntity?> GetAppAsync(Guid appId, bool canCache = false)
>>>>>>>
public async Task<IAppEntity?> GetAppAsync(DomainId appId, bool canCache = false)
<<<<<<<
public Task<ISchemaEntity?> GetSchemaAsync(DomainId appId, string name)
=======
public async Task<ISchemaEntity?> GetSchemaAsync(Guid appId, Guid id, bool allowDeleted = false, bool canCache = false)
>>>>>>>
public async Task<ISchemaEntity?> GetSchemaAsync(DomainId appId, DomainId id, bool allowDeleted = false, bool canCache = false)
<<<<<<<
public Task<ISchemaEntity?> GetSchemaAsync(DomainId appId, DomainId id, bool allowDeleted = false)
=======
public async Task<List<IAppEntity>> GetUserAppsAsync(string userId, PermissionSet permissions)
>>>>>>>
public async Task<List<IAppEntity>> GetUserAppsAsync(string userId, PermissionSet permissions)
<<<<<<<
public Task<List<ISchemaEntity>> GetSchemasAsync(DomainId appId)
=======
public async Task<List<ISchemaEntity>> GetSchemasAsync(Guid appId)
>>>>>>>
public async Task<List<ISchemaEntity>> GetSchemasAsync(DomainId appId)
<<<<<<<
public Task<List<IRuleEntity>> GetRulesAsync(DomainId appId)
=======
public async Task<List<IRuleEntity>> GetRulesAsync(Guid appId)
>>>>>>>
public async Task<List<IRuleEntity>> GetRulesAsync(DomainId appId) |
<<<<<<<
//dynSettings.DynamoLogger.Log(topMost);
}
=======
var sleep = (int)args.Argument;
Thread.Sleep(sleep);
}
while (bw != null && !bw.CancellationPending);
>>>>>>>
var sleep = (int)args.Argument;
Thread.Sleep(sleep);
}
while (bw != null && !bw.CancellationPending);
<<<<<<<
//dynSettings.DynamoLogger.Log(runningExpression);
#endif
}
catch (CancelEvaluationException ex)
=======
try
>>>>>>>
try
<<<<<<<
dynSettings.DynamoLogger.Log(string.Format("Evaluation completed in {0}", sw.Elapsed.ToString()));
=======
dynSettings.Controller.DynamoLogger.Log(string.Format("Evaluation completed in {0}", sw.Elapsed));
>>>>>>>
dynSettings.DynamoLogger.Log(string.Format("Evaluation completed in {0}", sw.Elapsed));
<<<<<<<
//protected virtual void Run(List<NodeModel> topElements, FScheme.Expression runningExpression)
//{
// //Print some stuff if we're in debug mode
// if (DynamoViewModel.RunInDebug)
// {
// if (dynSettings.Controller.UIDispatcher != null)
// {
// foreach (string exp in topElements.Select(node => node.PrintExpression()))
// dynSettings.DynamoLogger.Log("> " + exp);
// }
// }
// try
// {
// //Evaluate the expression
// FScheme.Value expr = FSchemeEnvironment.Evaluate(runningExpression);
// if (dynSettings.Controller.UIDispatcher != null)
// {
// //Print some more stuff if we're in debug mode
// if (DynamoViewModel.RunInDebug && expr != null)
// {
// dynSettings.DynamoLogger.Log("Evaluating the expression...");
// dynSettings.DynamoLogger.Log(FScheme.print(expr));
// }
// }
// }
// catch (CancelEvaluationException ex)
// {
// /* Evaluation was cancelled */
// OnRunCancelled(false);
// RunCancelled = false;
// if (ex.Force)
// runAgain = false;
// }
// catch (Exception ex)
// {
// /* Evaluation failed due to error */
// dynSettings.DynamoLogger.Log(ex);
// OnRunCancelled(true);
// RunCancelled = true;
// runAgain = false;
// //If we are testing, we need to throw an exception here
// //which will, in turn, throw an Assert.Fail in the
// //Evaluation thread.
// if (Testing)
// throw new Exception(ex.Message);
// }
// OnEvaluationCompleted(this, EventArgs.Empty);
//}
=======
>>>>>>>
<<<<<<<
//dynSettings.DynamoLogger.Log("Run cancelled. Error: " + error);
if (error)
dynSettings.FunctionWasEvaluated.Clear();
=======
//dynSettings.Controller.DynamoLogger.Log("Run cancelled. Error: " + error);
>>>>>>>
//dynSettings.Controller.DynamoLogger.Log("Run cancelled. Error: " + error); |
<<<<<<<
=======
using System.Diagnostics;
using System.Windows.Media.Media3D;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.UI;
>>>>>>>
using System.Diagnostics;
using System.Windows.Media.Media3D;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.UI;
<<<<<<<
using RevitServices.Persistence;
=======
using CurveLoop = Autodesk.Revit.DB.CurveLoop;
using DividedSurface = Autodesk.Revit.DB.DividedSurface;
>>>>>>>
using RevitServices.Persistence;
using CurveLoop = Autodesk.Revit.DB.CurveLoop;
using DividedSurface = Autodesk.Revit.DB.DividedSurface; |
<<<<<<<
using ProtoCore.Utils;
using System.Text;
=======
using Dynamo.UI;
>>>>>>>
using ProtoCore.Utils;
using Dynamo.UI; |
<<<<<<<
private CodeBlockNodeModel nodeModel = null;
=======
private CompletionWindow completionWindow = null;
private CodeBlockNodeModel nodeModel = null;
private CodeCompletionParser codeParser = null;
>>>>>>>
private CodeBlockNodeModel nodeModel = null;
private CompletionWindow completionWindow = null;
private CodeCompletionParser codeParser = null;
<<<<<<<
=======
#region Auto-complete event handlers
private void OnTextAreaTextEntering(object sender, TextCompositionEventArgs e)
{
try
{
if (e.Text.Length > 0 && completionWindow != null)
{
// If a completion item is highlighted and the user types
// a special character or function key, select the item and insert it
if (!char.IsLetterOrDigit(e.Text[0]))
completionWindow.CompletionList.RequestInsertion(e);
}
}
catch (System.Exception ex)
{
this.dynamoViewModel.Model.Logger.Log("Failed to perform code block autocomplete with exception:");
this.dynamoViewModel.Model.Logger.Log(ex.Message);
this.dynamoViewModel.Model.Logger.Log(ex.StackTrace);
}
}
private void OnTextAreaTextEntered(object sender, TextCompositionEventArgs e)
{
try
{
if (e.Text == ".")
{
var code = this.InnerTextEditor.Text.Substring(0, this.InnerTextEditor.CaretOffset);
codeParser = new CodeCompletionParser();
string stringToComplete = codeParser.GetStringToComplete(code).Trim('.');
var completions = this.GetCompletionData(code, stringToComplete, nodeModel.GUID);
if (completions.Count() == 0)
return;
// TODO: Need to make this more efficient by instantiating 'completionWindow'
// just once and updating its contents each time
// This implementation has been taken from
// http://www.codeproject.com/Articles/42490/Using-AvalonEdit-WPF-Text-Editor
completionWindow = new CompletionWindow(this.InnerTextEditor.TextArea);
var data = completionWindow.CompletionList.CompletionData;
foreach (var completion in completions)
data.Add(completion);
completionWindow.Show();
completionWindow.Closed += delegate
{
completionWindow = null;
};
}
}
catch (System.Exception ex)
{
this.dynamoViewModel.Model.Logger.Log("Failed to perform code block autocomplete with exception:");
this.dynamoViewModel.Model.Logger.Log(ex.Message);
this.dynamoViewModel.Model.Logger.Log(ex.StackTrace);
}
}
#endregion
>>>>>>>
#region Auto-complete event handlers
private void OnTextAreaTextEntering(object sender, TextCompositionEventArgs e)
{
try
{
if (e.Text.Length > 0 && completionWindow != null)
{
// If a completion item is highlighted and the user types
// a special character or function key, select the item and insert it
if (!char.IsLetterOrDigit(e.Text[0]))
completionWindow.CompletionList.RequestInsertion(e);
}
}
catch (System.Exception ex)
{
this.dynamoViewModel.Model.Logger.Log("Failed to perform code block autocomplete with exception:");
this.dynamoViewModel.Model.Logger.Log(ex.Message);
this.dynamoViewModel.Model.Logger.Log(ex.StackTrace);
}
}
private void OnTextAreaTextEntered(object sender, TextCompositionEventArgs e)
{
try
{
if (e.Text == ".")
{
var code = this.InnerTextEditor.Text.Substring(0, this.InnerTextEditor.CaretOffset);
codeParser = new CodeCompletionParser();
string stringToComplete = codeParser.GetStringToComplete(code).Trim('.');
var completions = this.GetCompletionData(code, stringToComplete, nodeModel.GUID);
if (completions.Count() == 0)
return;
// TODO: Need to make this more efficient by instantiating 'completionWindow'
// just once and updating its contents each time
// This implementation has been taken from
// http://www.codeproject.com/Articles/42490/Using-AvalonEdit-WPF-Text-Editor
completionWindow = new CompletionWindow(this.InnerTextEditor.TextArea);
var data = completionWindow.CompletionList.CompletionData;
foreach (var completion in completions)
data.Add(completion);
completionWindow.Show();
completionWindow.Closed += delegate
{
completionWindow = null;
};
}
}
catch (System.Exception ex)
{
this.dynamoViewModel.Model.Logger.Log("Failed to perform code block autocomplete with exception:");
this.dynamoViewModel.Model.Logger.Log(ex.Message);
this.dynamoViewModel.Model.Logger.Log(ex.StackTrace);
}
}
#endregion |
<<<<<<<
[DataMember]
internal string NodeName { get; private set; }
[DataMember]
=======
// Faster, direct creation
internal NodeModel Node { get; private set; }
// If it was deserialized
internal XmlElement NodeXml { get; private set; }
>>>>>>>
// Faster, direct creation
internal NodeModel Node { get; private set; }
// If it was deserialized
internal XmlElement NodeXml { get; private set; }
[DataMember]
<<<<<<<
[DataMember]
=======
internal IEnumerable<Guid> ModelGuids { get { return modelGuids; } }
>>>>>>>
internal IEnumerable<Guid> ModelGuids { get { return modelGuids; } }
[DataMember]
<<<<<<<
[DataContract]
public class ConvertNodesToCodeCommand : HasNodeIDCommand
=======
[Obsolete("Node to Code not enabled, API subject to change.")]
public class ConvertNodesToCodeCommand : RecordableCommand
>>>>>>>
[DataContract]
[Obsolete("Node to Code not enabled, API subject to change.")]
public class ConvertNodesToCodeCommand : HasNodeIDCommand |
<<<<<<<
[Test]
public void MAGN_6799_ListMapDoesntWorkWithFlatten()
{
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-6799
// Flatten Does Not work With List.Map.
var model = ViewModel.Model;
string openPath = Path.Combine(TestDirectory, @"core\list\Listmap.dyn");
RunModel(openPath);
//check the point.x , point.y and point.z
//get Point.X guid
var pointX = GetFlattenedPreviewValues("b63b850f-a9cc-4c5d-9bbd-ad144d74e227");
Assert.AreEqual(pointX,new object [] {1,2,3,4,10,20,30,40});
//get Point.y guid
var pointY = GetFlattenedPreviewValues("2a5daf0c-1316-4ff0-be16-74e3241eff58");
Assert.AreEqual(pointY, new object[] { 1, 2, 3, 4, 10, 20, 30, 40 });
//get Point.z guid
var pointZ = GetFlattenedPreviewValues("24b75bda-4e39-48d1-98ec-de103f739567");
Assert.AreEqual(pointY, new object[] { 1, 2, 3, 4, 10, 20, 30, 40 });
AssertNoDummyNodes();
// check all the nodes and connectors are loaded
Assert.AreEqual(7, model.CurrentWorkspace.Nodes.Count);
Assert.AreEqual(8, model.CurrentWorkspace.Connectors.Count());
//get List.Map guid
string ListMapGuid = "0af8a082-0d22-476f-bc28-e61b4ce01170";
//check the dimension of list
var levelCount = 2;
AssertPreviewCount(ListMapGuid, levelCount);
//flatten the list
var levelList = GetFlattenedPreviewValues(ListMapGuid);
Assert.AreEqual(levelList.Count, levelCount * 4);
//check the first parameter is not null
Assert.IsNotNull(levelList[0]);
}
=======
[Test]
public void TestExportWithUnits()
{
string openPath = Path.Combine(
TestDirectory,
@"core\geometryui\export_units_one_cuboid.dyn");
RunModel(openPath);
var exportPreview = GetPreviewValue("71e5eea4-63ea-4c97-9d8d-aa9c8a2c420a") as string;
Assert.IsNotNull(exportPreview);
Assert.IsTrue(exportPreview.Contains("exported.sat"));
}
>>>>>>>
[Test]
public void MAGN_6799_ListMapDoesntWorkWithFlatten()
{
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-6799
// Flatten Does Not work With List.Map.
var model = ViewModel.Model;
string openPath = Path.Combine(TestDirectory, @"core\list\Listmap.dyn");
RunModel(openPath);
//check the point.x , point.y and point.z
//get Point.X guid
var pointX = GetFlattenedPreviewValues("b63b850f-a9cc-4c5d-9bbd-ad144d74e227");
Assert.AreEqual(pointX,new object [] {1,2,3,4,10,20,30,40});
//get Point.y guid
var pointY = GetFlattenedPreviewValues("2a5daf0c-1316-4ff0-be16-74e3241eff58");
Assert.AreEqual(pointY, new object[] { 1, 2, 3, 4, 10, 20, 30, 40 });
//get Point.z guid
var pointZ = GetFlattenedPreviewValues("24b75bda-4e39-48d1-98ec-de103f739567");
Assert.AreEqual(pointY, new object[] { 1, 2, 3, 4, 10, 20, 30, 40 });
AssertNoDummyNodes();
// check all the nodes and connectors are loaded
Assert.AreEqual(7, model.CurrentWorkspace.Nodes.Count);
Assert.AreEqual(8, model.CurrentWorkspace.Connectors.Count());
//get List.Map guid
string ListMapGuid = "0af8a082-0d22-476f-bc28-e61b4ce01170";
//check the dimension of list
var levelCount = 2;
AssertPreviewCount(ListMapGuid, levelCount);
//flatten the list
var levelList = GetFlattenedPreviewValues(ListMapGuid);
Assert.AreEqual(levelList.Count, levelCount * 4);
//check the first parameter is not null
Assert.IsNotNull(levelList[0]);
}
[Test]
public void TestExportWithUnits()
{
string openPath = Path.Combine(
TestDirectory,
@"core\geometryui\export_units_one_cuboid.dyn");
RunModel(openPath);
var exportPreview = GetPreviewValue("71e5eea4-63ea-4c97-9d8d-aa9c8a2c420a") as string;
Assert.IsNotNull(exportPreview);
Assert.IsTrue(exportPreview.Contains("exported.sat"));
} |
<<<<<<<
var pkg = PackageUploadBuilder.NewPackageVersion(rootPkgDir, customNodeManager, l, files, packageUploadHandle);
=======
var pkg = PackageUploadBuilder.NewPackageVersion(this.dynamoModel, l, files, packageUploadHandle);
packageUploadHandle.UploadState = PackageUploadHandle.State.Uploading;
>>>>>>>
var pkg = PackageUploadBuilder.NewPackageVersion(rootPkgDir, customNodeManager, l, files, packageUploadHandle);
packageUploadHandle.UploadState = PackageUploadHandle.State.Uploading;
<<<<<<<
var pkg = PackageUploadBuilder.NewPackage(rootPkgDir, customNodeManager, l, files, packageUploadHandle);
=======
var pkg = PackageUploadBuilder.NewPackage(this.dynamoModel, l, files, packageUploadHandle);
packageUploadHandle.UploadState = PackageUploadHandle.State.Uploading;
>>>>>>>
var pkg = PackageUploadBuilder.NewPackage(rootPkgDir, customNodeManager, l, files, packageUploadHandle);
packageUploadHandle.UploadState = PackageUploadHandle.State.Uploading; |
<<<<<<<
private bool graphExecuted;
public bool RunEnabled
{
get { return runEnabled; }
set
{
if (Equals(value, runEnabled)) return;
runEnabled = value;
RaisePropertyChanged("RunEnabled");
}
}
=======
>>>>>>>
private bool graphExecuted; |
<<<<<<<
string LastUpdateDownloadPath { get; set; }
=======
int MaxNumRecentFiles { get; set; }
List<string> RecentFiles { get; set; }
>>>>>>>
string LastUpdateDownloadPath { get; set; }
int MaxNumRecentFiles { get; set; }
List<string> RecentFiles { get; set; } |
<<<<<<<
#if USE_DSENGINE
public void ImportLibrary(object parameter)
{
string fileFilter = "Assembly Library Files (*.dll)|*.dll|"
+ "All Files (*.*)|*.*";
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = fileFilter;
openFileDialog.Title = "Import Library";
openFileDialog.Multiselect = true;
openFileDialog.RestoreDirectory = true;
DialogResult result = openFileDialog.ShowDialog();
if (result == DialogResult.OK)
{
foreach (string filePath in openFileDialog.FileNames)
{
if (!filePath.ToLower().EndsWith(".dll") && !filePath.ToLower().EndsWith(".ds"))
{
return;
}
if (filePath.ToLower().EndsWith(".dll"))
Dynamo.DSEngine.DSLibraryServices.Instance.ImportLibrary(filePath);
}
}
}
internal bool CanImportLibrary(object parameter)
{
return true;
}
#endif
=======
public void TogglePan(object parameter)
{
CurrentSpaceViewModel.TogglePanCommand.Execute(parameter);
}
internal bool CanTogglePan(object parameter)
{
return CurrentSpaceViewModel.TogglePanCommand.CanExecute(parameter);
}
public void Escape(object parameter)
{
CurrentSpaceViewModel.OnRequestStopPan(this, null); // Escape Pan Mode
}
internal bool CanEscape(object parameter)
{
return true;
}
public void ShowInfoBubble(object parameter)
{
InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;
controller.InfoBubbleViewModel.UpdateContentCommand.Execute(data);
controller.InfoBubbleViewModel.FadeInCommand.Execute(null);
}
internal bool CanShowInfoBubble(object parameter)
{
return true;
}
public void HideInfoBubble(object parameter)
{
controller.InfoBubbleViewModel.FadeOutCommand.Execute(null);
}
internal bool CanHideInfoBubble(object parameter)
{
return true;
}
public void TogglePreviewBubbleVisibility(object parameter)
{
this.Controller.IsShowPreviewByDefault = !this.Controller.IsShowPreviewByDefault;
}
internal bool CanTogglePreviewBubbleVisibility(object parameter)
{
return true;
}
#region IWatchViewModel interface
internal void SelectVisualizationInView(object parameters)
{
Debug.WriteLine("Selecting mesh from background watch.");
var arr = (double[])parameters;
double x = arr[0];
double y = arr[1];
double z = arr[2];
dynSettings.Controller.VisualizationManager.LookupSelectedElement(x, y, z);
}
internal bool CanSelectVisualizationInView(object parameters)
{
if (parameters != null)
{
return true;
}
return false;
}
public void GetBranchVisualization(object parameters)
{
dynSettings.Controller.VisualizationManager.RenderUpstream(null);
}
public bool CanGetBranchVisualization(object parameter)
{
if (FullscreenWatchShowing)
{
return true;
}
return false;
}
#endregion
>>>>>>>
#if USE_DSENGINE
public void ImportLibrary(object parameter)
{
string fileFilter = "Assembly Library Files (*.dll)|*.dll|"
+ "All Files (*.*)|*.*";
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = fileFilter;
openFileDialog.Title = "Import Library";
openFileDialog.Multiselect = true;
openFileDialog.RestoreDirectory = true;
DialogResult result = openFileDialog.ShowDialog();
if (result == DialogResult.OK)
{
foreach (string filePath in openFileDialog.FileNames)
{
if (!filePath.ToLower().EndsWith(".dll") && !filePath.ToLower().EndsWith(".ds"))
{
return;
}
if (filePath.ToLower().EndsWith(".dll"))
Dynamo.DSEngine.DSLibraryServices.Instance.ImportLibrary(filePath);
}
}
}
internal bool CanImportLibrary(object parameter)
{
return true;
}
#endif
public void TogglePan(object parameter)
{
CurrentSpaceViewModel.TogglePanCommand.Execute(parameter);
}
internal bool CanTogglePan(object parameter)
{
return CurrentSpaceViewModel.TogglePanCommand.CanExecute(parameter);
}
public void Escape(object parameter)
{
CurrentSpaceViewModel.OnRequestStopPan(this, null); // Escape Pan Mode
}
internal bool CanEscape(object parameter)
{
return true;
}
public void ShowInfoBubble(object parameter)
{
InfoBubbleDataPacket data = (InfoBubbleDataPacket)parameter;
controller.InfoBubbleViewModel.UpdateContentCommand.Execute(data);
controller.InfoBubbleViewModel.FadeInCommand.Execute(null);
}
internal bool CanShowInfoBubble(object parameter)
{
return true;
}
public void HideInfoBubble(object parameter)
{
controller.InfoBubbleViewModel.FadeOutCommand.Execute(null);
}
internal bool CanHideInfoBubble(object parameter)
{
return true;
}
public void TogglePreviewBubbleVisibility(object parameter)
{
this.Controller.IsShowPreviewByDefault = !this.Controller.IsShowPreviewByDefault;
}
internal bool CanTogglePreviewBubbleVisibility(object parameter)
{
return true;
}
#region IWatchViewModel interface
internal void SelectVisualizationInView(object parameters)
{
Debug.WriteLine("Selecting mesh from background watch.");
var arr = (double[])parameters;
double x = arr[0];
double y = arr[1];
double z = arr[2];
dynSettings.Controller.VisualizationManager.LookupSelectedElement(x, y, z);
}
internal bool CanSelectVisualizationInView(object parameters)
{
if (parameters != null)
{
return true;
}
return false;
}
public void GetBranchVisualization(object parameters)
{
dynSettings.Controller.VisualizationManager.RenderUpstream(null);
}
public bool CanGetBranchVisualization(object parameter)
{
if (FullscreenWatchShowing)
{
return true;
}
return false;
}
#endregion |
<<<<<<<
var newlyPlacedCollapsedNode = currentWorkspace.Nodes
.Where(node => node is Function)
.First(node => ((Function)node).Definition.FunctionId == newNodeDefinition.FunctionId);
=======
>>>>>>>
<<<<<<<
var conn = ConnectorModel.Make(
newlyPlacedCollapsedNode,
=======
var conn = dynConnectorModel.Make(
collapsedNode,
>>>>>>>
var conn = ConnectorModel.Make(
collapsedNode, |
<<<<<<<
[IsVisibleInDynamoLibrary(false)]
public static IList DiagonalRight(IList list, int subLength)
=======
public static IList DiagonalRight([ArbitraryDimensionArrayImport] IList list, int subLength)
>>>>>>>
[IsVisibleInDynamoLibrary(false)]
public static IList DiagonalRight([ArbitraryDimensionArrayImport] IList list, int subLength) |
<<<<<<<
}
private void WorkspaceTabs_TargetUpdated(object sender, DataTransferEventArgs e)
{
ToggleWorkspaceTabVisibility(WorkspaceTabs.SelectedIndex);
}
private void WorkspaceTabs_SizeChanged(object sender, SizeChangedEventArgs e)
{
ToggleWorkspaceTabVisibility(WorkspaceTabs.SelectedIndex);
}
}
=======
} private void RunButton_OnClick(object sender, RoutedEventArgs e)
{
dynSettings.ReturnFocusToSearch();
}
}
>>>>>>>
}
private void WorkspaceTabs_TargetUpdated(object sender, DataTransferEventArgs e)
{
ToggleWorkspaceTabVisibility(WorkspaceTabs.SelectedIndex);
}
private void WorkspaceTabs_SizeChanged(object sender, SizeChangedEventArgs e)
{
ToggleWorkspaceTabVisibility(WorkspaceTabs.SelectedIndex);
}
private void RunButton_OnClick(object sender, RoutedEventArgs e)
{
dynSettings.ReturnFocusToSearch();
}
} |
<<<<<<<
using Dynamo.Interfaces;
using Dynamo.Nodes;
using ProtoCore.Lang;
=======
using ProtoCore.AST.AssociativeAST;
>>>>>>>
using Dynamo.Interfaces;
using ProtoCore.AST.AssociativeAST;
<<<<<<<
public TypedParameter(string parameter, ProtoCore.Type type, object defaultValue = null)
=======
public TypedParameter(string parameter, ProtoCore.Type type, AssociativeNode defaultValue = null)
: this(null, parameter, type, defaultValue) { }
public TypedParameter(
FunctionDescriptor function, string name, ProtoCore.Type type, AssociativeNode defaultValue = null)
>>>>>>>
public TypedParameter(string parameter, ProtoCore.Type type, AssociativeNode defaultValue = null) |
<<<<<<<
ViewModel.OpenCommand.Execute(testPath);
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
Controller.DynamoViewModel.OpenCommand.Execute(testPath);
Assert.DoesNotThrow(() => dynSettings.Controller.RunExpression());
AssertPreviewCount("4274fd18-23b8-4c5c-9006-14d927fa3ff3", 100);
>>>>>>>
ViewModel.OpenCommand.Execute(testPath);
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
AssertPreviewCount("4274fd18-23b8-4c5c-9006-14d927fa3ff3", 100);
<<<<<<<
//var model = ViewModel.Model;
//string samplePath = Path.Combine(_testPath, @".\Family\AC_locationStandAlone.dyn");
//string testPath = Path.GetFullPath(samplePath);
=======
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
var model = ViewModel.Model; |
<<<<<<<
=======
if (workspaceModel == null)
{
return;
}
var dynamoModel = workspaceModel.DynamoModel;
>>>>>>>
<<<<<<<
engineController.LiveRunnerCore.SetTraceDataForNodes(traceData);
=======
if (dynamoModel == null || dynamoModel.EngineController == null)
{
return;
}
dynamoModel.EngineController.LiveRunnerCore.SetTraceDataForNodes(traceData);
>>>>>>>
engineController.LiveRunnerCore.SetTraceDataForNodes(traceData);
<<<<<<<
OnRunCompleted(false, cancelSet);
=======
dynamoModel.RunEnabled = true;
}
if (cancelSet)
{
dynamoModel.ResetEngine(true);
>>>>>>>
OnRunCompleted(false, cancelSet); |
<<<<<<<
using Expression = Dynamo.FScheme.Expression;
using Dynamo.Connectors;
=======
using Value = Dynamo.FScheme.Value;
>>>>>>>
using Dynamo.Connectors;
using Value = Dynamo.FScheme.Value;
<<<<<<<
[NodeName("Web Request")]
[NodeCategory(BuiltinNodeCategories.MISC)]
[NodeDescription("An element which gathers data from the web using a URL.")]
=======
[ElementName("Web Request")]
[ElementCategory(BuiltinElementCategories.COMMUNICATION)]
[ElementDescription("Fetches data from the web using a URL.")]
[RequiresTransaction(false)]
>>>>>>>
[NodeName("Web Request")]
[NodeCategory(BuiltinNodeCategories.COMMUNICATION)]
[NodeDescription("Fetches data from the web using a URL.")] |
<<<<<<<
// Setup Temp PreferenceSetting Location for testing
PreferenceSettings.DYNAMO_TEST_PATH = Path.Combine(TempFolder, "UserPreferenceTest.xml");
Controller = DynamoController.MakeSandbox();
Controller.Testing = true;
//create the view
Ui = new DynamoView();
Ui.DataContext = Controller.DynamoViewModel;
Vm = Controller.DynamoViewModel;
Model = Controller.DynamoModel;
Controller.UIDispatcher = Ui.Dispatcher;
Ui.Show();
SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
=======
// Setup Temper PreferenceSetting Location for the user to save user in
PreferenceSettings.DYNAMO_TEST_PATH = Path.Combine(TempFolder, "UserPreferenceTest.xml");
Controller = DynamoController.MakeSandbox();
//create the view
Ui = new DynamoView();
Ui.DataContext = Controller.DynamoViewModel;
Vm = Controller.DynamoViewModel;
Model = Controller.DynamoModel;
Controller.UIDispatcher = Ui.Dispatcher;
Ui.Show();
SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
>>>>>>>
// Setup Temp PreferenceSetting Location for testing
PreferenceSettings.DYNAMO_TEST_PATH = Path.Combine(TempFolder, "UserPreferenceTest.xml");
Controller = DynamoController.MakeSandbox();
Controller.Testing = true;
//create the view
Ui = new DynamoView();
Ui.DataContext = Controller.DynamoViewModel;
Vm = Controller.DynamoViewModel;
Model = Controller.DynamoModel;
Controller.UIDispatcher = Ui.Dispatcher;
Ui.Show();
SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
<<<<<<<
#region PreferenceSettings
[Test, RequiresSTA]
[Category("DynamoUI")]
public void PreferenceSetting()
{
// Test Case to ensure that the link for these persistent variable
// between DynamoViewModel, Controller is not broken or replaced.
#region FullscreenWatchShowing
bool expectedValue = !Controller.PreferenceSettings.FullscreenWatchShowing;
Vm.ToggleFullscreenWatchShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.FullscreenWatchShowing);
expectedValue = !Controller.PreferenceSettings.FullscreenWatchShowing;
Vm.ToggleFullscreenWatchShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.FullscreenWatchShowing);
#endregion
#region ShowConsole
expectedValue = !Controller.PreferenceSettings.ShowConsole;
Vm.ToggleConsoleShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.ShowConsole);
expectedValue = !Controller.PreferenceSettings.ShowConsole;
Vm.ToggleConsoleShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.ShowConsole);
#endregion
#region ConnectorType
ConnectorType expectedConnector = ConnectorType.BEZIER;
Vm.SetConnectorType("BEZIER");
Assert.AreEqual(expectedConnector, Controller.PreferenceSettings.ConnectorType);
expectedConnector = ConnectorType.POLYLINE;
Vm.SetConnectorType("POLYLINE");
Assert.AreEqual(expectedConnector, Controller.PreferenceSettings.ConnectorType);
#endregion
#region Collect Information Option
// First time run, check if dynamo did set it back to false after running
Assert.AreEqual(false, UsageReportingManager.Instance.FirstRun);
// CollectionInfoOption To TRUE
UsageReportingManager.Instance.SetUsageReportingAgreement(true);
RestartTestSetup();
Assert.AreEqual(true, UsageReportingManager.Instance.IsUsageReportingApproved);
// CollectionInfoOption To FALSE
UsageReportingManager.Instance.SetUsageReportingAgreement(false);
RestartTestSetup();
Assert.AreEqual(false, UsageReportingManager.Instance.IsUsageReportingApproved);
#endregion
#region Save And Load of PreferenceSettings
// Test if variable can be serialize and deserialize without any issue
string tempPath = System.IO.Path.GetTempPath();
tempPath = Path.Combine(tempPath, "userPreference.xml");
// Force inital state
PreferenceSettings initalSetting = new PreferenceSettings();
PreferenceSettings resultSetting;
#region First Test
initalSetting.ConnectorType = ConnectorType.BEZIER;
initalSetting.ShowConsole = true;
initalSetting.FullscreenWatchShowing = true;
initalSetting.Save(tempPath);
resultSetting = PreferenceSettings.Load(tempPath);
Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
Assert.AreEqual(resultSetting.ShowConsole, initalSetting.ShowConsole);
#endregion
#region Second Test
initalSetting.ConnectorType = ConnectorType.POLYLINE;
initalSetting.ShowConsole = false;
initalSetting.FullscreenWatchShowing = false;
initalSetting.Save(tempPath);
resultSetting = PreferenceSettings.Load(tempPath);
Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
Assert.AreEqual(resultSetting.ShowConsole, initalSetting.ShowConsole);
#endregion
#endregion
}
private void RestartTestSetup()
{
// Shutdown Dynamo and restart it
Ui.Close();
// Setup Temp PreferenceSetting Location for testing
PreferenceSettings.DYNAMO_TEST_PATH = Path.Combine(TempFolder, "UserPreferenceTest.xml");
Controller = DynamoController.MakeSandbox();
Controller.Testing = true;
//create the view
Ui = new DynamoView();
Ui.DataContext = Controller.DynamoViewModel;
Vm = Controller.DynamoViewModel;
Controller.UIDispatcher = Ui.Dispatcher;
Ui.Show();
SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
}
#endregion
=======
#region PreferenceSettings
[Test, RequiresSTA]
[Category("DynamoUI")]
public void PreferenceSetting()
{
// Test Case to ensure that the link for these persistent variable
// between DynamoViewModel, Controller is not broken or replaced.
#region FullscreenWatchShowing
bool expectedValue = !Controller.PreferenceSettings.FullscreenWatchShowing;
Vm.ToggleFullscreenWatchShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.FullscreenWatchShowing);
expectedValue = !Controller.PreferenceSettings.FullscreenWatchShowing;
Vm.ToggleFullscreenWatchShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.FullscreenWatchShowing);
#endregion
#region ShowConsole
expectedValue = !Controller.PreferenceSettings.ShowConsole;
Vm.ToggleConsoleShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.ShowConsole);
expectedValue = !Controller.PreferenceSettings.ShowConsole;
Vm.ToggleConsoleShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.ShowConsole);
#endregion
#region ConnectorType
ConnectorType expectedConnector = ConnectorType.BEZIER;
Vm.SetConnectorType("BEZIER");
Assert.AreEqual(expectedConnector, Controller.PreferenceSettings.ConnectorType);
expectedConnector = ConnectorType.POLYLINE;
Vm.SetConnectorType("POLYLINE");
Assert.AreEqual(expectedConnector, Controller.PreferenceSettings.ConnectorType);
Ui.Close();
#endregion
#region Save And Load of PreferenceSettings
// Test if variable can be serialize and deserialize without any issue
string tempPath = System.IO.Path.GetTempPath();
tempPath = Path.Combine(tempPath, "userPreference.xml");
// Force inital state
PreferenceSettings initalSetting = new PreferenceSettings();
PreferenceSettings resultSetting;
#region First Test
initalSetting.ConnectorType = ConnectorType.BEZIER;
initalSetting.ShowConsole = true;
initalSetting.FullscreenWatchShowing = true;
initalSetting.Save(tempPath);
resultSetting = PreferenceSettings.Load(tempPath);
Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
Assert.AreEqual(resultSetting.ShowConsole, initalSetting.ShowConsole);
#endregion
#region Second Test
initalSetting.ConnectorType = ConnectorType.POLYLINE;
initalSetting.ShowConsole = false;
initalSetting.FullscreenWatchShowing = false;
initalSetting.Save(tempPath);
resultSetting = PreferenceSettings.Load(tempPath);
Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
Assert.AreEqual(resultSetting.ShowConsole, initalSetting.ShowConsole);
#endregion
#endregion
}
#endregion
>>>>>>>
#region PreferenceSettings
[Test, RequiresSTA]
[Category("DynamoUI")]
public void PreferenceSetting()
{
// Test Case to ensure that the link for these persistent variable
// between DynamoViewModel, Controller is not broken or replaced.
#region FullscreenWatchShowing
bool expectedValue = !Controller.PreferenceSettings.FullscreenWatchShowing;
Vm.ToggleFullscreenWatchShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.FullscreenWatchShowing);
expectedValue = !Controller.PreferenceSettings.FullscreenWatchShowing;
Vm.ToggleFullscreenWatchShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.FullscreenWatchShowing);
#endregion
#region ShowConsole
expectedValue = !Controller.PreferenceSettings.ShowConsole;
Vm.ToggleConsoleShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.ShowConsole);
expectedValue = !Controller.PreferenceSettings.ShowConsole;
Vm.ToggleConsoleShowing(null);
Assert.AreEqual(expectedValue, Controller.PreferenceSettings.ShowConsole);
#endregion
#region ConnectorType
ConnectorType expectedConnector = ConnectorType.BEZIER;
Vm.SetConnectorType("BEZIER");
Assert.AreEqual(expectedConnector, Controller.PreferenceSettings.ConnectorType);
expectedConnector = ConnectorType.POLYLINE;
Vm.SetConnectorType("POLYLINE");
Assert.AreEqual(expectedConnector, Controller.PreferenceSettings.ConnectorType);
#endregion
#region Collect Information Option
// First time run, check if dynamo did set it back to false after running
Assert.AreEqual(false, UsageReportingManager.Instance.FirstRun);
// CollectionInfoOption To TRUE
UsageReportingManager.Instance.SetUsageReportingAgreement(true);
RestartTestSetup();
Assert.AreEqual(true, UsageReportingManager.Instance.IsUsageReportingApproved);
// CollectionInfoOption To FALSE
UsageReportingManager.Instance.SetUsageReportingAgreement(false);
RestartTestSetup();
Assert.AreEqual(false, UsageReportingManager.Instance.IsUsageReportingApproved);
#endregion
#region Save And Load of PreferenceSettings
// Test if variable can be serialize and deserialize without any issue
string tempPath = System.IO.Path.GetTempPath();
tempPath = Path.Combine(tempPath, "userPreference.xml");
// Force inital state
PreferenceSettings initalSetting = new PreferenceSettings();
PreferenceSettings resultSetting;
#region First Test
initalSetting.ConnectorType = ConnectorType.BEZIER;
initalSetting.ShowConsole = true;
initalSetting.FullscreenWatchShowing = true;
initalSetting.Save(tempPath);
resultSetting = PreferenceSettings.Load(tempPath);
Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
Assert.AreEqual(resultSetting.ShowConsole, initalSetting.ShowConsole);
#endregion
#region Second Test
initalSetting.ConnectorType = ConnectorType.POLYLINE;
initalSetting.ShowConsole = false;
initalSetting.FullscreenWatchShowing = false;
initalSetting.Save(tempPath);
resultSetting = PreferenceSettings.Load(tempPath);
Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
Assert.AreEqual(resultSetting.ShowConsole, initalSetting.ShowConsole);
#endregion
#endregion
Ui.Close();
}
private void RestartTestSetup()
{
// Shutdown Dynamo and restart it
Ui.Close();
// Setup Temp PreferenceSetting Location for testing
PreferenceSettings.DYNAMO_TEST_PATH = Path.Combine(TempFolder, "UserPreferenceTest.xml");
Controller = DynamoController.MakeSandbox();
Controller.Testing = true;
//create the view
Ui = new DynamoView();
Ui.DataContext = Controller.DynamoViewModel;
Vm = Controller.DynamoViewModel;
Controller.UIDispatcher = Ui.Dispatcher;
Ui.Show();
SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
}
#endregion |
<<<<<<<
RunCommandsFromFile("Defect_MAGN_57.xml");
=======
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-57
RunCommandsFromFile("Defect_MAGN_57.xml", true);
>>>>>>>
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-57
RunCommandsFromFile("Defect_MAGN_57.xml");
<<<<<<<
RunCommandsFromFile("Defect_MAGN_190.xml");
=======
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-190
RunCommandsFromFile("Defect_MAGN_190.xml", true);
>>>>>>>
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-190
RunCommandsFromFile("Defect_MAGN_190.xml");
<<<<<<<
RunCommandsFromFile("Defect_MAGN_429.xml");
=======
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-429
RunCommandsFromFile("Defect_MAGN_429.xml", true);
>>>>>>>
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-429
RunCommandsFromFile("Defect_MAGN_429.xml");
<<<<<<<
RunCommandsFromFile("Defect_MAGN_478.xml");
=======
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-478
RunCommandsFromFile("Defect_MAGN_478.xml", true);
>>>>>>>
// Details are available in defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-478
RunCommandsFromFile("Defect_MAGN_478.xml"); |
<<<<<<<
=======
using System.Windows.Forms;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Media.Imaging;
using System.Windows.Interop;
using Excel = Microsoft.Office.Interop.Excel;
>>>>>>>
using System.Drawing;
using System.Windows.Media.Imaging;
using System.Windows.Interop;
<<<<<<<
=======
[NodeName("Read Image File")]
[NodeCategory(BuiltinNodeCategories.IO_FILE)]
[NodeDescription("Reads data from an image file.")]
public class dynImageFileReader : dynFileReaderBase
{
System.Windows.Controls.Image image1;
public dynImageFileReader()
{
InPortData.Add(new PortData("numX", "Number of samples in the X direction.", typeof(object)));
InPortData.Add(new PortData("numY", "Number of samples in the Y direction.", typeof(object)));
OutPortData.Add(new PortData("contents", "File contents", typeof(Value.String)));
RegisterAllPorts();
}
public override void SetupCustomUIElements(Controls.dynNodeView nodeUI)
{
image1 = new System.Windows.Controls.Image
{
//Width = 320,
//Height = 240,
MaxWidth = 400,
MaxHeight = 400,
Margin = new Thickness(5),
HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
Name = "image1",
VerticalAlignment = System.Windows.VerticalAlignment.Center
};
//nodeUI.inputGrid.Children.Add(image1);
nodeUI.grid.Children.Add(image1);
image1.SetValue(Grid.RowProperty, 2);
image1.SetValue(Grid.ColumnProperty, 0);
image1.SetValue(Grid.ColumnSpanProperty, 3);
}
public override Value Evaluate(FSharpList<Value> args)
{
storedPath = ((Value.String)args[0]).Item;
double xDiv = ((Value.Number)args[1]).Item;
double yDiv = ((Value.Number)args[2]).Item;
FSharpList<Value> result = FSharpList<Value>.Empty;
if (File.Exists(storedPath))
{
try
{
using (Bitmap bmp = new Bitmap(storedPath))
{
//NodeUI.Dispatcher.Invoke(new Action(
// delegate
// {
// // how to convert a bitmap to an imagesource http://blog.laranjee.com/how-to-convert-winforms-bitmap-to-wpf-imagesource/
// // TODO - watch out for memory leaks using system.drawing.bitmaps in managed code, see here http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/4e213af5-d546-4cc1-a8f0-462720e5fcde
// // need to call Dispose manually somewhere, or perhaps use a WPF native structure instead of bitmap?
// var hbitmap = bmp.GetHbitmap();
// var imageSource = Imaging.CreateBitmapSourceFromHBitmap(hbitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight(bmp.Width, bmp.Height));
// image1.Source = imageSource;
// }
//));
//MVVM: now using node model's dispatch on ui thread method
DispatchOnUIThread(delegate
{
// how to convert a bitmap to an imagesource http://blog.laranjee.com/how-to-convert-winforms-bitmap-to-wpf-imagesource/
// TODO - watch out for memory leaks using system.drawing.bitmaps in managed code, see here http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/4e213af5-d546-4cc1-a8f0-462720e5fcde
// need to call Dispose manually somewhere, or perhaps use a WPF native structure instead of bitmap?
var hbitmap = bmp.GetHbitmap();
var imageSource = Imaging.CreateBitmapSourceFromHBitmap(hbitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight(bmp.Width, bmp.Height));
image1.Source = imageSource;
});
// Do some processing
for (int y = 0; y < yDiv; y++)
{
for (int x = 0; x < xDiv; x++)
{
Color pixelColor = bmp.GetPixel(x * (int)(bmp.Width / xDiv), y * (int)(bmp.Height / yDiv));
result = FSharpList<Value>.Cons(Value.NewContainer(pixelColor), result);
}
}
}
}
catch (Exception e)
{
dynSettings.Controller.DynamoViewModel.Log(e.ToString());
}
return Value.NewList(result);
}
else
return Value.NewList(FSharpList<Value>.Empty);
}
}
>>>>>>> |
<<<<<<<
private readonly ConcurrentDictionary<DomainId, IEnrichedContentEntity?> cachedContents = new ConcurrentDictionary<DomainId, IEnrichedContentEntity?>();
private readonly ConcurrentDictionary<DomainId, IEnrichedAssetEntity?> cachedAssets = new ConcurrentDictionary<DomainId, IEnrichedAssetEntity?>();
=======
private readonly SemaphoreSlim maxRequests = new SemaphoreSlim(10);
private readonly ConcurrentDictionary<Guid, IEnrichedContentEntity?> cachedContents = new ConcurrentDictionary<Guid, IEnrichedContentEntity?>();
private readonly ConcurrentDictionary<Guid, IEnrichedAssetEntity?> cachedAssets = new ConcurrentDictionary<Guid, IEnrichedAssetEntity?>();
>>>>>>>
private readonly SemaphoreSlim maxRequests = new SemaphoreSlim(10);
private readonly ConcurrentDictionary<DomainId, IEnrichedContentEntity?> cachedContents = new ConcurrentDictionary<DomainId, IEnrichedContentEntity?>();
private readonly ConcurrentDictionary<DomainId, IEnrichedAssetEntity?> cachedAssets = new ConcurrentDictionary<DomainId, IEnrichedAssetEntity?>(); |
<<<<<<<
=======
using System.Text;
using System.Windows;
>>>>>>>
using System.Text;
using System.Windows;
<<<<<<<
public IWatch3DView BackgroundPreView { get { return dynamoView.BackgroundPreview; } }
public IRenderPackageFactory RenderPackageFactory
{
get
{
return dynamoViewModel.RenderPackageFactoryViewModel.Factory;
}
}
=======
/// <summary>
/// A reference to the Dynamo Window object. Useful for correctly setting the parent of a
/// newly created window.
/// </summary>
public Window DynamoWindow
{
get
{
return dynamoView;
}
}
>>>>>>>
public IWatch3DView BackgroundPreView { get { return dynamoView.BackgroundPreview; } }
public IRenderPackageFactory RenderPackageFactory
{
get { return dynamoViewModel.RenderPackageFactoryViewModel.Factory; }
}
/// <summary>
/// A reference to the Dynamo Window object. Useful for correctly setting the parent of a
/// newly created window.
/// </summary>
public Window DynamoWindow
{
get
{
return dynamoView;
}
} |
<<<<<<<
A.CallTo(() => appPlansBillingManager.ChangePlanAsync(A<string>._, A<NamedId<DomainId>>._, A<string?>._))
=======
A.CallTo(() => appPlansBillingManager.ChangePlanAsync(A<string>._, A<NamedId<Guid>>._, A<string?>._, A<string?>._))
>>>>>>>
A.CallTo(() => appPlansBillingManager.ChangePlanAsync(A<string>._, A<NamedId<DomainId>>._, A<string?>._, A<string?>._))
<<<<<<<
A.CallTo(() => appPlansBillingManager.ChangePlanAsync(A<string>._, A<NamedId<DomainId>>._, planIdFree))
=======
A.CallTo(() => appPlansBillingManager.ChangePlanAsync(A<string>._, A<NamedId<Guid>>._, planIdFree, A<string?>._))
>>>>>>>
A.CallTo(() => appPlansBillingManager.ChangePlanAsync(A<string>._, A<NamedId<DomainId>>._, planIdFree, A<string?>._)) |
<<<<<<<
[assembly: InternalsVisibleTo("DynamoMSOfficeTests")]
[assembly: InternalsVisibleTo("DynamoWebServer")]
=======
[assembly: InternalsVisibleTo("DynamoMSOfficeTests")]
[assembly: InternalsVisibleTo("DSCoreNodesUI")]
>>>>>>>
[assembly: InternalsVisibleTo("DynamoMSOfficeTests")]
[assembly: InternalsVisibleTo("DSCoreNodesUI")]
[assembly: InternalsVisibleTo("DynamoWebServer")] |
<<<<<<<
public interface WatchHandler
{
bool AcceptsValue(object o);
void ProcessNode(object value, WatchNode node, bool showRawData);
}
=======
>>>>>>>
public interface WatchHandler
{
bool AcceptsValue(object o);
void ProcessNode(object value, WatchItem node, bool showRawData);
}
<<<<<<<
[IsDesignScriptCompatible]
public partial class Watch: NodeWithOneOutput
=======
public partial class Watch : NodeWithOneOutput
>>>>>>>
[IsDesignScriptCompatible]
public partial class Watch : NodeWithOneOutput
<<<<<<<
public WatchHandlers()
{
handlers = new HashSet<WatchHandler>();
}
public void ProcessNode(object value, WatchNode node, bool showRawData)
{
foreach (var handler in handlers) //.Where(x => x.AcceptsValue(value)))
{
handler.ProcessNode(value, node, showRawData);
}
}
}
static WatchHandlers handlerManager = new WatchHandlers();
static readonly string nullString = "null";
=======
#region events
>>>>>>>
private const string nullString = "null";
#region events |
<<<<<<<
/// <summary>
/// Registers the given element id with the DMU such that any change in the element will
/// trigger a workspace modification event (dynamic running and saving).
/// </summary>
/// <param name="id">ElementId of the element to watch.</param>
public void RegisterEvalOnModified(ElementId id)
=======
public void RegisterEvalOnModified(ElementId id, Action modAction = null, Action delAction = null)
>>>>>>>
/// <summary>
/// Registers the given element id with the DMU such that any change in the element will
/// trigger a workspace modification event (dynamic running and saving).
/// </summary>
/// <param name="id">ElementId of the element to watch.</param>
public void RegisterEvalOnModified(ElementId id, Action modAction = null, Action delAction = null)
<<<<<<<
this.IsDirty = true;
=======
return delegate(List<ElementId> modified)
{
if (!this.IsDirty)
{
this.IsDirty = true;
if (modifiedAction != null)
modifiedAction();
}
};
>>>>>>>
return delegate(List<ElementId> modified)
{
if (!this.IsDirty)
{
this.IsDirty = true;
if (modifiedAction != null)
modifiedAction();
}
}; |
<<<<<<<
static readonly JsonSerializerSettings JsonSettings;
public string SessionId { get; private set; }
=======
private readonly DynamoViewModel dynamoViewModel;
private readonly JsonSerializerSettings jsonSettings;
>>>>>>>
private readonly DynamoViewModel dynamoViewModel;
private readonly JsonSerializerSettings jsonSettings;
<<<<<<<
private Message message;
private DynamoViewModel dynamoViewModel;
static MessageHandler()
=======
public MessageHandler(DynamoViewModel dynamoViewModel)
>>>>>>>
public MessageHandler(DynamoViewModel dynamoViewModel)
<<<<<<<
public static Message DeserializeMessage(string jsonString)
=======
internal Message DeserializeMessage(string jsonString)
>>>>>>>
internal Message DeserializeMessage(string jsonString)
<<<<<<<
foreach (var node in dynamoViewModel.Model.CurrentWorkspace.Nodes)
=======
foreach (var item in dynamoViewModel.Model.NodeMap)
>>>>>>>
foreach (var node in dynamoViewModel.Model.CurrentWorkspace.Nodes)
<<<<<<<
dynSettings.Controller.VisualizationManager.RenderComplete -= NodesDataModified;
}
private void RetrieveGeometry(string nodeId)
{
Guid guid;
if (Guid.TryParse(nodeId, out guid))
{
NodeModel model = dynamoViewModel.Model.CurrentWorkspace.Nodes.First(node => node.GUID == guid);
OnResultReady(this, new ResultReadyEventArgs(new GeometryDataResponse
{
GeometryData = new GeometryData(nodeId, model.RenderPackages)
}));
}
=======
dynamoViewModel.VisualizationManager.RenderComplete -= ModifiedNodesData;
>>>>>>>
dynamoViewModel.VisualizationManager.RenderComplete -= NodesDataModified; |
<<<<<<<
private void TextBoxGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (viewModel != null)
viewModel.SearchIconAlignment = System.Windows.HorizontalAlignment.Left;
}
private void TextBoxLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (viewModel != null)
{
if (string.IsNullOrEmpty(viewModel.SearchText))
viewModel.SearchIconAlignment = System.Windows.HorizontalAlignment.Center;
else
viewModel.SearchIconAlignment = System.Windows.HorizontalAlignment.Left;
}
}
=======
private void Edit_OnClick(object sender, RoutedEventArgs e)
{
var menuItem = sender as MenuItem;
if (menuItem != null)
{
var element = menuItem.DataContext as CustomNodeSearchElement;
if (element != null)
{
if (dynamoViewModel.OpenCommand.CanExecute(element.Path))
dynamoViewModel.OpenCommand.Execute(element.Path);
}
}
}
>>>>>>>
private void TextBoxGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (viewModel != null)
viewModel.SearchIconAlignment = System.Windows.HorizontalAlignment.Left;
}
private void TextBoxLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (viewModel != null)
{
if (string.IsNullOrEmpty(viewModel.SearchText))
viewModel.SearchIconAlignment = System.Windows.HorizontalAlignment.Center;
else
viewModel.SearchIconAlignment = System.Windows.HorizontalAlignment.Left;
}
}
private void Edit_OnClick(object sender, RoutedEventArgs e)
{
var menuItem = sender as MenuItem;
if (menuItem != null)
{
var element = menuItem.DataContext as CustomNodeSearchElement;
if (element != null)
{
if (dynamoViewModel.OpenCommand.CanExecute(element.Path))
dynamoViewModel.OpenCommand.Execute(element.Path);
}
}
} |
<<<<<<<
var state = new TextContentState { UniqueContentId = contentId };
A.CallTo(() => inner.GetAsync(A<HashSet<DomainId>>.That.Is(contentIds)))
.Returns(new Dictionary<DomainId, TextContentState>());
=======
A.CallTo(() => inner.GetAsync(A<HashSet<Guid>>.That.Is(contentIds)))
.Returns(new Dictionary<Guid, TextContentState>());
>>>>>>>
A.CallTo(() => inner.GetAsync(A<HashSet<DomainId>>.That.Is(contentIds)))
.Returns(new Dictionary<DomainId, TextContentState>()); |
<<<<<<<
using System.Text.RegularExpressions;
using Dynamo.Models;
using Dynamo.Nodes;
=======
using System.Globalization;
using System.Windows;
using System.Windows.Media;
>>>>>>>
using System.Text.RegularExpressions;
using Dynamo.Models;
using Dynamo.Nodes;
<<<<<<<
=======
using Dynamo.Models;
using Dynamo.Nodes;
>>>>>>>
<<<<<<<
using System.Windows;
using System.Windows.Media;
=======
using System.Text.RegularExpressions;
>>>>>>>
using System.Windows;
using System.Windows.Media; |
<<<<<<<
using System.ComponentModel.DataAnnotations;
using Squidex.Infrastructure;
=======
using Squidex.Infrastructure.Validation;
>>>>>>>
using Squidex.Infrastructure;
using Squidex.Infrastructure.Validation;
<<<<<<<
[Required]
public List<DomainId> Ids { get; set; }
=======
[LocalizedRequired]
public List<Guid> Ids { get; set; }
>>>>>>>
[LocalizedRequired]
public List<DomainId> Ids { get; set; } |
<<<<<<<
//int count = 0;
=======
>>>>>>>
//int count = 0;
<<<<<<<
//int count = 0;
=======
>>>>>>>
//int count = 0;
<<<<<<<
=======
public override void SetupCustomUIElements(dynNodeView nodeUI)
{
//add a text box to the input grid of the control
var tb = new dynTextBox
{
Background = new SolidColorBrush(Color.FromArgb(0x88, 0xFF, 0xFF, 0xFF))
};
tb.OnChangeCommitted += processTextForNewInputs;
tb.HorizontalAlignment = HorizontalAlignment.Stretch;
tb.VerticalAlignment = VerticalAlignment.Top;
nodeUI.inputGrid.Children.Add(tb);
Grid.SetColumn(tb, 0);
Grid.SetRow(tb, 0);
tb.DataContext = this;
var bindingVal = new System.Windows.Data.Binding("Value")
{
Mode = BindingMode.TwoWay,
//Converter = new StringDisplay(),
Source = this,
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
tb.SetBinding(TextBox.TextProperty, bindingVal);
if (Value != "")
tb.Commit();
}
>>>>>>>
<<<<<<<
=======
public override void SetupCustomUIElements(dynNodeView nodeUI)
{
//add a text box to the input grid of the control
var tb = new dynStringTextBox
{
AcceptsReturn = true,
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Top,
IsNumeric = true,
Background = new SolidColorBrush(Color.FromArgb(0x88, 0xFF, 0xFF, 0xFF))
};
nodeUI.inputGrid.Children.Add(tb);
Grid.SetColumn(tb, 0);
Grid.SetRow(tb, 0);
tb.DataContext = this;
var bindingVal = new System.Windows.Data.Binding("Value")
{
Mode = BindingMode.TwoWay,
Converter = new DoubleInputDisplay(),
NotifyOnValidationError = false,
Source = this,
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
tb.SetBinding(TextBox.TextProperty, bindingVal);
tb.Text = Value ?? "0.0";
}
>>>>>>>
<<<<<<<
=======
public override void SetupCustomUIElements(dynNodeView nodeUI)
{
//add a text box to the input grid of the control
var tb = new dynTextBox();
tb.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
tb.VerticalAlignment = System.Windows.VerticalAlignment.Top;
nodeUI.inputGrid.Children.Add(tb);
System.Windows.Controls.Grid.SetColumn(tb, 0);
System.Windows.Controls.Grid.SetRow(tb, 0);
tb.IsNumeric = true;
tb.Background = new SolidColorBrush(Color.FromArgb(0x88, 0xFF, 0xFF, 0xFF));
tb.DataContext = this;
var bindingVal = new System.Windows.Data.Binding("Value")
{
Mode = BindingMode.TwoWay,
Converter = new RadianToDegreesConverter(),
NotifyOnValidationError = false,
Source = this,
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
tb.SetBinding(TextBox.TextProperty, bindingVal);
//tb.Text = "0.0";
}
>>>>>>>
<<<<<<<
=======
#region Value Conversion
[ValueConversion(typeof(double), typeof(String))]
public class DoubleDisplay : IValueConverter
{
public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//source -> target
string val = ((double) value).ToString("0.000",CultureInfo.CurrentCulture);
Debug.WriteLine("Converting {0} -> {1}", value, val);
return value == null ? "" : val;
}
public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//target -> source
//return value.ToString();
double val;
double.TryParse(value.ToString(), NumberStyles.Any, CultureInfo.CurrentCulture, out val);
Debug.WriteLine("Converting {0} -> {1}", value, val);
return val;
}
}
public class RadianToDegreesConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double degrees = System.Convert.ToDouble(value, culture) * 180.0 / Math.PI;
return degrees;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
double radians = System.Convert.ToDouble(value, culture) * Math.PI / 180.0;
return radians;
}
}
public class StringDisplay : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//source -> target
return value==null?"": HttpUtility.UrlDecode(value.ToString());
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//target -> source
return HttpUtility.UrlEncode(value.ToString());
}
}
public class FilePathDisplay : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//source->target
var maxChars = 30;
//var str = value.ToString();
var str = HttpUtility.UrlDecode(value.ToString());
if (string.IsNullOrEmpty(str))
{
return "No file selected.";
}
else if (str.Length > maxChars)
{
return str.Substring(0, 10 ) + "..." + str.Substring(str.Length - maxChars+10, maxChars-10);
}
return str;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//target->source
return HttpUtility.UrlEncode(value.ToString());
}
}
public class InverseBoolDisplay : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is bool)
{
return !(bool)value;
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is bool)
{
return !(bool)value;
}
return value;
}
}
#endregion
>>>>>>> |
<<<<<<<
_isSelected = value;
RaisePropertyChanged(/*NXLT*/"IsSelected");
=======
isSelected = value;
RaisePropertyChanged("IsSelected");
>>>>>>>
isSelected = value;
RaisePropertyChanged(/*NXLT*/"IsSelected");
<<<<<<<
_guid = value;
RaisePropertyChanged(/*NXLT*/"GUID");
=======
guid = value;
RaisePropertyChanged("GUID");
>>>>>>>
guid = value;
RaisePropertyChanged(/*NXLT*/"GUID"); |
<<<<<<<
var graph = new GraphLayout.Graph();
foreach (var x in CurrentWorkspace.Nodes)
graph.AddNode(x.GUID, x.Width, x.Height);
foreach (var x in CurrentWorkspace.Connectors)
graph.AddEdge(x.GUID, x.Start.Owner.GUID, x.End.Owner.GUID);
graph.RemoveCycles();
graph.RemoveTransitiveEdges();
graph.AssignLayers();
=======
Debug.WriteLine("Node map now contains {0} nodes.", nodeMap.Count);
>>>>>>>
Debug.WriteLine("Node map now contains {0} nodes.", nodeMap.Count);
var graph = new GraphLayout.Graph();
foreach (var x in CurrentWorkspace.Nodes)
graph.AddNode(x.GUID, x.Width, x.Height);
foreach (var x in CurrentWorkspace.Connectors)
graph.AddEdge(x.GUID, x.Start.Owner.GUID, x.End.Owner.GUID);
graph.RemoveCycles();
graph.RemoveTransitiveEdges();
graph.AssignLayers(); |
<<<<<<<
internal int Optimizations = -1;
=======
internal int TreeTrimming = -1;
>>>>>>>
internal int Optimizations = -1;
internal int TreeTrimming = -1;
<<<<<<<
WasSuccessful(options.DoOptimizationSteps, this.Optimizations) &&
=======
WasSuccessful(!options.SkipSyntaxTreeTrimming, this.TreeTrimming) &&
>>>>>>>
WasSuccessful(options.DoOptimizationSteps, this.Optimizations) &&
WasSuccessful(!options.SkipSyntaxTreeTrimming, this.TreeTrimming) && |
<<<<<<<
#region Test RestOfList
[Test]
public void TestRestOfListEmptyInput()
{
DynamoModel model = ViewModel.Model;
string testFilePath = Path.Combine(listTestFolder, "testRestOfList_emptyInput.dyn");
RunModel(testFilePath);
Assert.Inconclusive("Add assertions");
}
=======
#region Test RestOfList
>>>>>>>
#region Test RestOfList
<<<<<<<
Assert.Inconclusive("Porting : AngleInput");
var model = ViewModel.Model;
=======
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
var model = ViewModel.Model;
<<<<<<<
var model = ViewModel.Model;
=======
>>>>>>>
<<<<<<<
var model = ViewModel.Model;
=======
>>>>>>>
<<<<<<<
#region Test Smooth
[Test]
public void Smooth_SimpleTest()
{
Assert.Inconclusive();
var model = ViewModel.Model;
string openPath = Path.Combine(GetTestDirectory(), @"core\list\Smooth_SimpleTest.dyn");
RunModel(openPath);
// check all the nodes and connectors are loaded
Assert.AreEqual(2, model.CurrentWorkspace.Nodes.Count);
Assert.AreEqual(1, model.CurrentWorkspace.Connectors.Count);
Dictionary<int, object> validationData = new Dictionary<int, object>()
{
{4,14.242000000000001},
{5,15.240000000000002},
};
SelectivelyAssertPreviewValues("e367bd22-e0ef-402e-b6c0-3a7aaee2be63", validationData);
}
[Test]
public void Smooth_InputListNode()
{
Assert.Inconclusive();
var model = ViewModel.Model;
string openPath = Path.Combine(GetTestDirectory(), @"core\list\Smooth_InputListNode.dyn");
RunModel(openPath);
// check all the nodes and connectors are loaded
Assert.AreEqual(6, model.CurrentWorkspace.Nodes.Count);
Assert.AreEqual(5, model.CurrentWorkspace.Connectors.Count);
Dictionary<int, object> validationData = new Dictionary<int, object>()
{
{0, 54.36},
{2,21.816733333333332},
{3,37.426796749999994},
};
SelectivelyAssertPreviewValues("ae41ff44-6f8c-4037-86ad-5ec3b22956a6", validationData);
}
[Test]
public void Smooth_NegativeTest()
{
Assert.Inconclusive();
var model = ViewModel.Model;
string openPath = Path.Combine(GetTestDirectory(), @"core\list\Smooth_NegativeTest.dyn");
RunModel(openPath);
// check all the nodes and connectors are loaded
Assert.AreEqual(5, model.CurrentWorkspace.Nodes.Count);
Assert.AreEqual(4, model.CurrentWorkspace.Connectors.Count);
}
#endregion
=======
>>>>>>> |
<<<<<<<
=======
using Dynamo.Interfaces;
using Dynamo.Models;
using Dynamo.Nodes;
using Dynamo.Selection;
>>>>>>>
using Dynamo.Interfaces;
<<<<<<<
Controller = new DynamoController(new ExecutionEnvironment(), typeof (DynamoViewModel), Context.NONE, new UpdateManager.UpdateManager(), units)
{
Testing = true
};
=======
Controller = new DynamoController(new ExecutionEnvironment(), typeof (DynamoViewModel), Context.NONE, new UpdateManager.UpdateManager(), units, new DefaultWatchHandler(), new PreferenceSettings())
{
Testing = true
};
>>>>>>>
Controller = new DynamoController(new ExecutionEnvironment(), typeof (DynamoViewModel), Context.NONE, new UpdateManager.UpdateManager(), units, new DefaultWatchHandler(), new PreferenceSettings())
{
Testing = true
}; |
<<<<<<<
using Dynamo.Utilities;
using DSCoreNodesUI.Properties;
=======
>>>>>>>
<<<<<<<
RaisePropertyChanged(/*NXLT*/"FormulaString");
RequiresRecalc = true;
EnableReporting();
if (Workspace != null)
Workspace.Modified();
=======
RaisePropertyChanged("FormulaString");
OnAstUpdated();
>>>>>>>
RaisePropertyChanged(/*NXLT*/"FormulaString");
OnAstUpdated();
<<<<<<<
var formStringNode = xmlDoc.CreateElement(/*NXLT*/"FormulaText");
=======
base.SerializeCore(element, context); //Base implementation must be called
var formStringNode = element.OwnerDocument.CreateElement("FormulaText");
>>>>>>>
base.SerializeCore(element, context); //Base implementation must be called
var formStringNode = element.OwnerDocument.CreateElement(/*NXLT*/"FormulaText");
<<<<<<<
var formStringNode = nodeElement.ChildNodes.Cast<XmlNode>().FirstOrDefault(childNode => childNode.Name == /*NXLT*/"FormulaText");
FormulaString = formStringNode != null
? formStringNode.InnerText
=======
var formStringNode = nodeElement.ChildNodes.Cast<XmlNode>().FirstOrDefault(childNode => childNode.Name == "FormulaText");
FormulaString = formStringNode != null
? formStringNode.InnerText
>>>>>>>
var formStringNode = nodeElement.ChildNodes.Cast<XmlNode>().FirstOrDefault(childNode => childNode.Name == /*NXLT*/"FormulaText");
FormulaString = formStringNode != null
? formStringNode.InnerText
<<<<<<<
#region Serialization/Deserialization methods
protected override void SerializeCore(XmlElement element, SaveContext context)
{
base.SerializeCore(element, context); //Base implementation must be called
if (context == SaveContext.Undo)
{
var helper = new XmlElementHelper(element);
helper.SetAttribute(/*NXLT*/"formulaString", FormulaString);
}
}
protected override void DeserializeCore(XmlElement element, SaveContext context)
{
base.DeserializeCore(element, context); //Base implementation must be called
if (context == SaveContext.Undo)
{
var helper = new XmlElementHelper(element);
FormulaString = helper.ReadString(/*NXLT*/"formulaString");
}
}
=======
>>>>>>> |
<<<<<<<
[Test]
public void TestUnboundVariableWarning01()
{
// Test that there are no warnings because the unbound variable is resolved downstream
string code =
@"
a = b;
b = 1;
";
Guid guid = System.Guid.NewGuid();
List<Subtree> added = new List<Subtree>();
added.Add(CreateSubTreeFromCode(guid, code));
var syncData = new GraphSyncData(null, added, null);
astLiveRunner.UpdateGraph(syncData);
Assert.AreEqual(0, astLiveRunner.Core.RuntimeStatus.WarningCount);
}
[Test]
public void TestUnboundVariableWarning02()
{
// Test that there are no warnings because the unbound variable is resolved downstream
string code =
@"
a = b;
b = c;
c = 1;
";
Guid guid = System.Guid.NewGuid();
List<Subtree> added = new List<Subtree>();
added.Add(CreateSubTreeFromCode(guid, code));
var syncData = new GraphSyncData(null, added, null);
astLiveRunner.UpdateGraph(syncData);
Assert.AreEqual(0, astLiveRunner.Core.RuntimeStatus.WarningCount);
}
=======
[Test]
[Category("Failure")]
public void RegressMAGN5353()
{
// This test case tries to verify that when a FFI object is deleted,
// the corresponding _Dispose() should be invoked.
//
// It is for defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5353
var added = new List<Subtree>();
var guid1 = Guid.NewGuid();
var code1 = @"import(""FFITarget.dll""); x = DisposeTracer();";
added.Add(CreateSubTreeFromCode(guid1, code1));
var guid2 = Guid.NewGuid();
var code2 = "y = DisposeTracer.DisposeCount;";
added.Add(CreateSubTreeFromCode(guid2, code2));
// Verify that UpateCount is only called once
var syncData = new GraphSyncData(null, added, null);
astLiveRunner.UpdateGraph(syncData);
AssertValue("y", 0);
// Modify CBN2
Subtree subtree = new Subtree(new List<AssociativeNode>{}, guid1);
List<Subtree> deleted = new List<Subtree>();
deleted.Add(subtree);
syncData = new GraphSyncData(deleted, null, null);
astLiveRunner.UpdateGraph(syncData);
AssertValue("y", 1);
}
>>>>>>>
[Test]
public void TestUnboundVariableWarning01()
{
// Test that there are no warnings because the unbound variable is resolved downstream
string code =
@"
a = b;
b = 1;
";
Guid guid = System.Guid.NewGuid();
List<Subtree> added = new List<Subtree>();
added.Add(CreateSubTreeFromCode(guid, code));
var syncData = new GraphSyncData(null, added, null);
astLiveRunner.UpdateGraph(syncData);
Assert.AreEqual(0, astLiveRunner.Core.RuntimeStatus.WarningCount);
}
[Test]
public void TestUnboundVariableWarning02()
{
// Test that there are no warnings because the unbound variable is resolved downstream
string code =
@"
a = b;
b = c;
c = 1;
";
Guid guid = System.Guid.NewGuid();
List<Subtree> added = new List<Subtree>();
added.Add(CreateSubTreeFromCode(guid, code));
var syncData = new GraphSyncData(null, added, null);
astLiveRunner.UpdateGraph(syncData);
Assert.AreEqual(0, astLiveRunner.Core.RuntimeStatus.WarningCount);
}
[Category("Failure")]
public void RegressMAGN5353()
{
// This test case tries to verify that when a FFI object is deleted,
// the corresponding _Dispose() should be invoked.
//
// It is for defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5353
var added = new List<Subtree>();
var guid1 = Guid.NewGuid();
var code1 = @"import(""FFITarget.dll""); x = DisposeTracer();";
added.Add(CreateSubTreeFromCode(guid1, code1));
var guid2 = Guid.NewGuid();
var code2 = "y = DisposeTracer.DisposeCount;";
added.Add(CreateSubTreeFromCode(guid2, code2));
// Verify that UpateCount is only called once
var syncData = new GraphSyncData(null, added, null);
astLiveRunner.UpdateGraph(syncData);
AssertValue("y", 0);
// Modify CBN2
Subtree subtree = new Subtree(new List<AssociativeNode>{}, guid1);
List<Subtree> deleted = new List<Subtree>();
deleted.Add(subtree);
syncData = new GraphSyncData(deleted, null, null);
astLiveRunner.UpdateGraph(syncData);
AssertValue("y", 1);
} |
<<<<<<<
public virtual void OnRequestTogglePan(object sender, EventArgs e)
{
if (RequestTogglePan != null)
{
RequestTogglePan(this, e);
}
}
public virtual void OnRequestStopPan(object sender, EventArgs e)
{
if (RequestStopPan != null)
{
RequestStopPan(this, e);
}
}
public virtual void OnStopDragging(object sender, EventArgs e)
{
if (StopDragging != null)
StopDragging(this, e);
}
=======
>>>>>>>
public virtual void OnRequestTogglePan(object sender, EventArgs e)
{
if (RequestTogglePan != null)
{
RequestTogglePan(this, e);
}
}
public virtual void OnRequestStopPan(object sender, EventArgs e)
{
if (RequestStopPan != null)
{
RequestStopPan(this, e);
}
}
<<<<<<<
public bool WatchEscapeIsDown
{
get { return _watchEscapeIsDown; }
set
{
_watchEscapeIsDown = value;
RaisePropertyChanged("WatchEscapeIsDown");
RaisePropertyChanged("ShouldBeHitTestVisible");
}
}
public bool ShouldBeHitTestVisible
{
get { return !WatchEscapeIsDown; }
}
=======
>>>>>>>
<<<<<<<
NodeViewModel nodeViewModel = new NodeViewModel(node);
_nodes.Add(nodeViewModel);
InfoBubbleViewModel errorBubble = new InfoBubbleViewModel(node.GUID);
nodeViewModel.ErrorBubble = errorBubble;
Errors.Add(errorBubble);
//submit the node for rendering
if (node is IDrawable)
dynSettings.Controller.OnNodeSubmittedForRendering(node, EventArgs.Empty);
=======
_nodes.Add(new NodeViewModel(node));
>>>>>>>
NodeViewModel nodeViewModel = new NodeViewModel(node);
_nodes.Add(nodeViewModel);
InfoBubbleViewModel errorBubble = new InfoBubbleViewModel(node.GUID);
nodeViewModel.ErrorBubble = errorBubble;
Errors.Add(errorBubble);
<<<<<<<
NodeViewModel nodeViewModel = _nodes.First(x => x.NodeLogic == item);
Errors.Remove(nodeViewModel.ErrorBubble);
_nodes.Remove(nodeViewModel);
//remove the node from rendering
if (node is IDrawable)
dynSettings.Controller.OnNodeRemovedFromRendering(node, EventArgs.Empty);
=======
_nodes.Remove(_nodes.First(x => x.NodeLogic == item));
>>>>>>>
NodeViewModel nodeViewModel = _nodes.First(x => x.NodeLogic == item);
Errors.Remove(nodeViewModel.ErrorBubble);
_nodes.Remove(nodeViewModel); |
<<<<<<<
// We need to move the ClassDetails object to the right index.
classObjectBase = collection[currentClassDetailsIndex];
collection.RemoveAt(currentClassDetailsIndex);
if (correctClassDetailsIndex <= collection.Count)
collection.Insert(correctClassDetailsIndex, classObjectBase);
else collection.Insert(collection.Count, classObjectBase);
=======
// We need to move the ClassInformation object to the right index.
collection.RemoveAt(currentClassInformationIndex);
collection.Insert(correctClassInformationIndex, classInformation);
>>>>>>>
// We need to move the ClassDetails object to the right index.
collection.RemoveAt(currentClassInformationIndex);
collection.Insert(correctClassInformationIndex, classObjectBase); |
<<<<<<<
public static string DYNAMO_TEST_PATH = null;
const string DYNAMO_SETTINGS_FILE = /*NXLT*/"DynamoSettings.xml";
private LengthUnit _lengthUnit;
private AreaUnit _areaUnit;
private VolumeUnit _volumeUnit;
private string _numberFormat;
=======
public static string DynamoTestPath = null;
const string DYNAMO_SETTINGS_FILE = "DynamoSettings.xml";
private LengthUnit lengthUnit;
private AreaUnit areaUnit;
private VolumeUnit volumeUnit;
private string numberFormat;
>>>>>>>
public static string DynamoTestPath = null;
const string DYNAMO_SETTINGS_FILE = /*NXLT*/"DynamoSettings.xml";
private LengthUnit lengthUnit;
private AreaUnit areaUnit;
private VolumeUnit volumeUnit;
private string numberFormat;
<<<<<<<
_numberFormat = value;
RaisePropertyChanged(/*NXLT*/"NumberFormat");
=======
numberFormat = value;
RaisePropertyChanged("NumberFormat");
>>>>>>>
numberFormat = value;
RaisePropertyChanged(/*NXLT*/"NumberFormat");
<<<<<<<
_lengthUnit = value;
RaisePropertyChanged(/*NXLT*/"LengthUnit");
=======
lengthUnit = value;
RaisePropertyChanged("LengthUnit");
>>>>>>>
lengthUnit = value;
RaisePropertyChanged(/*NXLT*/"LengthUnit");
<<<<<<<
_areaUnit = value;
RaisePropertyChanged(/*NXLT*/"AreaUnit");
=======
areaUnit = value;
RaisePropertyChanged("AreaUnit");
>>>>>>>
areaUnit = value;
RaisePropertyChanged(/*NXLT*/"AreaUnit");
<<<<<<<
_volumeUnit = value;
RaisePropertyChanged(/*NXLT*/"VolumeUnit");
=======
volumeUnit = value;
RaisePropertyChanged("VolumeUnit");
>>>>>>>
volumeUnit = value;
RaisePropertyChanged(/*NXLT*/"VolumeUnit"); |
<<<<<<<
//trigger the event to request the display
//of the preset name dialogue
var args = new PresetsNamePromptEventArgs();
this.Model.OnRequestPresetNamePrompt(args);
//Select only Input nodes for preset
var IDS = selectedNodes.Select(x => x.GUID).ToList();
if (args.Success)
{
this.ExecuteCommand(new DynamoModel.AddPresetCommand(args.Name, args.Description, IDS));
}
=======
this.ExecuteCommand(new DynamoModel.AddPresetCommand(args.Name, args.Description, IDS));
//Presets created - this will enable the Restore / Delete presets
RaisePropertyChanged("EnablePresetOptions");
>>>>>>>
//trigger the event to request the display
//of the preset name dialogue
var args = new PresetsNamePromptEventArgs();
this.Model.OnRequestPresetNamePrompt(args);
//Select only Input nodes for preset
var IDS = selectedNodes.Select(x => x.GUID).ToList();
if (args.Success)
{
this.ExecuteCommand(new DynamoModel.AddPresetCommand(args.Name, args.Description, IDS));
}
this.ExecuteCommand(new DynamoModel.AddPresetCommand(args.Name, args.Description, IDS));
//Presets created - this will enable the Restore / Delete presets
RaisePropertyChanged("EnablePresetOptions"); |
<<<<<<<
signCmd.Append(string.Format(" -signedjar {0}-unaligned.apk {1}",
Utils.generateSafePathString(Path.Combine(bin,projectName)),
Utils.generateSafePathString(Path.Combine(bin,"*unsigned.apk"))));
signCmd.Append(string.Format(" {0}", project.alias));
=======
signCmd.Append(string.Format(" -signedjar {0}-unaligned.apk {1}", Path.Combine(bin,projectName), Path.Combine(bin,"*unsigned.apk") ));
signCmd.Append(string.Format(" {0}", project.alias));
>>>>>>>
signCmd.Append(string.Format(" -signedjar {0}-unaligned.apk {1}",
Utils.generateSafePathString(Path.Combine(bin,projectName)),
Utils.generateSafePathString(Path.Combine(bin,"*unsigned.apk"))));
signCmd.Append(string.Format(" {0}", project.alias));
<<<<<<<
zipAlignCmd.Append(string.Format(" {0}", Utils.generateSafePathString(Path.Combine(bin, "*unaligned.apk"))));
zipAlignCmd.Append(string.Format(" {0}", Utils.generateSafePathString(Path.Combine(bin, string.Format("{0}-{1}.apk", projectName, channle)))));
=======
zipAlignCmd.Append(string.Format(" {0}", Path.Combine(bin, "*unaligned.apk")));
zipAlignCmd.Append(string.Format(" {0}", Path.Combine(bin, string.Format("{0}-{1}.apk", projectName, channle))));
>>>>>>>
zipAlignCmd.Append(string.Format(" {0}", Utils.generateSafePathString(Path.Combine(bin, "*unaligned.apk"))));
zipAlignCmd.Append(string.Format(" {0}", Utils.generateSafePathString(Path.Combine(bin, string.Format("{0}-{1}.apk", projectName, channle)))));
<<<<<<<
if(!File.Exists(build_file)){
//Sys.Run(string.Format("android update project -p {0} -t {1}", project.project_path, "android-4"));
Sys.Run(string.Format("android update project -p {0}", Utils.generateSafePathString(project.project_path)));
=======
if(!File.Exists(build_file) && !File.Exists(project_property_file)){
Sys.Run(string.Format("android update project -p {0} -t android-4", project.project_path));
}else if(!File.Exists(build_file) && File.Exists(project_property_file)){
Sys.Run(string.Format("android update project -p {0}", project.project_path));
>>>>>>>
if(!File.Exists(build_file) && !File.Exists(project_property_file)){
Sys.Run(string.Format("android update project -p {0} -t android-4", Utils.generateSafePathString(project.project_path)));
}else if(!File.Exists(build_file) && File.Exists(project_property_file)){
Sys.Run(string.Format("android update project -p {0}", Utils.generateSafePathString(project.project_path))); |
<<<<<<<
public const double InitialMargin = 0;
public const string ToolTipForTempVariable = /*NXLT*/"Statement Output";
=======
public const double INITIAL_MARGIN = 0;
public const string TOOL_TIP_FOR_TEMP_VARIABLE = "Statement Output";
>>>>>>>
public const double INITIAL_MARGIN = 0;
public const string TOOL_TIP_FOR_TEMP_VARIABLE = "Statement Output";
<<<<<<<
RaisePropertyChanged(/*NXLT*/"Code");
RequiresRecalc = true;
ReportPosition();
=======
if (newCode == null)
code = null;
else
{
string errorMessage = string.Empty;
string warningMessage = string.Empty;
>>>>>>>
if (newCode == null)
code = null;
else
{
string errorMessage = string.Empty;
string warningMessage = string.Empty;
<<<<<<<
base.DeserializeCore(element, context);
if (context == SaveContext.Undo)
{
var helper = new XmlElementHelper(element);
shouldFocus = helper.ReadBoolean(/*NXLT*/"ShouldFocus");
code = helper.ReadString(/*NXLT*/"CodeText");
ProcessCodeDirect();
}
=======
base.DeserializeCore(nodeElement, context);
var helper = new XmlElementHelper(nodeElement);
shouldFocus = helper.ReadBoolean("ShouldFocus");
code = helper.ReadString("CodeText");
ProcessCodeDirect();
>>>>>>>
base.DeserializeCore(nodeElement, context);
var helper = new XmlElementHelper(nodeElement);
shouldFocus = helper.ReadBoolean(/*NXLT*/"ShouldFocus");
code = helper.ReadString(/*NXLT*/"CodeText");
ProcessCodeDirect();
<<<<<<<
RaisePropertyChanged(/*NXLT*/"Code");
RequiresRecalc = true;
if (Workspace != null)
{
Workspace.Modified();
}
=======
RaisePropertyChanged("Code");
ForceReExecuteOfNode = true;
OnAstUpdated();
>>>>>>>
RaisePropertyChanged(/*NXLT*/"Code");
ForceReExecuteOfNode = true;
OnAstUpdated(); |
<<<<<<<
using Dynamo.Models;
=======
using Dynamo.PackageManager.UI;
>>>>>>>
using Dynamo.Models;
<<<<<<<
public partial class dynFunction : dynBuiltinFunction
=======
public class dynFunction : dynNodeWithOneOutput
>>>>>>>
public partial class dynFunction : dynNodeWithOneOutput
<<<<<<<
public new string Name
{
get { return this.Definition.Workspace.Name; }
}
=======
public override void SetupCustomUIElements(dynNodeView nodeUI)
{
nodeUI.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(ui_MouseDoubleClick);
//var editItem = new MenuItem();
//editItem.Header = "Edit Properties...";
//editItem.Click += EditCustomNodePropertiesClick;
//nodeUI.MainContextMenu.Items.Add(editItem);
}
void ui_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
Controller.DynamoViewModel.GoToWorkspaceCommand.Execute(_def.FunctionId);
e.Handled = true;
}
>>>>>>>
<<<<<<<
=======
public override void SetupCustomUIElements(dynNodeView nodeUI)
{
//add a text box to the input grid of the control
tb = new TextBox();
tb.HorizontalAlignment = HorizontalAlignment.Stretch;
tb.VerticalAlignment = VerticalAlignment.Center;
nodeUI.inputGrid.Children.Add(tb);
Grid.SetColumn(tb, 0);
Grid.SetRow(tb, 0);
//turn off the border
var backgroundBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
tb.Background = backgroundBrush;
tb.BorderThickness = new Thickness(0);
tb.DataContext = this;
var bindingSymbol = new Binding("Symbol")
{
Mode = BindingMode.TwoWay,
Converter = new StringDisplay()
};
tb.SetBinding(TextBox.TextProperty, bindingSymbol);
tb.TextChanged += tb_TextChanged;
}
void tb_TextChanged(object sender, TextChangedEventArgs e)
{
Symbol = tb.Text;
}
>>>>>>>
<<<<<<<
=======
public override void SetupCustomUIElements(Controls.dynNodeView nodeUI)
{
//add a text box to the input grid of the control
tb = new TextBox();
tb.HorizontalAlignment = HorizontalAlignment.Stretch;
tb.VerticalAlignment = VerticalAlignment.Center;
nodeUI.inputGrid.Children.Add(tb);
Grid.SetColumn(tb, 0);
Grid.SetRow(tb, 0);
//turn off the border
var backgroundBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
tb.Background = backgroundBrush;
tb.BorderThickness = new Thickness(0);
tb.DataContext = this;
var bindingSymbol = new Binding("Symbol")
{
Mode = BindingMode.TwoWay
};
tb.SetBinding(TextBox.TextProperty, bindingSymbol);
tb.TextChanged += tb_TextChanged;
}
void tb_TextChanged(object sender, TextChangedEventArgs e)
{
Symbol = tb.Text;
}
>>>>>>> |
<<<<<<<
var parameters1 = new List<TypedParameter>();
parameters1.Add(new TypedParameter("x", new ProtoCore.Type { Name = "double" }));
parameters1.Add(new TypedParameter("y", new ProtoCore.Type { Name = "double" }));
var functionItem1 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters1, FunctionType = FunctionType.GenericFunction
});
=======
var parameters1 = new List<TypedParameter>();
parameters1.Add(new TypedParameter(new TypedParameterParams("x", new ProtoCore.Type { Name = "double" })));
parameters1.Add(new TypedParameter(new TypedParameterParams("y", new ProtoCore.Type { Name = "double" })));
var functionItem1 = new FunctionDescriptor("Foo", parameters1, FunctionType.GenericFunction);
>>>>>>>
var parameters1 = new List<TypedParameter>();
parameters1.Add(new TypedParameter(new TypedParameterParams("x", new ProtoCore.Type { Name = "double" })));
parameters1.Add(new TypedParameter(new TypedParameterParams("y", new ProtoCore.Type { Name = "double" })));
var functionItem1 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters1, FunctionType = FunctionType.GenericFunction
});
<<<<<<<
var parameters2 = new List<TypedParameter>();
parameters2.Add(new TypedParameter("point", new ProtoCore.Type { Name = "Point" }));
var functionItem2 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters2, FunctionType = FunctionType.GenericFunction
});
=======
var parameters2 = new List<TypedParameter>();
parameters2.Add(new TypedParameter(new TypedParameterParams("point", new ProtoCore.Type { Name = "Point" })));
var functionItem2 = new FunctionDescriptor("Foo", parameters2, FunctionType.GenericFunction);
>>>>>>>
var parameters2 = new List<TypedParameter>();
parameters2.Add(new TypedParameter(new TypedParameterParams("point", new ProtoCore.Type { Name = "Point" })));
var functionItem2 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters2, FunctionType = FunctionType.GenericFunction
});
<<<<<<<
var parameters3 = new List<TypedParameter>();
parameters3.Add(new TypedParameter("a", new ProtoCore.Type { Name = "bool [ ] [ ] " }));
parameters3.Add(new TypedParameter("b", new ProtoCore.Type { Name = "var[]" }));
parameters3.Add(new TypedParameter("c", new ProtoCore.Type { Name = "double[][]" }));
var functionItem3 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters3, FunctionType = FunctionType.GenericFunction
});
=======
var parameters3 = new List<TypedParameter>();
parameters3.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "bool [ ] [ ] " })));
parameters3.Add(new TypedParameter(new TypedParameterParams("b", new ProtoCore.Type { Name = "var[]" })));
parameters3.Add(new TypedParameter(new TypedParameterParams("c", new ProtoCore.Type { Name = "double[][]" })));
var functionItem3 = new FunctionDescriptor("Foo", parameters3, FunctionType.GenericFunction);
>>>>>>>
var parameters3 = new List<TypedParameter>();
parameters3.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "bool [ ] [ ] " })));
parameters3.Add(new TypedParameter(new TypedParameterParams("b", new ProtoCore.Type { Name = "var[]" })));
parameters3.Add(new TypedParameter(new TypedParameterParams("c", new ProtoCore.Type { Name = "double[][]" })));
var functionItem3 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters3, FunctionType = FunctionType.GenericFunction
});
<<<<<<<
var parameters4 = new List<TypedParameter>();
parameters4.Add(new TypedParameter("arr", new ProtoCore.Type { Name = "var[]..[]" }));
parameters4.Add(new TypedParameter("a", new ProtoCore.Type { Name = "int" }));
var functionItem4 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters4, FunctionType = FunctionType.GenericFunction
});
=======
var parameters4 = new List<TypedParameter>();
parameters4.Add(new TypedParameter(new TypedParameterParams("arr", new ProtoCore.Type { Name = "var[]..[]" })));
parameters4.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "int" })));
var functionItem4 = new FunctionDescriptor("Foo", parameters4, FunctionType.GenericFunction);
>>>>>>>
var parameters4 = new List<TypedParameter>();
parameters4.Add(new TypedParameter(new TypedParameterParams("arr", new ProtoCore.Type { Name = "var[]..[]" })));
parameters4.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "int" })));
var functionItem4 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters4, FunctionType = FunctionType.GenericFunction
});
<<<<<<<
var parameters5 = new List<TypedParameter>();
parameters5.Add(new TypedParameter("a", new ProtoCore.Type { Name = "Autodesk.DesignScript.Geometry.Circle" }));
parameters5.Add(new TypedParameter("b", new ProtoCore.Type { Name = "Xxxx.Yyy.Curve" }));
var functionItem5 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters5, FunctionType = FunctionType.GenericFunction
});
=======
var parameters5 = new List<TypedParameter>();
parameters5.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "Autodesk.DesignScript.Geometry.Circle" })));
parameters5.Add(new TypedParameter(new TypedParameterParams("b", new ProtoCore.Type { Name = "Xxxx.Yyy.Curve" })));
var functionItem5 = new FunctionDescriptor("Foo", parameters5, FunctionType.GenericFunction);
>>>>>>>
var parameters5 = new List<TypedParameter>();
parameters5.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "Autodesk.DesignScript.Geometry.Circle" })));
parameters5.Add(new TypedParameter(new TypedParameterParams("b", new ProtoCore.Type { Name = "Xxxx.Yyy.Curve" })));
var functionItem5 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "Foo", Parameters = parameters5, FunctionType = FunctionType.GenericFunction
});
<<<<<<<
var parameters6 = new List<TypedParameter>();
parameters6.Add(new TypedParameter("a", new ProtoCore.Type { Name = "int" }));
var functionItem6 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "", Parameters = parameters6, FunctionType = FunctionType.GenericFunction
});
=======
var parameters6 = new List<TypedParameter>();
parameters6.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "int" })));
var functionItem6 = new FunctionDescriptor("", parameters6, FunctionType.GenericFunction);
>>>>>>>
var parameters6 = new List<TypedParameter>();
parameters6.Add(new TypedParameter(new TypedParameterParams("a", new ProtoCore.Type { Name = "int" })));
var functionItem6 = new FunctionDescriptor(new FunctionDescriptorParams
{
FunctionName = "", Parameters = parameters6, FunctionType = FunctionType.GenericFunction
}); |
<<<<<<<
=======
using Microsoft.Practices.Prism.ViewModel;
using System.IO;
using System.Xml;
using DynamoUtilities;
>>>>>>>
using System.Xml;
using DynamoUtilities; |
<<<<<<<
using RevitServices.Elements;
using RevitServices.Persistence;
using RevitServices.Transactions;
using ChangeType = RevitServices.Elements.ChangeType;
using CurveLoop = Autodesk.Revit.DB.CurveLoop;
=======
using Length = Dynamo.Nodes.Length;
>>>>>>>
using RevitServices.Elements;
using RevitServices.Persistence;
using RevitServices.Transactions;
using ChangeType = RevitServices.Elements.ChangeType;
using CurveLoop = Autodesk.Revit.DB.CurveLoop;
<<<<<<<
public DynamoController_Revit(FSchemeInterop.ExecutionEnvironment env, RevitServicesUpdater updater, Type viewModelType, string context)
: base(env, viewModelType, context, new UpdateManager.UpdateManager())
=======
public DynamoController_Revit(FSchemeInterop.ExecutionEnvironment env, DynamoUpdater updater, Type viewModelType, string context, IUnitsManager units)
: base(env, viewModelType, context, new UpdateManager.UpdateManager(), units)
>>>>>>>
public DynamoController_Revit(FSchemeInterop.ExecutionEnvironment env, RevitServicesUpdater updater, Type viewModelType, string context, IUnitsManager units)
: base(env, viewModelType, context, new UpdateManager.UpdateManager(), units)
<<<<<<<
UnitsManager.Instance.HostApplicationInternalAreaUnit = DynamoAreaUnit.SquareFoot;
UnitsManager.Instance.HostApplicationInternalLengthUnit = DynamoLengthUnit.DecimalFoot;
UnitsManager.Instance.HostApplicationInternalVolumeUnit = DynamoVolumeUnit.CubicFoot;
EngineController.ImportLibrary("DSRevitNodes.dll");
=======
>>>>>>>
EngineController.ImportLibrary("DSRevitNodes.dll");
<<<<<<<
node.Clicked += () => DocumentManager.GetInstance().CurrentUIDocument.ShowElements(element);
=======
node.Clicked += () => dynRevitSettings.Doc.ShowElements(element);
>>>>>>>
node.Clicked += () => DocumentManager.GetInstance().CurrentUIDocument.ShowElements(element); |
<<<<<<<
var model = ViewModel.Model;
OpenModel(@".\01 Create Point\create point_sequence.dyn");
=======
var model = dynSettings.Controller.DynamoModel;
string samplePath = Path.Combine(_testPath, @".\Samples\createpoint_sequence.dyn");
string testPath = Path.GetFullPath(samplePath);
Controller.DynamoViewModel.OpenCommand.Execute(testPath);
>>>>>>>
var model = ViewModel.Model;
string samplePath = Path.Combine(_testPath, @".\Samples\createpoint_sequence.dyn");
string testPath = Path.GetFullPath(samplePath);
ViewModel.OpenCommand.Execute(testPath);
<<<<<<<
var model = ViewModel.Model;
OpenModel(@".\02 Ref Grid Sliders\ref grid sliders.dyn");
=======
var model = dynSettings.Controller.DynamoModel;
string samplePath = Path.Combine(_testPath, @".\Samples\refgridsliders.dyn");
string testPath = Path.GetFullPath(samplePath);
Controller.DynamoViewModel.OpenCommand.Execute(testPath);
>>>>>>>
var model = ViewModel.Model;
string samplePath = Path.Combine(_testPath, @".\Samples\refgridsliders.dyn");
string testPath = Path.GetFullPath(samplePath);
ViewModel.OpenCommand.Execute(testPath);
<<<<<<<
//var model = ViewModel.Model;
=======
// TODO:(Ritesh) Revisit and fix the text case after discussing with Zach
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
//var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:(Ritesh) Revisit and fix the text case after discussing with Zach
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
//var model = ViewModel.Model;
<<<<<<<
//var model = ViewModel.Model;
=======
var model = dynSettings.Controller.DynamoModel;
string samplePath = Path.Combine(_testPath, @".\Samples\divideselectedcurve.dyn");
string testPath = Path.GetFullPath(samplePath);
Controller.DynamoViewModel.OpenCommand.Execute(testPath);
>>>>>>>
var model = ViewModel.Model;
string samplePath = Path.Combine(_testPath, @".\Samples\divideselectedcurve.dyn");
string testPath = Path.GetFullPath(samplePath);
ViewModel.OpenCommand.Execute(testPath);
<<<<<<<
//model.Open(testPath);
//var selectionNodes = ViewModel.Model.Nodes.Where(x => x is CurvesBySelection);
//Assert.AreEqual(1, selectionNodes.Count());
=======
var refPtNodeId = "7e23ea22-600f-4263-89af-defa541e90f2";
AssertPreviewCount(refPtNodeId, 33);
>>>>>>>
var refPtNodeId = "7e23ea22-600f-4263-89af-defa541e90f2";
AssertPreviewCount(refPtNodeId, 33);
<<<<<<<
//var model = ViewModel.Model;
=======
// TODO:(Ritesh) Revisit and fix the text case after discussing with Zach
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
//var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:(Ritesh) Revisit and fix the text case after discussing with Zach
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
//var model = ViewModel.Model;
<<<<<<<
//var model = ViewModel.Model;
=======
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
// TODO:(Ritesh) Revisit and fix the text case after discussing with Zach
//var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
// TODO:(Ritesh) Revisit and fix the text case after discussing with Zach
//var model = ViewModel.Model;
<<<<<<<
ViewModel.Model.RunExpression();
=======
>>>>>>>
<<<<<<<
ViewModel.Model.RunExpression();
=======
>>>>>>>
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
}
[Test]
[TestModel(@".\empty.rfa")]
public void Attractor_2()
{
var model = ViewModel.Model;
string samplePath = Path.Combine(_samplesPath, @".\10 Attractor\Attractor Logic_Start.dyn");
string testPath = Path.GetFullPath(samplePath);
ViewModel.OpenCommand.Execute(testPath);
var nodes = ViewModel.Model.Nodes.OfType<DummyNode>();
=======
RunCurrentModel();
>>>>>>>
RunCurrentModel();
<<<<<<<
// check all the nodes and connectors are loaded
Assert.AreEqual(17, model.CurrentWorkspace.Nodes.Count);
Assert.AreEqual(17, model.CurrentWorkspace.Connectors.Count);
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
>>>>>>>
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
}
[Test]
[TestModel(@".\empty.rfa")]
public void AdaptiveComponentPlacement()
{
var model = ViewModel.Model;
string samplePath = Path.Combine(_samplesPath, @".\18 Adaptive Components\Adaptive Component Placement.dyn");
string testPath = Path.GetFullPath(samplePath);
ViewModel.OpenCommand.Execute(testPath);
var nodes = ViewModel.Model.Nodes.OfType<DummyNode>();
double noOfNdoes = nodes.Count();
=======
RunCurrentModel();
var family = "277dec13-7918-47c2-b33e-2346058dc5c2";
AssertPreviewCount(family, 20);
>>>>>>>
RunCurrentModel();
var family = "277dec13-7918-47c2-b33e-2346058dc5c2";
AssertPreviewCount(family, 20);
<<<<<<<
// check all the nodes and connectors are loaded
Assert.AreEqual(11, model.CurrentWorkspace.Nodes.Count);
Assert.AreEqual(10, model.CurrentWorkspace.Connectors.Count);
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
>>>>>>>
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
RunCurrentModel();
var refPoint = "b0684654-367e-4cbf-bfbc-ff28df9afef9";
AssertPreviewCount(refPoint, 746);
>>>>>>>
RunCurrentModel();
var refPoint = "b0684654-367e-4cbf-bfbc-ff28df9afef9";
AssertPreviewCount(refPoint, 746);
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
RunCurrentModel();
var refPointNodeID = "a80c323f-7443-42fd-a38c-4a84623fdeb5";
AssertPreviewCount(refPointNodeID, 122);
>>>>>>>
RunCurrentModel();
var refPointNodeID = "a80c323f-7443-42fd-a38c-4a84623fdeb5";
AssertPreviewCount(refPointNodeID, 122);
<<<<<<<
var model = ViewModel.Model;
=======
//TODO:[Ritesh] Some random behgavior in output, need to check with Ian.
// Will enable verification after fixing test case.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
//TODO:[Ritesh] Some random behgavior in output, need to check with Ian.
// Will enable verification after fixing test case.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
RunCurrentModel();
//var curve = "ca608a4e-0430-4cee-a0bb-61e81f198e8b";
//AssertPreviewCount(curve, 479);
>>>>>>>
RunCurrentModel();
//var curve = "ca608a4e-0430-4cee-a0bb-61e81f198e8b";
//AssertPreviewCount(curve, 479);
<<<<<<<
var model = ViewModel.Model;
=======
//TODO:[Ritesh] Some random behgavior in output, need to check with Ian.
// Will enable verification after fixing test case.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
//TODO:[Ritesh] Some random behgavior in output, need to check with Ian.
// Will enable verification after fixing test case.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
RunCurrentModel();
>>>>>>>
RunCurrentModel();
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
var nodes = ViewModel.Model.Nodes.OfType<DummyNode>();
double noOfNdoes = nodes.Count();
if (noOfNdoes >= 1)
{
Assert.Fail("Number of Dummy Node found in Sample: " + noOfNdoes);
}
=======
AssertNoDummyNodes();
>>>>>>>
AssertNoDummyNodes();
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
RunCurrentModel();
// Validation for Model Curve
var modelCurveNodeID = "981b8d59-5d7d-4fc5-869c-0b7ca88fc4eb";
var curve = GetPreviewValue(modelCurveNodeID) as ModelCurve;
Assert.IsNotNull(curve);
>>>>>>>
RunCurrentModel();
// Validation for Model Curve
var modelCurveNodeID = "981b8d59-5d7d-4fc5-869c-0b7ca88fc4eb";
var curve = GetPreviewValue(modelCurveNodeID) as ModelCurve;
Assert.IsNotNull(curve);
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
//Assert.Inconclusive("Porting : StringFileName");
=======
Assert.DoesNotThrow(() => dynSettings.Controller.RunExpression());
>>>>>>>
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
<<<<<<<
//ViewModel.Model.RunExpression();
//Assert.Inconclusive("Porting : StringFileName");
=======
>>>>>>>
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
var nodes = ViewModel.Model.Nodes.OfType<DummyNode>();
double noOfNdoes = nodes.Count();
if (noOfNdoes >= 1)
{
Assert.Fail("Number of Dummy Node found in Sample: " + noOfNdoes);
}
=======
AssertNoDummyNodes();
>>>>>>>
AssertNoDummyNodes();
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
RunCurrentModel();
>>>>>>>
RunCurrentModel();
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
var nodes = ViewModel.Model.Nodes.OfType<DummyNode>();
double noOfNdoes = nodes.Count();
if (noOfNdoes >= 1)
{
Assert.Fail("Number of Dummy Node found in Sample: " + noOfNdoes);
}
=======
AssertNoDummyNodes();
>>>>>>>
AssertNoDummyNodes();
<<<<<<<
Assert.DoesNotThrow(() => ViewModel.Model.RunExpression());
=======
RunCurrentModel();
>>>>>>>
RunCurrentModel();
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model;
<<<<<<<
var model = ViewModel.Model;
=======
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = dynSettings.Controller.DynamoModel;
>>>>>>>
// TODO:[Ritesh] Need to add more verification.
// http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4041
var model = ViewModel.Model; |
<<<<<<<
public void ShowPopup(object parameter)
{
controller.PopupViewmodel.UpdatePopupCommand.Execute(parameter);
controller.PopupViewmodel.FadeInCommand.Execute(null);
}
internal bool CanShowPopup(object parameter)
{
return true;
}
public void HidePopup(object parameter)
{
controller.PopupViewmodel.FadeOutCommand.Execute(null);
}
internal bool CanHidePopup(object parameter)
{
return true;
}
=======
public void TogglePan(object parameter)
{
CurrentSpaceViewModel.TogglePanCommand.Execute(parameter);
}
internal bool CanTogglePan(object parameter)
{
return CurrentSpaceViewModel.TogglePanCommand.CanExecute(parameter);
}
public void Escape(object parameter)
{
CurrentSpaceViewModel.OnRequestStopPan(this, null); // Escape Pan Mode
}
internal bool CanEscape(object parameter)
{
return true;
}
>>>>>>>
public void TogglePan(object parameter)
{
CurrentSpaceViewModel.TogglePanCommand.Execute(parameter);
}
internal bool CanTogglePan(object parameter)
{
return CurrentSpaceViewModel.TogglePanCommand.CanExecute(parameter);
}
public void Escape(object parameter)
{
CurrentSpaceViewModel.OnRequestStopPan(this, null); // Escape Pan Mode
}
internal bool CanEscape(object parameter)
{
return true;
}
public void ShowPopup(object parameter)
{
controller.PopupViewmodel.UpdatePopupCommand.Execute(parameter);
controller.PopupViewmodel.FadeInCommand.Execute(null);
}
internal bool CanShowPopup(object parameter)
{
return true;
}
public void HidePopup(object parameter)
{
controller.PopupViewmodel.FadeOutCommand.Execute(null);
}
internal bool CanHidePopup(object parameter)
{
return true;
} |
<<<<<<<
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml;
=======
using DSCoreNodesUI;
>>>>>>>
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml;
using DSCoreNodesUI;
<<<<<<<
#region internal members
private PulseMaker pulseMaker;
private DynamoScheduler scheduler;
private ObservableCollection<WorkspaceModel> workspaces = new ObservableCollection<WorkspaceModel>();
private Dictionary<Guid, NodeModel> nodeMap = new Dictionary<Guid, NodeModel>();
private bool runEnabled = true;
#endregion
#region Static properties
=======
#region static properties
>>>>>>>
#region internal members
private PulseMaker pulseMaker;
#endregion
<<<<<<<
public bool HasNodeThatPeriodicallyUpdates
{
get
{
var nodes = HomeSpace.Nodes;
return nodes.Any(n => n.EnablePeriodicUpdate);
}
}
=======
/// <summary>
/// Specifies how connectors are displayed in Dynamo.
/// </summary>
>>>>>>>
public bool HasNodeThatPeriodicallyUpdates
{
get
{
var nodes = HomeSpace.Nodes;
return nodes.Any(n => n.EnablePeriodicUpdate);
}
}
/// <summary>
/// Specifies how connectors are displayed in Dynamo.
/// </summary>
<<<<<<<
public int EvaluationPeriod
{
get { return pulseMaker == null ? 0 : pulseMaker.TimerPeriod; }
}
/// <summary>
/// All nodes in all workspaces.
/// </summary>
public IEnumerable<NodeModel> AllNodes
=======
protected virtual void ShutDownCore(bool shutdownHost)
>>>>>>>
public int EvaluationPeriod
{
get { return pulseMaker == null ? 0 : pulseMaker.TimerPeriod; }
}
protected virtual void ShutDownCore(bool shutdownHost)
<<<<<<<
ShutdownRequested = true;
// If there exists a PulseMaker, disable it first.
if (pulseMaker != null)
pulseMaker.Stop();
OnShutdownStarted(); // Notify possible event handlers.
PreShutdownCore(shutdownHost);
ShutDownCore(shutdownHost);
PostShutdownCore(shutdownHost);
OnShutdownCompleted(); // Notify possible event handlers.
=======
>>>>>>>
<<<<<<<
#else
/// <summary>
/// Start periodic evaluation by the given amount of time. If there
/// is an on-going periodic evaluation, an exception will be thrown.
/// </summary>
/// <param name="milliseconds">The desired amount of time between two
/// evaluations in milliseconds.</param>
///
public void StartPeriodicEvaluation(int milliseconds)
{
if (pulseMaker == null)
pulseMaker = new PulseMaker(this);
if (pulseMaker.TimerPeriod != 0)
{
throw new InvalidOperationException(
"Periodic evaluation cannot be started without stopping");
}
pulseMaker.Start(milliseconds);
}
/// <summary>
/// Stop the on-going periodic evaluation, if there is any.
/// </summary>
///
public void StopPeriodicEvaluation()
{
if (pulseMaker != null && (pulseMaker.TimerPeriod != 0))
pulseMaker.Stop();
}
/// <summary>
/// This method is typically called from the main application thread (as
/// a result of user actions such as button click or node UI changes) to
/// schedule an update of the graph. This call may or may not represent
/// an actual update. In the event that the user action does not result
/// in actual graph update (e.g. moving of node on UI), the update task
/// will not be scheduled for execution.
/// </summary>
///
public void RunExpression()
=======
private void InitializeIncludedNodes()
>>>>>>>
/// <summary>
/// Start periodic evaluation by the given amount of time. If there
/// is an on-going periodic evaluation, an exception will be thrown.
/// </summary>
/// <param name="milliseconds">The desired amount of time between two
/// evaluations in milliseconds.</param>
///
public void StartPeriodicEvaluation(int milliseconds)
{
if (pulseMaker == null)
pulseMaker = new PulseMaker(this);
if (pulseMaker.TimerPeriod != 0)
{
throw new InvalidOperationException(
"Periodic evaluation cannot be started without stopping");
}
pulseMaker.Start(milliseconds);
}
/// <summary>
/// Stop the on-going periodic evaluation, if there is any.
/// </summary>
///
public void StopPeriodicEvaluation()
{
if (pulseMaker != null && (pulseMaker.TimerPeriod != 0))
pulseMaker.Stop();
}
private void InitializeIncludedNodes()
<<<<<<<
/// Add a workspace to the dynamo model.
/// </summary>
/// <param name="workspace"></param>
private void AddHomeWorkspace()
{
var workspace = new HomeWorkspaceModel(this)
{
WatchChanges = true
};
HomeSpace = workspace;
workspaces.Insert(0, workspace); // to front
workspace.Nodes.CollectionChanged += OnNodeCollectionChanged;
}
/// <summary>
/// Remove a workspace from the dynamo model.
=======
/// Remove a workspace from the dynamo model.
>>>>>>>
/// Remove a workspace from the dynamo model. |
<<<<<<<
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Dynamo.Core;
using Dynamo.Utilities;
using Greg.Requests;
=======
using Greg.Requests;
>>>>>>>
using Dynamo.Core;
using Greg.Requests; |
<<<<<<<
/// <search>filter,in,out,mask,dispatch,bool filter,boolfilter,bool filter</search>
[MultiReturn(new[] { /*NXLT*/"in", /*NXLT*/"out" })]
=======
/// <search>filter,in,out,mask,dispatch</search>
[MultiReturn(new[] { "in", "out" })]
>>>>>>>
/// <search>filter,in,out,mask,dispatch,bool filter,boolfilter,bool filter</search>
[MultiReturn(new[] { "in", "out" })]
<<<<<<<
/// <search>first,rest,list split</search>
[MultiReturn(new[] { /*NXLT*/"first", /*NXLT*/"rest" })]
=======
/// <search>first,rest</search>
[MultiReturn(new[] { "first", "rest" })]
>>>>>>>
/// <search>first,rest,list split</search>
[MultiReturn(new[] { "first", "rest" })] |
<<<<<<<
dynSettings.Controller.DynamoViewModel.RequestAuthentication += RegisterSingleSignOn;
=======
//Predicate<NodeModel> requiresTransactionPredicate = node => node is RevitTransactionNode;
//CheckRequiresTransaction = new PredicateTraverser(requiresTransactionPredicate);
//Predicate<NodeModel> manualTransactionPredicate = node => node is Transaction;
//CheckManualTransaction = new PredicateTraverser(manualTransactionPredicate);
AddPythonBindings();
>>>>>>>
dynSettings.Controller.DynamoViewModel.RequestAuthentication += RegisterSingleSignOn;
<<<<<<<
protected override VisualizationManager InitializeVisualizationManager()
{
var visualizationManager = new VisualizationManagerRevit(this);
visualizationManager.VisualizationUpdateComplete += visualizationManager_VisualizationUpdateComplete;
visualizationManager.RequestAlternateContextClear += CleanupVisualizations;
dynSettings.Controller.DynamoModel.CleaningUp += CleanupVisualizations;
return visualizationManager;
}
=======
>>>>>>>
<<<<<<<
private void CleanupVisualizations(object sender, EventArgs e)
{
RevThread.IdlePromise.ExecuteOnIdleAsync(
() =>
{
TransactionManager.Instance.EnsureInTransaction(
DocumentManager.Instance.CurrentDBDocument);
if (keeperId != ElementId.InvalidElementId)
{
DocumentManager.Instance.CurrentUIDocument.Document.Delete(keeperId);
keeperId = ElementId.InvalidElementId;
}
TransactionManager.Instance.ForceCloseTransaction();
});
}
/// <summary>
/// Handler for the visualization manager's VisualizationUpdateComplete event.
/// Sends goemetry to the GeomKeeper, if available, for preview in Revit.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void visualizationManager_VisualizationUpdateComplete(object sender, EventArgs e)
{
// //do not draw to geom keeper if the user has selected
// //not to draw to the alternate context or if it is not available
// if (!VisualizationManager.AlternateDrawingContextAvailable
// || !VisualizationManager.DrawToAlternateContext)
// return;
// IEnumerable<FScheme.Value> values = dynSettings.Controller.DynamoModel.Nodes
// .Where(x => x.IsVisible).Where(x => x.OldValue != null)
// //.Where(x => x.OldValue is Value.Container || x.OldValue is Value.List)
// .Select(x => x.OldValue.Data as FScheme.Value);
// List<GeometryObject> geoms = values.ToList().SelectMany(RevitGeometryFromNodes).ToList();
// DrawToAlternateContext(geoms);
}
///// <summary>
///// Utility method to get the Revit geometry associated with nodes.
///// </summary>
///// <param name="value"></param>
///// <returns></returns>
//private static List<GeometryObject> RevitGeometryFromNodes(FScheme.Value value)
//{
// var geoms = new List<GeometryObject>();
// if (value == null)
// return geoms;
// if (value.IsList)
// {
// foreach (FScheme.Value valInner in ((FScheme.Value.List)value).Item)
// geoms.AddRange(RevitGeometryFromNodes(valInner));
// return geoms;
// }
// var container = value as FScheme.Value.Container;
// if (container == null)
// return geoms;
// var geom = ((FScheme.Value.Container)value).Item as GeometryObject;
// if (geom != null && !(geom is Face))
// geoms.Add(geom);
// var ps = ((FScheme.Value.Container)value).Item as ParticleSystem;
// if (ps != null)
// {
// geoms.AddRange(
// ps.Springs.Select(
// spring =>
// Line.CreateBound(
// spring.getOneEnd().getPosition(),
// spring.getTheOtherEnd().getPosition())));
// }
// var cl = ((FScheme.Value.Container)value).Item as CurveLoop;
// if (cl != null)
// geoms.AddRange(cl);
// //draw xyzs as Point objects
// var pt = ((FScheme.Value.Container)value).Item as XYZ;
// if (pt != null)
// {
// Type pointType = typeof(Point);
// MethodInfo[] pointTypeMethods = pointType.GetMethods(
// BindingFlags.Static | BindingFlags.Public);
// MethodInfo method = pointTypeMethods.FirstOrDefault(x => x.Name == "CreatePoint");
// if (method != null)
// {
// var args = new object[3];
// args[0] = pt.X;
// args[1] = pt.Y;
// args[2] = pt.Z;
// geoms.Add((Point)method.Invoke(null, args));
// }
// }
// return geoms;
//}
private void DrawToAlternateContext(List<GeometryObject> geoms)
{
Type geometryElementType = typeof(GeometryElement);
MethodInfo[] geometryElementTypeMethods =
geometryElementType.GetMethods(BindingFlags.Static | BindingFlags.Public);
MethodInfo method =
geometryElementTypeMethods.FirstOrDefault(x => x.Name == "SetForTransientDisplay");
if (method == null)
return;
var styles = new FilteredElementCollector(DocumentManager.Instance.CurrentUIDocument.Document);
styles.OfClass(typeof(GraphicsStyle));
Element gStyle = styles.ToElements().FirstOrDefault(x => x.Name == "Dynamo");
RevThread.IdlePromise.ExecuteOnIdleAsync(
() =>
{
TransactionManager.Instance.EnsureInTransaction(
DocumentManager.Instance.CurrentDBDocument);
if (keeperId != ElementId.InvalidElementId)
{
DocumentManager.Instance.CurrentUIDocument.Document.Delete(keeperId);
keeperId = ElementId.InvalidElementId;
}
var argsM = new object[4];
argsM[0] = DocumentManager.Instance.CurrentUIDocument.Document;
argsM[1] = ElementId.InvalidElementId;
argsM[2] = geoms;
if (gStyle != null)
argsM[3] = gStyle.Id;
else
argsM[3] = ElementId.InvalidElementId;
keeperId = (ElementId)method.Invoke(null, argsM);
TransactionManager.Instance.ForceCloseTransaction();
});
}
=======
>>>>>>> |
<<<<<<<
}).AddStackExchangeRedis(Configuration.GetConnectionString("Redis"), options =>
{
options.Configuration.ChannelPrefix = "ExilenceSignalR";
options.Configuration.ConnectTimeout = 10000;
=======
o.MaximumReceiveMessageSize = 50 * 1024 * 1024;
>>>>>>>
o.MaximumReceiveMessageSize = 50 * 1024 * 1024;
}).AddStackExchangeRedis(Configuration.GetConnectionString("Redis"), options =>
{
options.Configuration.ChannelPrefix = "ExilenceSignalR";
options.Configuration.ConnectTimeout = 10000; |
<<<<<<<
protected abstract string getInputRootName();
protected virtual int getNewInputIndex()
=======
public override void SetupCustomUIElements(dynNodeView nodeUI)
{
System.Windows.Controls.Button addButton = new dynNodeButton();
addButton.Content = "+";
addButton.Width = 20;
//addButton.Height = 20;
addButton.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
addButton.VerticalAlignment = System.Windows.VerticalAlignment.Center;
System.Windows.Controls.Button subButton = new dynNodeButton();
subButton.Content = "-";
subButton.Width = 20;
//subButton.Height = 20;
subButton.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
subButton.VerticalAlignment = System.Windows.VerticalAlignment.Top;
WrapPanel wp = new WrapPanel();
wp.VerticalAlignment = VerticalAlignment.Top;
wp.HorizontalAlignment = HorizontalAlignment.Center;
wp.Children.Add(addButton);
wp.Children.Add(subButton);
nodeUI.inputGrid.Children.Add(wp);
//nodeUI.inputGrid.ColumnDefinitions.Add(new ColumnDefinition());
//nodeUI.inputGrid.ColumnDefinitions.Add(new ColumnDefinition());
//nodeUI.inputGrid.Children.Add(addButton);
//System.Windows.Controls.Grid.SetColumn(addButton, 0);
//nodeUI.inputGrid.Children.Add(subButton);
//System.Windows.Controls.Grid.SetColumn(subButton, 1);
addButton.Click += delegate { AddInput(); RegisterAllPorts(); };
subButton.Click += delegate { RemoveInput(); RegisterAllPorts(); };
}
protected abstract string GetInputRootName();
protected abstract string GetTooltipRootName();
protected virtual int GetInputNameIndex()
>>>>>>>
protected abstract string GetInputRootName();
protected abstract string GetTooltipRootName();
protected virtual int GetInputNameIndex()
<<<<<<<
=======
public class dynTextBox : TextBox
{
public event Action OnChangeCommitted;
private static Brush clear = new SolidColorBrush(System.Windows.Media.Color.FromArgb(100, 255,255,255));
private static Brush highlighted = new SolidColorBrush(System.Windows.Media.Color.FromArgb(200, 255, 255, 255));
public dynTextBox()
{
//turn off the border
Background = clear;
BorderThickness = new Thickness(1);
GotFocus += OnGotFocus;
LostFocus += OnLostFocus;
LostKeyboardFocus += OnLostFocus;
}
private void OnLostFocus(object sender, RoutedEventArgs routedEventArgs)
{
Background = clear;
}
private void OnGotFocus(object sender, RoutedEventArgs routedEventArgs)
{
Background = highlighted;
}
private bool numeric;
public bool IsNumeric
{
get { return numeric; }
set
{
numeric = value;
if (value && Text.Length > 0)
{
Text = dynSettings.RemoveChars(
Text,
Text.ToCharArray()
.Where(c => !char.IsDigit(c) && c != '-' && c != '.')
.Select(c => c.ToString())
);
}
}
}
private bool pending;
public bool Pending
{
get { return pending; }
set
{
if (value)
{
FontStyle = FontStyles.Italic;
}
else
{
FontStyle = FontStyles.Normal;
}
pending = value;
}
}
public void Commit()
{
var expr = GetBindingExpression(TextProperty);
if (expr != null)
expr.UpdateSource();
if (OnChangeCommitted != null)
{
OnChangeCommitted();
}
Pending = false;
//dynSettings.Bench.mainGrid.Focus();
}
new public string Text
{
get { return base.Text; }
set
{
base.Text = value;
Commit();
}
}
private bool shouldCommit()
{
return !dynSettings.Controller.DynamoViewModel.DynamicRunEnabled;
}
protected override void OnTextChanged(TextChangedEventArgs e)
{
Pending = true;
if (IsNumeric)
{
var p = CaretIndex;
//base.Text = dynSettings.RemoveChars(
// Text,
// Text.ToCharArray()
// .Where(c => !char.IsDigit(c) && c != '-' && c != '.')
// .Select(c => c.ToString())
//);
CaretIndex = p;
}
}
protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Return || e.Key == Key.Enter)
{
dynSettings.ReturnFocusToSearch();
}
}
protected override void OnLostFocus(RoutedEventArgs e)
{
Commit();
}
}
public class dynStringTextBox : dynTextBox
{
public dynStringTextBox()
{
Commit();
Pending = false;
}
protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e)
{
//if (e.Key == Key.Return || e.Key == Key.Enter)
//{
// dynSettings.ReturnFocusToSearch();
//}
}
}
>>>>>>>
<<<<<<<
public partial class dynDoubleInput : dynDouble
=======
public class dynDoubleInput : dynNodeWithOneOutput
>>>>>>>
public partial class dynDoubleInput : dynNodeWithOneOutput
<<<<<<<
public override double Value
=======
public override void SetupCustomUIElements(dynNodeView nodeUI)
{
//add a text box to the input grid of the control
var tb = new dynTextBox
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Top,
IsNumeric = true,
Background = new SolidColorBrush(Color.FromArgb(0x88, 0xFF, 0xFF, 0xFF))
};
nodeUI.inputGrid.Children.Add(tb);
Grid.SetColumn(tb, 0);
Grid.SetRow(tb, 0);
tb.DataContext = this;
var bindingVal = new System.Windows.Data.Binding("Value")
{
Mode = BindingMode.TwoWay,
Converter = new DoubleInputDisplay(),
NotifyOnValidationError = false,
Source = this,
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
tb.SetBinding(TextBox.TextProperty, bindingVal);
tb.Text = Value ?? "0.0";
}
private List<IDoubleSequence> _parsed;
private string _value;
public string Value
>>>>>>>
private List<IDoubleSequence> _parsed;
private string _value;
public string Value
<<<<<<<
=======
#region Value Conversion
[ValueConversion(typeof(double), typeof(String))]
public class DoubleDisplay : IValueConverter
{
public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//source -> target
string val = ((double) value).ToString("0.000",CultureInfo.CurrentCulture);
Debug.WriteLine("Converting {0} -> {1}", value, val);
return value == null ? "" : val;
}
public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//target -> source
//return value.ToString();
double val = 0.0;
double.TryParse(value.ToString(), NumberStyles.Any, CultureInfo.CurrentCulture, out val);
Debug.WriteLine("Converting {0} -> {1}", value, val);
return val;
}
}
public class RadianToDegreesConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double radians = System.Convert.ToDouble(value, culture) * 180.0 / Math.PI;
return radians;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
double degrees = System.Convert.ToDouble(value, culture) * Math.PI / 180.0;
return degrees;
}
}
public class StringDisplay : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//source -> target
return value==null?"": HttpUtility.UrlDecode(value.ToString());
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//target -> source
return HttpUtility.UrlEncode(value.ToString());
}
}
public class FilePathDisplay : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//source->target
var maxChars = 30;
//var str = value.ToString();
var str = HttpUtility.UrlDecode(value.ToString());
if (string.IsNullOrEmpty(str))
{
return "No file selected.";
}
else if (str.Length > maxChars)
{
return str.Substring(0, 10 ) + "..." + str.Substring(str.Length - maxChars+10, maxChars-10);
}
return str;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//target->source
return HttpUtility.UrlEncode(value.ToString());
}
}
public class InverseBoolDisplay : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is bool)
{
return !(bool)value;
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is bool)
{
return !(bool)value;
}
return value;
}
}
#endregion
>>>>>>> |
<<<<<<<
using System.Windows.Documents;
=======
using Dynamo.Controls;
>>>>>>>
using System.Windows.Documents;
using Dynamo.Controls; |
<<<<<<<
public abstract partial class VariableInput
=======
public abstract partial class Enum : NodeWithOneOutput
{
public override void SetupCustomUIElements(object ui)
{
var nodeUI = ui as dynNodeView;
var comboBox = new ComboBox
{
MinWidth = 150,
Padding = new Thickness(8),
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Center
};
nodeUI.inputGrid.Children.Add(comboBox);
Grid.SetColumn(comboBox, 0);
Grid.SetRow(comboBox, 0);
comboBox.ItemsSource = this.Items;
comboBox.SelectedIndex = this.SelectedIndex;
comboBox.SelectionChanged += delegate
{
if (comboBox.SelectedIndex == -1) return;
this.RequiresRecalc = true;
this.SelectedIndex = comboBox.SelectedIndex;
};
}
}
public abstract partial class VariableInput : NodeWithOneOutput
>>>>>>>
public abstract partial class Enum
{
public void SetupCustomUIElements(object ui)
{
var nodeUI = ui as dynNodeView;
var comboBox = new ComboBox
{
MinWidth = 150,
Padding = new Thickness(8),
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Center
};
nodeUI.inputGrid.Children.Add(comboBox);
Grid.SetColumn(comboBox, 0);
Grid.SetRow(comboBox, 0);
comboBox.ItemsSource = this.Items;
comboBox.SelectedIndex = this.SelectedIndex;
comboBox.SelectionChanged += delegate
{
if (comboBox.SelectedIndex == -1) return;
this.RequiresRecalc = true;
this.SelectedIndex = comboBox.SelectedIndex;
};
}
}
public abstract partial class VariableInput |
<<<<<<<
using System.Runtime.Remoting.Messaging;
=======
>>>>>>>
<<<<<<<
using Microsoft.Practices.Prism;
=======
>>>>>>>
using Microsoft.Practices.Prism; |
<<<<<<<
using System.Collections.Generic;
=======
using Dynamo.Wpf.Extensions;
using Dynamo.Interfaces;
using Dynamo.Wpf.Views.PackageManager;
>>>>>>>
using System.Collections.Generic;
using Dynamo.Wpf.Extensions;
using Dynamo.Interfaces;
using Dynamo.Wpf.Views.PackageManager; |
<<<<<<<
=======
using System.Collections.ObjectModel;
using Dynamo.UI.Commands;
using System.Windows.Data;
using Dynamo.UI.Controls;
using System.Windows.Media;
>>>>>>>
using System.Collections.ObjectModel;
using Dynamo.UI.Commands;
using System.Windows.Data;
using Dynamo.UI.Controls;
using System.Windows.Media;
<<<<<<<
_searchPkgsView.Focus();
_pkgSearchVM.RefreshAndSearchAsync();
=======
_searchPkgsView.Focus();
>>>>>>>
_searchPkgsView.Focus();
_pkgSearchVM.RefreshAndSearchAsync(); |
<<<<<<<
=======
>>>>>>>
<<<<<<<
argumentList.Add(procNode.argInfoList[i].Name,
procNode.argTypeList[i].ToString().Split('.').Last());
=======
argumentList.Add(procNode.argInfoList[i].Name,
procNode.argTypeList[i].ToString().Split('.').Last());
>>>>>>>
argumentList.Add(procNode.argInfoList[i].Name,
procNode.argTypeList[i].ToString().Split('.').Last());
<<<<<<<
=======
>>>>>>>
<<<<<<<
// TODO: Dropping access specifier and static from function signature
// until it is required to be displayed to users later
//Func<Compiler.AccessSpecifier, string> func =
// (x) =>
// {
// switch (x)
// {
// case Compiler.AccessSpecifier.kPrivate:
// return "private ";
// case Compiler.AccessSpecifier.kProtected:
// return "protected ";
// case Compiler.AccessSpecifier.kPublic:
// return "public ";
// default:
// return string.Empty;
// }
// };
//var access = func(procNode.access);
//var isStatic = this.IsStatic == true ? "static " : "";
var returnType = this.IsConstructor ==
true ? "" : " : " + this.ReturnType.ToString().Split('.').Last();
=======
// TODO: Dropping access specifier and static from function signature
// until it is required to be displayed to users later
//Func<Compiler.AccessSpecifier, string> func =
// (x) =>
// {
// switch (x)
// {
// case Compiler.AccessSpecifier.kPrivate:
// return "private ";
// case Compiler.AccessSpecifier.kProtected:
// return "protected ";
// case Compiler.AccessSpecifier.kPublic:
// return "public ";
// default:
// return string.Empty;
// }
// };
//var access = func(procNode.access);
//var isStatic = this.IsStatic == true ? "static " : "";
var returnType = string.Empty;
if (!this.IsConstructor)
returnType = " : " + this.ReturnType.ToString().Split('.').Last();
>>>>>>>
// TODO: Dropping access specifier and static from function signature
// until it is required to be displayed to users later
//Func<Compiler.AccessSpecifier, string> func =
// (x) =>
// {
// switch (x)
// {
// case Compiler.AccessSpecifier.kPrivate:
// return "private ";
// case Compiler.AccessSpecifier.kProtected:
// return "protected ";
// case Compiler.AccessSpecifier.kPublic:
// return "public ";
// default:
// return string.Empty;
// }
// };
//var access = func(procNode.access);
//var isStatic = this.IsStatic == true ? "static " : "";
var returnType = string.Empty;
if (!this.IsConstructor)
returnType = " : " + this.ReturnType.ToString().Split('.').Last();
<<<<<<<
sb.AppendLine(methodName + returnType + " (" + string.Join(", ", argList.Select(p => p.ToString())) + ')');
=======
sb.AppendLine(methodName + returnType + " (" +
string.Join(", ", argList.Select(p => p.ToString())) + ')');
>>>>>>>
sb.AppendLine(methodName + returnType + " (" +
string.Join(", ", argList.Select(p => p.ToString())) + ')'); |
<<<<<<<
long amount = svEnd.ToInteger().IntegerValue;
=======
int amount = (int)svEnd.ToInteger().opdata;
>>>>>>>
long amount = svEnd.ToInteger().IntegerValue;
<<<<<<<
decimal stepnum = new decimal(Math.Round(svStep.IsDouble ? svStep.DoubleValue: svStep.IntegerValue));
if (stepnum > 0)
=======
decimal stepnum = new decimal(Math.Round(svStep.IsDouble ? svStep.RawDoubleValue : svStep.RawIntValue));
if (stepnum <= 0)
>>>>>>>
decimal stepnum = new decimal(Math.Round(svStep.IsDouble ? svStep.DoubleValue: svStep.IntegerValue));
if (stepnum <= 0)
<<<<<<<
decimal astepsize = new decimal(svStep.IsDouble ? svStep.DoubleValue: svStep.IntegerValue);
if (astepsize != 0)
=======
decimal astepsize = new decimal(svStep.IsDouble ? svStep.RawDoubleValue : svStep.RawIntValue);
if (astepsize == 0)
{
return null;
}
decimal dist = end - start;
decimal stepnum = 1;
if (dist != 0)
>>>>>>>
decimal astepsize = new decimal(svStep.IsDouble ? svStep.DoubleValue : svStep.IntegerValue);
if (astepsize == 0)
{
return null;
}
decimal dist = end - start;
decimal stepnum = 1;
if (dist != 0) |
<<<<<<<
=======
public static NodeModel FindNodeWithDrawable(object drawable)
{
return
GetDrawableNodesInModel()
.FirstOrDefault(
x =>
GetDrawableFromValue(new List<int>(), x.OldValue.Data as FScheme.Value)
.ContainsValue(drawable));
}
>>>>>>> |
<<<<<<<
throw new Exception(String.Format(Properties.Resources.MalformedHeaderPackage, headerPath));
=======
throw new Exception(
headerPath + " contains a package with a malformed header. Ignoring it.");
>>>>>>>
throw new Exception(String.Format(Properties.Resources.MalformedHeaderPackage, headerPath));
<<<<<<<
{
throw new Exception(String.Format(Properties.Resources.NoHeaderPackage,headerPath));
}
=======
throw new Exception(headerPath + " contains a package without a header. Ignoring it.");
>>>>>>>
throw new Exception(String.Format(Properties.Resources.NoHeaderPackage, headerPath));
<<<<<<<
else
{
throw new Exception(String.Format(Properties.Resources.DulicatedPackage, discoveredPkg.Name, discoveredPkg.RootDirectory));
}
=======
throw new Exception("A duplicate of the package called " + discoveredPkg.Name +
" was found at " + discoveredPkg.RootDirectory + ". Ignoring it.");
>>>>>>>
throw new Exception(String.Format(Properties.Resources.DulicatedPackage, discoveredPkg.Name, discoveredPkg.RootDirectory));
<<<<<<<
this.logger.Log(String.Format(Properties.Resources.ExceptionEncountered, this.RootPackagesDirectory));
this.logger.Log(e.GetType() + ": " + e.Message);
=======
Log("Exception encountered scanning the package directory at " + RootPackagesDirectory, WarningLevel.Error);
Log(e);
>>>>>>>
Log(String.Format(Properties.Resources.ExceptionEncountered, this.RootPackagesDirectory), WarningLevel.Error);
Log(e);
<<<<<<<
this.logger.Log(String.Format(/*NXLT*/"Successfully uninstalled package from \"{0}\"", pkgNameDirTup));
=======
Log(String.Format("Successfully uninstalled package from \"{0}\"", pkgNameDirTup));
>>>>>>>
Log(String.Format(/*NXLT*/"Successfully uninstalled package from \"{0}\"", pkgNameDirTup));
<<<<<<<
this.logger.LogWarning(
String.Format(/*NXLT*/"Failed to delete package directory at \"{0}\", you may need to delete the directory manually.",
pkgNameDirTup), WarningLevel.Moderate);
=======
Log(
String.Format(
"Failed to delete package directory at \"{0}\", you may need to delete the directory manually.",
pkgNameDirTup),
WarningLevel.Moderate);
>>>>>>>
Log(
String.Format(
/*NXLT*/"Failed to delete package directory at \"{0}\", you may need to delete the directory manually.",
pkgNameDirTup),
WarningLevel.Moderate); |
<<<<<<<
var eid = element.InnerText;
try
{
runElements.Add(dynRevitSettings.Doc.Document.GetElement(eid).Id);
}
catch (NullReferenceException)
{
DynamoLogger.Instance.Log("Element with UID \"" + eid + "\" not found in Document.");
}
=======
dynSettings.Controller.DynamoViewModel.Log("Element with UID \"" + eid + "\" not found in Document.");
>>>>>>>
DynamoLogger.Instance.Log("Element with UID \"" + eid + "\" not found in Document."); |
<<<<<<<
node.NickName = LibraryServices.Instance.NicknameFromFunctionSignatureHint(signature);
=======
var libraryServices = dynamoModel.EngineController.LibraryServices;
node.NickName = libraryServices.NicknameFromFunctionSignatureHint(signature);
>>>>>>>
var libraryServices = dynamoModel.EngineController.LibraryServices;
node.NickName = libraryServices.NicknameFromFunctionSignatureHint(signature);
<<<<<<<
=======
return (T) typeof(T).GetInstance(this.workspaceModel);
>>>>>>>
<<<<<<<
// To open old file
var helper =
nodeElement.ChildNodes.Cast<XmlElement>()
.Where(
subNode => subNode.Name.Equals(typeof(FunctionDescriptor).FullName))
.Select(subNode => new XmlElementHelper(subNode))
.FirstOrDefault();
if (helper != null)
{
assembly = helper.ReadString("Assembly", "");
}
function = nodeElement.Attributes["nickname"].Value.Replace(".get", ".");
=======
return (NodeModel) type.GetInstance(this.workspaceModel);
>>>>>>>
// To open old file
var helper =
nodeElement.ChildNodes.Cast<XmlElement>()
.Where(
subNode => subNode.Name.Equals(typeof(FunctionDescriptor).FullName))
.Select(subNode => new XmlElementHelper(subNode))
.FirstOrDefault();
if (helper != null)
{
assembly = helper.ReadString("Assembly", "");
}
function = nodeElement.Attributes["nickname"].Value.Replace(".get", "."); |
<<<<<<<
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using Dynamo.Models;
using Dynamo.Nodes;
using Dynamo.Nodes.Search;
=======
>>>>>>>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using Dynamo.Models;
using Dynamo.Nodes; |
<<<<<<<
=======
using Dynamo.Core.Threading;
>>>>>>>
using Dynamo.Core.Threading; |
<<<<<<<
=======
public PointGeometry3D Points { get; set; }
public LineGeometry3D Lines { get; set; }
public LineGeometry3D LinesSelected { get; set; }
public MeshGeometry3D DynamoMesh { get; set; }
public MeshGeometry3D Mesh { get; set; }
>>>>>>>
<<<<<<<
#endif
=======
#endif
Points = null;
Lines = null;
LinesSelected = null;
DynamoMesh = null;
Mesh = null;
>>>>>>>
#endif
<<<<<<<
=======
var points = HelixRenderPackage.InitPointGeometry();
var lines = HelixRenderPackage.InitLineGeometry();
var linesSel = HelixRenderPackage.InitLineGeometry();
var dynamoMesh = HelixRenderPackage.InitMeshGeometry();
var mesh = HelixRenderPackage.InitMeshGeometry();
>>>>>>>
<<<<<<<
Packages = packages,
=======
Packages = packages,
Points = points,
Lines = lines,
SelectedLines = linesSel,
DynamoMesh = dynamoMesh,
Mesh = mesh,
>>>>>>>
Packages = packages,
<<<<<<<
=======
if (!points.Positions.Any())
points = null;
if (!lines.Positions.Any())
lines = null;
if (!linesSel.Positions.Any())
linesSel = null;
if (!text.TextInfo.Any())
text = null;
if (!dynamoMesh.Positions.Any())
dynamoMesh = null;
if (!mesh.Positions.Any())
mesh = null;
>>>>>>>
<<<<<<<
//View.InvalidateRender();
NotifyPropertyChanged("");
=======
var updateGraphicsParams = new GraphicsUpdateParams
{
Points = points,
Lines = lines,
SelectedLines = linesSel,
DynamoMesh = dynamoMesh,
Mesh = mesh,
Text = text
};
SendGraphicsToView(updateGraphicsParams);
//DrawTestMesh();
>>>>>>>
//View.InvalidateRender();
NotifyPropertyChanged("");
<<<<<<<
MeshCount = 0;
//Clear the geometry values before adding the package.
VisualizationManager_InitializeGeomtery();
=======
MeshCount = 0;
>>>>>>>
MeshCount = 0;
//Clear the geometry values before adding the package.
VisualizationManager_InitializeGeomtery();
<<<<<<<
var meshSet = meshGeometry3D.Geometry as MeshGeometry3D;
var idxCount = meshSet.Positions.Count;
=======
private void SendGraphicsToView(GraphicsUpdateParams parameters)
{
Points = parameters.Points;
Lines = parameters.Lines;
LinesSelected = parameters.SelectedLines;
DynamoMesh = parameters.DynamoMesh;
Mesh = parameters.Mesh;
Text = parameters.Text;
>>>>>>>
var meshSet = meshGeometry3D.Geometry as MeshGeometry3D;
var idxCount = meshSet.Positions.Count;
<<<<<<<
#endregion
=======
}
internal class GraphicsUpdateParams
{
public PointGeometry3D Points { get; set; }
public LineGeometry3D Lines { get; set; }
public LineGeometry3D SelectedLines { get; set; }
public MeshGeometry3D DynamoMesh { get; set; }
public MeshGeometry3D Mesh { get; set; }
public BillboardText3D Text { get; set; }
>>>>>>>
#endregion
<<<<<<<
=======
public PointGeometry3D Points { get; set; }
public LineGeometry3D Lines { get; set; }
public LineGeometry3D SelectedLines { get; set; }
public MeshGeometry3D DynamoMesh { get; set; }
public MeshGeometry3D Mesh { get; set; }
>>>>>>> |
<<<<<<<
using Dynamo.UI;
using DSCoreNodesUI.Properties;
=======
>>>>>>>
using DSCoreNodesUI.Properties;
<<<<<<<
[NodeName(/*NXLT*/"Watch Image")]
[NodeDescription(/*NXLT*/"WatchImageDescription", typeof(Resources))]
=======
[NodeName("Watch Image")]
[NodeDescription("Previews an image")]
>>>>>>>
[NodeName(/*NXLT*/"Watch Image")]
[NodeDescription(/*NXLT*/"WatchImageDescription", typeof(Resources))] |
<<<<<<<
=======
/// <summary>
/// Called back from the view to enable users to setup their own view elements
/// </summary>
/// <param name="view"></param>
internal void InitializeUI(dynamic view)
{
//Runtime dispatch
(this as dynamic).SetupCustomUIElements(view);
}
/// <summary>
/// Used as a catch-all if runtime dispatch for UI initialization is unimplemented.
/// </summary>
// ReSharper disable once UnusedMember.Local
// ReSharper disable once UnusedParameter.Local
private void SetupCustomUIElements(object view) { }
/// <summary>
/// As hacky as the name sounds, this method is used to retrieve the
/// "DynamoViewModel" from a given "MenuItem" object. The reason it is
/// needed boils down to the fact that we still do "SetupCustomUIElements"
/// at the "NodeModel" level. This method will be removed when we
/// eventually refactor "SetupCustomUIElements" out into view layer.
/// </summary>
/// <param name="menuItem">The MenuItem from which DynamoViewModel is to
/// be retrieved.</param>
/// <returns>Returns the corresponding DynamoViewModel retrieved from the
/// given MenuItem.</returns>
///
protected DynamoViewModel GetDynamoViewModelFromMenuItem(MenuItem menuItem)
{
if (menuItem == null || (menuItem.Tag == null))
throw new ArgumentNullException("menuItem");
var dynamoViewModel = menuItem.Tag as DynamoViewModel;
if (dynamoViewModel == null)
{
const string message = "MenuItem.Tag is not DynamoViewModel";
throw new ArgumentException(message);
}
return dynamoViewModel;
}
>>>>>>> |
<<<<<<<
dynamoModel.Logger.Log(/*NXLT*/"Error in Node. Not sent for building and compiling");
=======
Log("Error in Node. Not sent for building and compiling");
>>>>>>>
Log(/*NXLT*/"Error in Node. Not sent for building and compiling");
<<<<<<<
string rtnName = /*NXLT*/"__temp_rtn_" + def.FunctionId.ToString().Replace("-", String.Empty);
=======
string rtnName = "__temp_rtn_" + functionId.ToString().Replace("-", String.Empty);
>>>>>>>
string rtnName = /*NXLT*/"__temp_rtn_" + functionId.ToString().Replace("-", String.Empty); |
<<<<<<<
using Dynamo.Wpf;
using Dynamo.Wpf.Properties;
=======
>>>>>>>
using Dynamo.Wpf;
using Dynamo.Wpf.Properties; |
<<<<<<<
using DynCmd = Dynamo.ViewModels.DynamoViewModel;
=======
using Dynamo.Core;
>>>>>>>
using Dynamo.Core;
using DynCmd = Dynamo.ViewModels.DynamoViewModel; |
<<<<<<<
var searchElementVM = senderButton.DataContext as NodeSearchElementViewModel;
if (searchElementVM != null)
dragDropHelper.HandleMouseMove(senderButton, e.GetPosition(null));
=======
var searchElementVM = senderButton.DataContext as NodeSearchElementViewModel;
if (searchElementVM != null)
dragDropHelper.HandleMouseDown(e.GetPosition(null), searchElementVM);
else
dragDropHelper.Clear();
>>>>>>>
var searchElementVM = senderButton.DataContext as NodeSearchElementViewModel;
if (searchElementVM != null)
dragDropHelper.HandleMouseMove(senderButton, e.GetPosition(null));
else
dragDropHelper.Clear(); |
<<<<<<<
using Unity.MLAgents.Inference;
using Unity.MLAgents.Policies;
using Unity.Barracuda;
=======
using Unity.Barracuda;
using MLAgents.Inference;
using MLAgents.Policies;
>>>>>>>
using Unity.Barracuda;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Policies; |
<<<<<<<
=======
protected override AssociativeNode BuildAstNode(IAstBuilder builder, List<AssociativeNode> inputs)
{
return builder.Build(this, inputs);
}
public override Value Evaluate(FSharpList<Value> args)
{
var keyMapper = ((Value.Function) args[0]).Item;
var list = ((Value.List) args[1]).Item;
Value min = null;
IComparable minMapped = null;
foreach (var item in list)
{
var mapped = SortBy.ToComparable(keyMapper.Invoke(Utils.MakeFSharpList(item)));
if (min == null)
{
min = item;
minMapped = mapped;
}
else
{
var comparison = minMapped.CompareTo(mapped);
if (comparison > 0)
{
min = item;
minMapped = mapped;
}
}
}
if (min == null)
throw new Exception("Cannot take minimum value of an empty list.");
return min;
}
>>>>>>>
public override Value Evaluate(FSharpList<Value> args)
{
var keyMapper = ((Value.Function) args[0]).Item;
var list = ((Value.List) args[1]).Item;
Value min = null;
IComparable minMapped = null;
foreach (var item in list)
{
var mapped = SortBy.ToComparable(keyMapper.Invoke(Utils.MakeFSharpList(item)));
if (min == null)
{
min = item;
minMapped = mapped;
}
else
{
var comparison = minMapped.CompareTo(mapped);
if (comparison > 0)
{
min = item;
minMapped = mapped;
}
}
}
if (min == null)
throw new Exception("Cannot take minimum value of an empty list.");
return min;
}
<<<<<<<
=======
protected override AssociativeNode BuildAstNode(IAstBuilder builder, List<AssociativeNode> inputs)
{
return builder.Build(this, inputs);
}
public override Value Evaluate(FSharpList<Value> args)
{
var keyMapper = ((Value.Function)args[0]).Item;
var list = ((Value.List)args[1]).Item;
Value max = null;
IComparable maxMapped = null;
foreach (var item in list)
{
var mapped = SortBy.ToComparable(keyMapper.Invoke(Utils.MakeFSharpList(item)));
if (max == null)
{
max = item;
maxMapped = mapped;
}
else
{
var comparison = maxMapped.CompareTo(mapped);
if (comparison < 0)
{
max = item;
maxMapped = mapped;
}
}
}
if (max == null)
throw new Exception("Cannot take maximum value of an empty list.");
return max;
}
>>>>>>>
public override Value Evaluate(FSharpList<Value> args)
{
var keyMapper = ((Value.Function)args[0]).Item;
var list = ((Value.List)args[1]).Item;
Value max = null;
IComparable maxMapped = null;
foreach (var item in list)
{
var mapped = SortBy.ToComparable(keyMapper.Invoke(Utils.MakeFSharpList(item)));
if (max == null)
{
max = item;
maxMapped = mapped;
}
else
{
var comparison = maxMapped.CompareTo(mapped);
if (comparison < 0)
{
max = item;
maxMapped = mapped;
}
}
}
if (max == null)
throw new Exception("Cannot take maximum value of an empty list.");
return max;
} |
<<<<<<<
[TestFixture]
class FormulaTests : DSEvaluationViewModelUnitTest
=======
public class FormulaTests : DSEvaluationUnitTest
>>>>>>>
class FormulaTests : DSEvaluationViewModelUnitTest |
<<<<<<<
[TestFixture]
public class HigherOrder : DSEvaluationViewModelUnitTest
=======
public class HigherOrder : DSEvaluationUnitTest
>>>>>>>
public class HigherOrder : DSEvaluationViewModelUnitTest |
<<<<<<<
using Dynamo.Search.SearchElements;
using System.Collections.Generic;
=======
using System.Windows.Media.Imaging;
>>>>>>>
using Dynamo.Search.SearchElements;
using System.Collections.Generic;
using System.Windows.Media.Imaging;
<<<<<<<
private void LibraryItem_OnMouseEnter(object sender, MouseEventArgs e)
{
TreeViewItem treeViewItem = sender as TreeViewItem;
NodeSearchElement nodeSearchElement = treeViewItem.Header as NodeSearchElement;
if (nodeSearchElement == null)
return;
Point pointToScreen_TopLeft = treeViewItem.PointToScreen(new Point(0, 0));
Point topLeft = this.PointFromScreen(pointToScreen_TopLeft);
Point pointToScreen_BotRight = new Point(pointToScreen_TopLeft.X + treeViewItem.ActualWidth, pointToScreen_TopLeft.Y + treeViewItem.ActualHeight);
Point botRight = this.PointFromScreen(pointToScreen_BotRight);
string infoBubbleContent = nodeSearchElement.Name + "\n" + nodeSearchElement.Description;
InfoBubbleDataPacket data = new InfoBubbleDataPacket(InfoBubbleViewModel.Style.LibraryItemPreview, topLeft, botRight, infoBubbleContent, InfoBubbleViewModel.Direction.Left, Guid.Empty);
DynamoCommands.ShowLibItemInfoBubbleCommand.Execute(data);
}
private void LibraryItem_OnMouseLeave(object sender, MouseEventArgs e)
{
TreeViewItem treeViewItem = sender as TreeViewItem;
NodeSearchElement nodeSearchElement = treeViewItem.Header as NodeSearchElement;
if (nodeSearchElement == null)
return;
DynamoCommands.HideLibItemInfoBubbleCommand.Execute(null);
}
=======
private void OnLibraryClick(object sender, RoutedEventArgs e)
{
//this.Width = 5;
//if (this.Visibility == Visibility.Collapsed)
// this.Visibility = Visibility.Visible;
//else
//{
// dynSettings.Controller.DynamoViewModel.OnSidebarClosed(this, EventArgs.Empty);
// this.Visibility = Visibility.Collapsed;
//}
dynSettings.Controller.DynamoViewModel.OnSidebarClosed(this, EventArgs.Empty);
}
private void Button_MouseEnter(object sender, MouseEventArgs e)
{
Grid g = (Grid)sender;
Label lb = (Label)(g.Children[0]);
var bc = new BrushConverter();
lb.Foreground = (Brush)bc.ConvertFromString("#cccccc");
Image collapsestate = (Image)g.Children[1];
var collapsestateSource = new Uri(@"pack://application:,,,/DynamoCore;component/UI/Images/collapsestate_hover.png");
BitmapImage bmi = new BitmapImage(collapsestateSource);
RotateTransform rotateTransform = new RotateTransform(-90, 16, 16);
collapsestate.Source = new BitmapImage(collapsestateSource);
}
private void buttonGrid_MouseLeave(object sender, MouseEventArgs e)
{
Grid g = (Grid)sender;
Label lb = (Label)(g.Children[0]);
var bc = new BrushConverter();
lb.Foreground = (Brush)bc.ConvertFromString("#aaaaaa");
Image collapsestate = (Image)g.Children[1];
var collapsestateSource = new Uri(@"pack://application:,,,/DynamoCore;component/UI/Images/collapsestate_normal.png");
collapsestate.Source = new BitmapImage(collapsestateSource);
}
>>>>>>>
private void OnLibraryClick(object sender, RoutedEventArgs e)
{
//this.Width = 5;
//if (this.Visibility == Visibility.Collapsed)
// this.Visibility = Visibility.Visible;
//else
//{
// dynSettings.Controller.DynamoViewModel.OnSidebarClosed(this, EventArgs.Empty);
// this.Visibility = Visibility.Collapsed;
//}
dynSettings.Controller.DynamoViewModel.OnSidebarClosed(this, EventArgs.Empty);
}
private void Button_MouseEnter(object sender, MouseEventArgs e)
{
Grid g = (Grid)sender;
Label lb = (Label)(g.Children[0]);
var bc = new BrushConverter();
lb.Foreground = (Brush)bc.ConvertFromString("#cccccc");
Image collapsestate = (Image)g.Children[1];
var collapsestateSource = new Uri(@"pack://application:,,,/DynamoCore;component/UI/Images/collapsestate_hover.png");
BitmapImage bmi = new BitmapImage(collapsestateSource);
RotateTransform rotateTransform = new RotateTransform(-90, 16, 16);
collapsestate.Source = new BitmapImage(collapsestateSource);
}
private void buttonGrid_MouseLeave(object sender, MouseEventArgs e)
{
Grid g = (Grid)sender;
Label lb = (Label)(g.Children[0]);
var bc = new BrushConverter();
lb.Foreground = (Brush)bc.ConvertFromString("#aaaaaa");
Image collapsestate = (Image)g.Children[1];
var collapsestateSource = new Uri(@"pack://application:,,,/DynamoCore;component/UI/Images/collapsestate_normal.png");
collapsestate.Source = new BitmapImage(collapsestateSource);
}
private void LibraryItem_OnMouseEnter(object sender, MouseEventArgs e)
{
TreeViewItem treeViewItem = sender as TreeViewItem;
NodeSearchElement nodeSearchElement = treeViewItem.Header as NodeSearchElement;
if (nodeSearchElement == null)
return;
Point pointToScreen_TopLeft = treeViewItem.PointToScreen(new Point(0, 0));
Point topLeft = this.PointFromScreen(pointToScreen_TopLeft);
Point pointToScreen_BotRight = new Point(pointToScreen_TopLeft.X + treeViewItem.ActualWidth, pointToScreen_TopLeft.Y + treeViewItem.ActualHeight);
Point botRight = this.PointFromScreen(pointToScreen_BotRight);
string infoBubbleContent = nodeSearchElement.Name + "\n" + nodeSearchElement.Description;
InfoBubbleDataPacket data = new InfoBubbleDataPacket(InfoBubbleViewModel.Style.LibraryItemPreview, topLeft, botRight, infoBubbleContent, InfoBubbleViewModel.Direction.Left, Guid.Empty);
DynamoCommands.ShowLibItemInfoBubbleCommand.Execute(data);
}
private void LibraryItem_OnMouseLeave(object sender, MouseEventArgs e)
{
TreeViewItem treeViewItem = sender as TreeViewItem;
NodeSearchElement nodeSearchElement = treeViewItem.Header as NodeSearchElement;
if (nodeSearchElement == null)
return;
DynamoCommands.HideLibItemInfoBubbleCommand.Execute(null);
} |
<<<<<<<
private bool graphExecuted;
public bool DynamicRunEnabled;
public readonly bool VerboseLogging;
=======
/// <summary>
/// Before the Workspace has been built the first time, we do not respond to
/// NodeModification events.
/// </summary>
private bool silenceNodeModifications = true;
public RunSettings RunSettings { get; protected set; }
>>>>>>>
private bool graphExecuted;
public bool DynamicRunEnabled;
public readonly bool VerboseLogging;
/// <summary>
/// Before the Workspace has been built the first time, we do not respond to
/// NodeModification events.
/// </summary>
private bool silenceNodeModifications = true;
public RunSettings RunSettings { get; protected set; }
<<<<<<<
RunEnabled = true;
#if DEBUG
DynamicRunEnabled = true;
#else
DynamicRunEnabled = false;
#endif
=======
RunSettings = new RunSettings(info.RunType, info.RunPeriod);
>>>>>>>
RunSettings = new RunSettings(info.RunType, info.RunPeriod);
<<<<<<<
protected override void ResetWorkspaceCore()
{
base.ResetWorkspaceCore();
// Reset Run Automatic option to false on resetting the workspace
#if DEBUG
DynamicRunEnabled = true;
#else
DynamicRunEnabled = false;
#endif
}
=======
>>>>>>>
<<<<<<<
graphExecuted = true;
=======
// When Dynamo is shut down, the workspace is cleared, which results
// in Modified() being called. But, we don't want to run when we are
// shutting down so we check whether an engine controller is available.
if (this.EngineController == null)
{
return;
}
>>>>>>>
graphExecuted = true;
// When Dynamo is shut down, the workspace is cleared, which results
// in Modified() being called. But, we don't want to run when we are
// shutting down so we check whether an engine controller is available.
if (this.EngineController == null)
{
return;
} |
<<<<<<<
public class ReferencePoint : AbstractGeometry, IGraphicItem
=======
[ShortName("refPt")]
public class ReferencePoint : AbstractGeometry
>>>>>>>
[ShortName("refPt")]
public class ReferencePoint : AbstractGeometry, IGraphicItem |
<<<<<<<
if (DynamoController.IsTestMode) // Do not want logging in unit tests.
return false;
if (dynSettings.Controller != null)
return dynSettings.Controller.PreferenceSettings.IsUsageReportingApproved;
else
return false;
=======
return !DynamoController.IsTestMode
&& dynSettings.Controller.PreferenceSettings.IsUsageReportingApproved;
>>>>>>>
if (DynamoController.IsTestMode) // Do not want logging in unit tests.
return false;
if (dynSettings.Controller != null)
return dynSettings.Controller.PreferenceSettings.IsUsageReportingApproved;
return false; |
<<<<<<<
var elementResolver = model.CurrentWorkspace.ElementResolver;
cbn.SetCodeContent("Point.ByCoordinates(a<1>,a<1>,a<1>);", elementResolver);
=======
cbn.SetCodeContent("Point.ByCoordinates(a<1>,a<1>,a<1>);");
var ws = ViewModel.Model.CurrentWorkspace as HomeWorkspaceModel;
ws.RunSettings.RunType = RunType.Automatic;
>>>>>>>
var elementResolver = model.CurrentWorkspace.ElementResolver;
cbn.SetCodeContent("Point.ByCoordinates(a<1>,a<1>,a<1>);", elementResolver);
var ws = ViewModel.Model.CurrentWorkspace as HomeWorkspaceModel;
ws.RunSettings.RunType = RunType.Automatic; |
<<<<<<<
if (result.IsString && (result as FScheme.Value.String).Item == _failureString)
=======
if (result.IsString && (result as Value.String).Item == FailureString)
>>>>>>>
if (result.IsString && (result as FScheme.Value.String).Item == FailureString)
<<<<<<<
private delegate FSharpOption<FScheme.Value> innerEvaluationDelegate();
public Dictionary<PortData, FScheme.Value> evaluationDict = new Dictionary<PortData, FScheme.Value>();
=======
private delegate FSharpOption<Value> InnerEvaluationDelegate();
>>>>>>>
private delegate FSharpOption<FScheme.Value> InnerEvaluationDelegate();
<<<<<<<
? evaluationDict[OutPortData[0]]
: FScheme.Value.NewList(
=======
? evalDict[OutPortData[0]]
: Value.NewList(
>>>>>>>
? evalDict[OutPortData[0]]
: Value.NewList(
<<<<<<<
else
{
if (result.Value != null)
return result.Value;
else
return FScheme.Value.NewString(_failureString);
}
=======
return result.Value ?? Value.NewString(FailureString);
>>>>>>>
return result.Value ?? Value.NewString(FailureString);
<<<<<<<
protected internal virtual void __eval_internal(FSharpList<FScheme.Value> args, Dictionary<PortData, FScheme.Value> outPuts)
=======
protected virtual void __eval_internal(FSharpList<Value> args, Dictionary<PortData, Value> outPuts)
>>>>>>>
protected virtual void __eval_internal(FSharpList<FScheme.Value> args, Dictionary<PortData, FScheme.Value> outPuts)
<<<<<<<
public abstract class dynNodeWithMultipleOutputs : dynNodeModel
{
/// <summary>
/// Implementation detail, records how many times this Element has been executed during this run.
/// </summary>
protected int runCount = 0;
public override void Evaluate(FSharpList<FScheme.Value> args, Dictionary<PortData, FScheme.Value> outPuts)
{
//if this element maintains a collcection of references
//then clear the collection
if (this is IClearable)
(this as IClearable).ClearReferences();
List<FSharpList<FScheme.Value>> argSets = new List<FSharpList<FScheme.Value>>();
//create a zip of the incoming args and the port data
//to be used for type comparison
var portComparison = args.Zip(InPortData, (first, second) => new Tuple<Type, Type>(first.GetType(), second.PortType));
var listOfListComparison = args.Zip(InPortData, (first, second) => new Tuple<bool, Type>(Utils.IsListOfLists(first), second.PortType));
//there are more than zero arguments
//and there is either an argument which does not match its expections
//OR an argument which requires a list and gets a list of lists
//AND argument lacing is not disabled
if (args.Count() > 0 &&
(portComparison.Any(x => x.Item1 == typeof(FScheme.Value.List) && x.Item2 != typeof(FScheme.Value.List)) ||
listOfListComparison.Any(x => x.Item1 == true && x.Item2 == typeof(FScheme.Value.List))) &&
this.ArgumentLacing != LacingStrategy.Disabled)
{
//if the argument is of the expected type, then
//leave it alone otherwise, wrap it in a list
int j = 0;
foreach (var arg in args)
{
//incoming value is list and expecting single
if (portComparison.ElementAt(j).Item1 == typeof(FScheme.Value.List) &&
portComparison.ElementAt(j).Item2 != typeof(FScheme.Value.List))
{
//leave as list
argSets.Add(((FScheme.Value.List)arg).Item);
}
//incoming value is list and expecting list
else
{
//check if we have a list of lists, if so, then don't wrap
if (Utils.IsListOfLists(arg))
//leave as list
argSets.Add(((FScheme.Value.List)arg).Item);
else
//wrap in list
argSets.Add(Utils.MakeFSharpList(arg));
}
j++;
}
IEnumerable<IEnumerable<FScheme.Value>> lacedArgs = null;
switch (this.ArgumentLacing)
{
case LacingStrategy.First:
lacedArgs = argSets.SingleSet();
break;
case LacingStrategy.Shortest:
lacedArgs = argSets.ShortestSet();
break;
case LacingStrategy.Longest:
lacedArgs = argSets.LongestSet();
break;
case LacingStrategy.CrossProduct:
lacedArgs = argSets.CartesianProduct();
break;
}
//setup a list to hold the results
//each output will have its own results collection
List<FSharpList<FScheme.Value>> results = new List<FSharpList<FScheme.Value>>();
for (int i = 0; i < OutPortData.Count(); i++)
{
results.Add(FSharpList<FScheme.Value>.Empty);
}
//FSharpList<Value> result = FSharpList<Value>.Empty;
//run the evaluate method for each set of
//arguments in the la result. do these
//in reverse order so our cons comes out the right
//way around
for (int i = lacedArgs.Count() - 1; i >= 0; i--)
{
var evalResult = Evaluate(Utils.MakeFSharpList(lacedArgs.ElementAt(i).ToArray()));
//if the list does not have the same number of items
//as the number of output ports, then throw a wobbly
if (!evalResult.IsList)
throw new Exception("Output value of the node is not a list.");
for (int k = 0; k < OutPortData.Count(); k++)
{
FSharpList<FScheme.Value> lst = ((FScheme.Value.List)evalResult).Item;
results[k] = FSharpList<FScheme.Value>.Cons(lst[k], results[k]);
}
runCount++;
}
//the result of evaluation will be a list. we split that result
//and send the results to the outputs
for (int i = 0; i < OutPortData.Count(); i++)
{
outPuts[OutPortData[i]] = FScheme.Value.NewList(results[i]);
}
}
else
{
FScheme.Value evalResult = Evaluate(args);
runCount++;
if (!evalResult.IsList)
throw new Exception("Output value of the node is not a list.");
FSharpList<FScheme.Value> lst = ((FScheme.Value.List)evalResult).Item;
//the result of evaluation will be a list. we split that result
//and send the results to the outputs
for (int i = 0; i < OutPortData.Count(); i++)
{
outPuts[OutPortData[i]] = lst[i];
}
}
ValidateConnections();
if (dynSettings.Controller.UIDispatcher != null && this is IDrawable)
{
dynSettings.Controller.UIDispatcher.Invoke(new Action(() => (this as IDrawable).Draw()));
}
}
public virtual FScheme.Value Evaluate(FSharpList<FScheme.Value> args)
{
throw new NotImplementedException();
}
}
=======
>>>>>>> |
<<<<<<<
public Dictionary<StackValue, StackValue> Dict;
private StackValue[] Stack;
=======
>>>>>>>
<<<<<<<
private int GetNewSize(int size)
=======
//
// TODO Jun: Optimize the reallocation routines
// 1. Copying the temps can be optimized.
// 2. Explore using List for the HeapStack stack. In this case we take advantage of .Net List arrays
//
private void ReAllocate(int size)
>>>>>>>
//
// TODO Jun: Optimize the reallocation routines
// 1. Copying the temps can be optimized.
// 2. Explore using List for the HeapStack stack. In this case we take advantage of .Net List arrays
//
private void ReAllocate(int size)
<<<<<<<
return nextSize;
}
private void ReAllocate(int size)
{
int newAllocatedSize = GetNewSize(size);
=======
>>>>>>>
<<<<<<<
StackValue[] tempstack = new StackValue[newAllocatedSize];
Stack.CopyTo(tempstack, 0);
Stack = tempstack;
for (int i = AllocSize; i < newAllocatedSize; ++i)
=======
StackValue[] tempstack = new StackValue[allocated];
items.CopyTo(tempstack, 0);
// Reallocate the array and copy the temp contents to it
items = new StackValue[newSize];
tempstack.CopyTo(items, 0);
for (int i = allocated; i < newSize; ++i)
>>>>>>>
StackValue[] tempstack = new StackValue[allocated];
items.CopyTo(tempstack, 0);
// Reallocate the array and copy the temp contents to it
items = new StackValue[newSize];
tempstack.CopyTo(items, 0);
for (int i = allocated; i < newSize; ++i)
<<<<<<<
// We should move StackValue list to heap. That is, heap
// manages StackValues instead of HeapElement itself.
heap.ReportAllocation(newAllocatedSize - AllocSize);
AllocSize = newAllocatedSize;
Validity.Assert(size <= AllocSize);
=======
allocated = newSize;
Validity.Assert(size <= allocated);
>>>>>>>
// We should move StackValue list to heap. That is, heap
// manages StackValues instead of HeapElement itself.
heap.ReportAllocation(newAllocatedSize - AllocSize);
allocated = newSize;
Validity.Assert(size <= allocated);
<<<<<<<
=======
>>>>>>>
<<<<<<<
yield return Stack[i];
=======
yield return this.items[i];
>>>>>>>
yield return this.items[i];
<<<<<<<
HeapElement hpe = new HeapElement(size, this);
hpe.Mark = GCMark.White;
totalAllocated += size;
return AddHeapElement(hpe);
=======
switch (type)
{
case PrimitiveType.kTypeArray:
var dsArray = new DSArray(size, this);
return AddHeapElement(dsArray);
case PrimitiveType.kTypePointer:
var dsObject = new DSObject(size, this);
return AddHeapElement(dsObject);
case PrimitiveType.kTypeString:
var dsString = new DSString(size, this);
return AddHeapElement(dsString);
default:
throw new ArgumentException("type");
}
>>>>>>>
HeapElement hpe = null;
switch (type)
{
case PrimitiveType.kTypeArray:
hpe = new DSArray(size, this);
break;
case PrimitiveType.kTypePointer:
hpe = new DSObject(size, this);
break;
case PrimitiveType.kTypeString:
hpe = new DSString(size, this);
break;
default:
throw new ArgumentException("type");
}
hpe.Mark = GCMark.White;
totalAllocated += size;
return AddHeapElement(hpe);
<<<<<<<
IsGCRunning = false;
=======
isGarbageCollecting = false;
}
}
#region Reference counting APIs
/// <summary>
/// Checks if the heap contains at least 1 pointer element that points to itself
/// This function is used as a diagnostic tool for detecting heap cycles and should never return true
/// </summary>
/// <returns> Returns true if the heap contains at least one cycle</returns>
public bool IsHeapCyclic()
{
for (int n = 0; n < heapElements.Count; ++n)
{
HeapElement heapElem = heapElements[n];
if (IsHeapCyclic(heapElem, n))
{
return true;
}
}
return false;
}
/// <summary>
/// Checks if the heap element is cyclic.
/// Traverses the pointer element and determines it points to itself
/// </summary>
/// <param name="heapElement"></param>
/// <param name="core"></param>
/// <returns> Returns true if the array contains a cycle </returns>
private bool IsHeapCyclic(HeapElement heapElement, int HeapID)
{
if (heapElement.VisibleSize > 0)
{
// Traverse each element in the heap
foreach (StackValue sv in heapElement.VisibleItems)
{
// Is it a pointer
if (sv.IsReferenceType)
{
// Check if the current element in the heap points to the original pointer
if (sv.opdata == HeapID)
{
return true;
}
HeapElement hpe;
TryGetHeapElement(sv, out hpe);
return IsHeapCyclic(hpe, HeapID);
}
}
>>>>>>>
isGarbageCollecting = false;
}
}
#region Reference counting APIs
/// <summary>
/// Checks if the heap contains at least 1 pointer element that points to itself
/// This function is used as a diagnostic tool for detecting heap cycles and should never return true
/// </summary>
/// <returns> Returns true if the heap contains at least one cycle</returns>
public bool IsHeapCyclic()
{
for (int n = 0; n < heapElements.Count; ++n)
{
HeapElement heapElem = heapElements[n];
if (IsHeapCyclic(heapElem, n))
{
return true;
}
}
return false;
}
/// <summary>
/// Checks if the heap element is cyclic.
/// Traverses the pointer element and determines it points to itself
/// </summary>
/// <param name="heapElement"></param>
/// <param name="core"></param>
/// <returns> Returns true if the array contains a cycle </returns>
private bool IsHeapCyclic(HeapElement heapElement, int HeapID)
{
if (heapElement.VisibleSize > 0)
{
// Traverse each element in the heap
foreach (StackValue sv in heapElement.VisibleItems)
{
// Is it a pointer
if (sv.IsReferenceType)
{
// Check if the current element in the heap points to the original pointer
if (sv.opdata == HeapID)
{
return true;
}
HeapElement hpe;
TryGetHeapElement(sv, out hpe);
return IsHeapCyclic(hpe, HeapID);
}
} |
<<<<<<<
=======
//Start heartbeat reporting
Services.InstrumentationLogger.Start();
//create the view model to which the main window will bind
//the DynamoModel is created therein
this.DynamoViewModel = (DynamoViewModel)Activator.CreateInstance(viewModelType,new object[]{this});
>>>>>>>
//Start heartbeat reporting
Services.InstrumentationLogger.Start();
//create the view model to which the main window will bind
//the DynamoModel is created therein
this.DynamoViewModel = (DynamoViewModel)Activator.CreateInstance(viewModelType,new object[]{this});
<<<<<<<
//if (dynSettings.Bench != null)
//{
// //Run this method again from the main thread
// dynSettings.Bench.Dispatcher.BeginInvoke(new Action(
// delegate { RunExpression(_showErrors); }
// ));
//}
dynSettings.Controller.DispatchOnUIThread(() => RunExpression(_showErrors));
=======
if (dynSettings.Bench != null)
{
//Run this method again from the main thread
dynSettings.Bench.Dispatcher.BeginInvoke(
new Action(() => RunExpression(_showErrors)));
}
>>>>>>>
dynSettings.Controller.DispatchOnUIThread(() => RunExpression(_showErrors));
<<<<<<<
foreach (dynNodeModel node in topElements)
{
string exp = node.PrintExpression();
DynamoLogger.Instance.Log("> " + exp);
}
=======
foreach (string exp in topElements.Select(node => node.PrintExpression()))
dynSettings.Controller.DynamoViewModel.Log("> " + exp);
>>>>>>>
foreach (string exp in topElements.Select(node => node.PrintExpression()))
DynamoLogger.Instance.Log("> " + exp);
<<<<<<<
//dynSettings.Bench.Dispatcher.Invoke(new Action(
// delegate { DynamoLogger.Instance.Log(ex); }
// ));
dynSettings.Controller.DispatchOnUIThread(() => DynamoLogger.Instance.Log(ex));
=======
dynSettings.Bench.Dispatcher.Invoke(
new Action(() => dynSettings.Controller.DynamoViewModel.Log(ex)));
>>>>>>>
dynSettings.Controller.DispatchOnUIThread(() => DynamoLogger.Instance.Log(ex)); |
<<<<<<<
TransactionManager = new TransactionWrapper();
TransactionManager.TransactionStarted += TransactionManager_TransactionCommitted;
TransactionManager.TransactionCancelled += TransactionManager_TransactionCancelled;
TransactionManager.FailuresRaised += TransactionManager_FailuresRaised;
=======
MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrationsRevit));
>>>>>>>
TransactionManager = new TransactionWrapper();
TransactionManager.TransactionStarted += TransactionManager_TransactionCommitted;
TransactionManager.TransactionCancelled += TransactionManager_TransactionCancelled;
TransactionManager.FailuresRaised += TransactionManager_FailuresRaised;
MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrationsRevit)); |
<<<<<<<
using UnitsUI.Properties;
=======
using ProtoCore.Namespace;
>>>>>>>
using UnitsUI.Properties;
using ProtoCore.Namespace; |
<<<<<<<
return reachClient.Send(HomeWorkspace, CustomNodesWorkspaces);
=======
var result = reachClient.Send(HomeWorkspace, CustomNodeWorkspaces);
>>>>>>>
return reachClient.Send(HomeWorkspace, CustomNodeWorkspaces); |
<<<<<<<
=======
//if we are running in revit (or any context other than NONE) use the DoNotLoadOnPlatforms attribute,
//if available, to discern whether we should load this type
if (!dynamoModel.Context.Equals(Context.NONE))
{
object[] platformExclusionAttribs = t.GetCustomAttributes(typeof(DoNotLoadOnPlatformsAttribute), false);
if (platformExclusionAttribs.Length > 0)
{
string[] exclusions = (platformExclusionAttribs[0] as DoNotLoadOnPlatformsAttribute).Values;
//if the attribute's values contain the context stored on the Model
//then skip loading this type.
if (exclusions.Reverse().Any(e => e.Contains(dynamoModel.Context)))
continue;
}
}
>>>>>>>
//if we are running in revit (or any context other than NONE) use the DoNotLoadOnPlatforms attribute,
//if available, to discern whether we should load this type
if (!dynamoModel.Context.Equals(Context.NONE))
{
object[] platformExclusionAttribs = t.GetCustomAttributes(typeof(DoNotLoadOnPlatformsAttribute), false);
if (platformExclusionAttribs.Length > 0)
{
string[] exclusions = (platformExclusionAttribs[0] as DoNotLoadOnPlatformsAttribute).Values;
//if the attribute's values contain the context stored on the Model
//then skip loading this type.
if (exclusions.Reverse().Any(e => e.Contains(dynamoModel.Context)))
continue;
}
} |
<<<<<<<
using RevitGeometry = Revit.Geometry;
=======
using System.Xml;
>>>>>>>
using RevitGeometry = Revit.Geometry;
using System.Xml; |
<<<<<<<
using Double = System.Double;
=======
using DSNodeServices;
using Dynamo.Core;
using Dynamo.UI;
using Dynamo.Core.Threading;
using Dynamo.Interfaces;
using Dynamo.Nodes;
using Dynamo.PackageManager;
using Dynamo.Search;
using Dynamo.Services;
using Dynamo.UpdateManager;
using Dynamo.Utilities;
using Dynamo.Selection;
using DynamoUnits;
using DynamoUtilities;
>>>>>>>
using Double = System.Double;
<<<<<<<
=======
using Dynamo.DSEngine;
using Double = System.Double;
>>>>>>>
<<<<<<<
=======
public SearchModel SearchModel { get; private set; }
public DebugSettings DebugSettings { get; private set; }
public EngineController EngineController { get; private set; }
public PreferenceSettings PreferenceSettings { get; private set; }
public DynamoScheduler Scheduler { get { return scheduler; } }
public bool ShutdownRequested { get; internal set; }
public int MaxTesselationDivisions { get; set; }
>>>>>>>
private DynamoScheduler scheduler;
public DynamoScheduler Scheduler { get { return scheduler; } }
public int MaxTesselationDivisions { get; set; }
<<<<<<<
Workspaces = new ObservableCollection<WorkspaceModel>();
ClipBoard = new ObservableCollection<ModelBase>();
=======
this.MaxTesselationDivisions = 128;
>>>>>>>
this.MaxTesselationDivisions = 128;
<<<<<<<
MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrations));
Runner = runner;
Runner.RunStarted += Runner_RunStarted;
Runner.RunCompleted += Runner_RunCompeleted;
Runner.EvaluationCompleted += Runner_EvaluationCompleted;
Runner.ExceptionOccurred += Runner_ExceptionOccurred;
Runner.MessageLogged += LogMessage;
=======
#if ENABLE_DYNAMO_SCHEDULER
var thread = configuration.SchedulerThread ?? new DynamoSchedulerThread();
scheduler = new DynamoScheduler(thread);
scheduler.TaskStateChanged += OnAsyncTaskStateChanged;
#endif
>>>>>>>
MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrations));
#if ENABLE_DYNAMO_SCHEDULER
var thread = configuration.SchedulerThread ?? new DynamoSchedulerThread();
scheduler = new DynamoScheduler(thread);
scheduler.TaskStateChanged += OnAsyncTaskStateChanged;
#endif
Runner = runner;
Runner.RunStarted += Runner_RunStarted;
Runner.RunCompleted += Runner_RunCompeleted;
Runner.EvaluationCompleted += Runner_EvaluationCompleted;
Runner.ExceptionOccurred += Runner_ExceptionOccurred;
Runner.MessageLogged += LogMessage;
<<<<<<<
SearchModel = new NodeSearchModel();
SearchModel.ItemProduced += AddNodeToCurrentWorkspace;
CurrentWorkspaceChanged += SearchModel.RevealWorkspaceSpecificNodes;
=======
UpdateManager.UpdateManager.CheckForProductUpdate();
SearchModel = new SearchModel(this);
>>>>>>>
SearchModel = new NodeSearchModel();
SearchModel.ItemProduced += AddNodeToCurrentWorkspace;
CurrentWorkspaceChanged += SearchModel.RevealWorkspaceSpecificNodes;
<<<<<<<
CustomNodeManager = new CustomNodeManager(DynamoPathManager.Instance.UserDefinitions);
CustomNodeManager.MessageLogged += LogMessage;
Loader = new DynamoLoader();
Loader.MessageLogged += LogMessage;
PackageLoader = new PackageLoader();
PackageLoader.MessageLogged += LogMessage;
=======
this.CustomNodeManager = new CustomNodeManager(this, DynamoPathManager.Instance.UserDefinitions);
>>>>>>>
CustomNodeManager = new CustomNodeManager(DynamoPathManager.Instance.UserDefinitions);
CustomNodeManager.MessageLogged += LogMessage;
Loader = new DynamoLoader();
Loader.MessageLogged += LogMessage;
PackageLoader = new PackageLoader();
PackageLoader.MessageLogged += LogMessage;
<<<<<<<
EngineController = new EngineController(this, DynamoPathManager.Instance.GeometryFactory);
LibraryServices.Instance.MessageLogged += LogMessage;
NodeFactory = new NodeFactory();
NodeFactory.MessageLogged += LogMessage;
NodeFactory.AddLoader(new ZeroTouchNodeLoader());
NodeFactory.AddLoader(new CustomNodeLoader(CustomNodeManager, IsTestMode));
=======
this.EngineController = new EngineController(this, DynamoPathManager.Instance.GeometryFactory);
this.Loader = new DynamoLoader(this);
// do package uninstalls first
this.Loader.PackageLoader.DoCachedPackageUninstalls(preferences);
this.CustomNodeManager.RecompileAllNodes(EngineController);
>>>>>>>
EngineController = new EngineController(this, DynamoPathManager.Instance.GeometryFactory);
LibraryServices.Instance.MessageLogged += LogMessage;
NodeFactory = new NodeFactory();
NodeFactory.MessageLogged += LogMessage;
NodeFactory.AddLoader(new ZeroTouchNodeLoader());
NodeFactory.AddLoader(new CustomNodeLoader(CustomNodeManager, IsTestMode));
UpdateManager.UpdateManager.CheckForProductUpdate();
<<<<<<<
//TODO(Steve): Update location where nodes are marked dirty
foreach (var n in CurrentWorkspace.Nodes)
=======
MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrations));
PackageManagerClient = new PackageManagerClient(this);
this.Loader.ClearCachedAssemblies();
this.Loader.LoadNodeModels();
// load packages last
this.Loader.PackageLoader.LoadPackagesIntoDynamo(preferences, EngineController.LibraryServices);
}
//SEPARATECORE: causes mono crash
private void InitializeInstrumentationLogger()
{
if (DynamoModel.IsTestMode == false)
InstrumentationLogger.Start(this);
}
private void InitializeCurrentWorkspace()
{
this.AddHomeWorkspace();
this.CurrentWorkspace = this.HomeSpace;
this.CurrentWorkspace.X = 0;
this.CurrentWorkspace.Y = 0;
}
private static void InitializePreferences(IPreferences preferences)
{
BaseUnit.LengthUnit = preferences.LengthUnit;
BaseUnit.AreaUnit = preferences.AreaUnit;
BaseUnit.VolumeUnit = preferences.VolumeUnit;
BaseUnit.NumberFormat = preferences.NumberFormat;
}
#region internal methods
public string Version
{
get { return UpdateManager.UpdateManager.Instance.ProductVersion.ToString(); }
}
/// <summary>
/// External components call this method to shutdown DynamoModel. This
/// method marks 'ShutdownRequested' property to 'true'. This method is
/// used rather than a public virtual method to ensure that the value of
/// ShutdownRequested is set to true.
/// </summary>
/// <param name="shutdownHost">Set this parameter to true to shutdown
/// the host application.</param>
///
public void ShutDown(bool shutdownHost)
{
if (ShutdownRequested)
>>>>>>>
//TODO(Steve): Update location where nodes are marked dirty
foreach (var n in CurrentWorkspace.Nodes)
<<<<<<<
SearchModel.AddToSearch(new NodeModelSearchElement(typeLoadData));
=======
// Notify listeners (optional) of completion.
RunEnabled = true; // Re-enable 'Run' button.
// Notify handlers that evaluation took place.
var e = new EvaluationCompletedEventArgs(true);
OnEvaluationCompleted(this, e);
}
/// <summary>
/// This event handler is invoked when DynamoScheduler changes the state
/// of an AsyncTask object. See TaskStateChangedEventArgs.State for more
/// details of these state changes.
/// </summary>
/// <param name="sender">The scheduler which raised the event.</param>
/// <param name="e">Task state changed event argument.</param>
///
private void OnAsyncTaskStateChanged(
DynamoScheduler sender,
TaskStateChangedEventArgs e)
{
switch (e.CurrentState)
{
case TaskStateChangedEventArgs.State.ExecutionStarting:
if (e.Task is UpdateGraphAsyncTask)
ExecutionEvents.OnGraphPreExecution();
break;
case TaskStateChangedEventArgs.State.ExecutionCompleted:
if (e.Task is UpdateGraphAsyncTask)
{
// Record execution time for update graph task.
long start = e.Task.ExecutionStartTime.TickCount;
long end = e.Task.ExecutionEndTime.TickCount;
var executionTimeSpan = new TimeSpan(end - start);
InstrumentationLogger.LogAnonymousTimedEvent("Perf",
e.Task.GetType().Name, executionTimeSpan);
Logger.Log("Evaluation completed in " + executionTimeSpan);
ExecutionEvents.OnGraphPostExecution();
}
break;
}
>>>>>>>
SearchModel.AddToSearch(new NodeModelSearchElement(typeLoadData));
<<<<<<<
private bool OpenFile(string xmlPath, out WorkspaceModel model)
{
WorkspaceHeader workspaceInfo;
if (!WorkspaceHeader.FromPath(xmlPath, IsTestMode, Logger, out workspaceInfo))
{
model = null;
return false;
}
if (workspaceInfo.IsCustomNodeWorkspace())
{
model =
}
=======
Logger.Log("Welcome to Dynamo!");
>>>>>>>
private bool OpenFile(string xmlPath, out WorkspaceModel model)
{
WorkspaceHeader workspaceInfo;
if (!WorkspaceHeader.FromPath(xmlPath, IsTestMode, Logger, out workspaceInfo))
{
model = null;
return false;
}
if (workspaceInfo.IsCustomNodeWorkspace())
{
model =
} |
<<<<<<<
public VariableInputNode(WorkspaceModel workspace) : base(workspace)
{}
=======
public virtual void SetupCustomUIElements(dynNodeView view)
{
VariableInputController.SetupNodeUI(view);
}
private BasicVariableInputNodeController VariableInputController { get; set; }
protected VariableInputNode()
{
VariableInputController = new BasicVariableInputNodeController(this);
}
private sealed class BasicVariableInputNodeController : VariableInputNodeController
{
private readonly VariableInputNode model;
public BasicVariableInputNodeController(VariableInputNode node) : base(node)
{
model = node;
}
protected override string GetInputName(int index)
{
return model.GetInputName(index);
}
protected override string GetInputTooltip(int index)
{
return model.GetInputTooltip(index);
}
public void RemoveInputBase()
{
base.RemoveInputFromModel();
}
public void AddInputBase()
{
base.AddInputToModel();
}
public int GetInputIndexBase()
{
return base.GetInputIndexFromModel();
}
public override void AddInputToModel()
{
model.AddInput();
}
public override void RemoveInputFromModel()
{
model.RemoveInput();
}
public override int GetInputIndexFromModel()
{
return model.GetInputIndex();
}
}
protected abstract string GetInputTooltip(int index);
protected abstract string GetInputName(int index);
protected virtual void RemoveInput()
{
VariableInputController.RemoveInputBase();
}
protected virtual void AddInput()
{
VariableInputController.AddInputBase();
}
protected virtual int GetInputIndex()
{
return VariableInputController.GetInputIndexBase();
}
protected override void OnBuilt()
{
VariableInputController.OnBuilt();
}
protected override void SaveNode(
XmlDocument xmlDoc, XmlElement nodeElement, SaveContext context)
{
base.SaveNode(xmlDoc, nodeElement, context);
VariableInputController.SaveNode(xmlDoc, nodeElement, context);
}
protected override void LoadNode(XmlNode nodeElement)
{
base.LoadNode(nodeElement);
VariableInputController.LoadNode(nodeElement);
}
protected override void SerializeCore(XmlElement element, SaveContext context)
{
base.SerializeCore(element, context);
VariableInputController.SerializeCore(element, context);
}
protected override void DeserializeCore(XmlElement element, SaveContext context)
{
base.DeserializeCore(element, context);
VariableInputController.DeserializeCore(element, context);
}
protected override bool HandleModelEventCore(string eventName)
{
return VariableInputController.HandleModelEventCore(eventName)
|| base.HandleModelEventCore(eventName);
}
}
public abstract class VariableInputNodeController
{
private readonly NodeModel model;
>>>>>>>
protected VariableInputNode(WorkspaceModel workspace) : base(workspace)
{
VariableInputController = new BasicVariableInputNodeController(this);
}
public virtual void SetupCustomUIElements(dynNodeView view)
{
VariableInputController.SetupNodeUI(view);
}
private BasicVariableInputNodeController VariableInputController { get; set; }
private sealed class BasicVariableInputNodeController : VariableInputNodeController
{
private readonly VariableInputNode model;
public BasicVariableInputNodeController(VariableInputNode node) : base(node)
{
model = node;
}
protected override string GetInputName(int index)
{
return model.GetInputName(index);
}
protected override string GetInputTooltip(int index)
{
return model.GetInputTooltip(index);
}
public void RemoveInputBase()
{
base.RemoveInputFromModel();
}
public void AddInputBase()
{
base.AddInputToModel();
}
public int GetInputIndexBase()
{
return base.GetInputIndexFromModel();
}
public override void AddInputToModel()
{
model.AddInput();
}
public override void RemoveInputFromModel()
{
model.RemoveInput();
}
public override int GetInputIndexFromModel()
{
return model.GetInputIndex();
}
}
protected abstract string GetInputTooltip(int index);
protected abstract string GetInputName(int index);
protected virtual void RemoveInput()
{
VariableInputController.RemoveInputBase();
}
protected virtual void AddInput()
{
VariableInputController.AddInputBase();
}
protected virtual int GetInputIndex()
{
return VariableInputController.GetInputIndexBase();
}
protected override void OnBuilt()
{
VariableInputController.OnBuilt();
}
protected override void SaveNode(
XmlDocument xmlDoc, XmlElement nodeElement, SaveContext context)
{
base.SaveNode(xmlDoc, nodeElement, context);
VariableInputController.SaveNode(xmlDoc, nodeElement, context);
}
protected override void LoadNode(XmlNode nodeElement)
{
base.LoadNode(nodeElement);
VariableInputController.LoadNode(nodeElement);
}
protected override void SerializeCore(XmlElement element, SaveContext context)
{
base.SerializeCore(element, context);
VariableInputController.SerializeCore(element, context);
}
protected override void DeserializeCore(XmlElement element, SaveContext context)
{
base.DeserializeCore(element, context);
VariableInputController.DeserializeCore(element, context);
}
protected override bool HandleModelEventCore(string eventName)
{
return VariableInputController.HandleModelEventCore(eventName)
|| base.HandleModelEventCore(eventName);
}
}
public abstract class VariableInputNodeController
{
private readonly NodeModel model;
<<<<<<<
Workspace.RecordModelsForUndo(models);
=======
model.WorkSpace.RecordModelsForUndo(models);
>>>>>>>
model.Workspace.RecordModelsForUndo(models);
<<<<<<<
Workspace.RecordModelForModification(this);
=======
model.WorkSpace.RecordModelForModification(model);
>>>>>>>
model.Workspace.RecordModelForModification(model);
<<<<<<<
Workspace.UndoRecorder.PopFromUndoGroup();
=======
model.WorkSpace.UndoRecorder.PopFromUndoGroup();
>>>>>>>
model.Workspace.UndoRecorder.PopFromUndoGroup(); |
<<<<<<<
switch (e.Key)
=======
// ignore the key command if modifiers are present
if (e.KeyboardDevice.IsKeyDown(Key.LeftCtrl) ||
e.KeyboardDevice.IsKeyDown(Key.RightCtrl) ||
e.KeyboardDevice.IsKeyDown(Key.LeftAlt) ||
e.KeyboardDevice.IsKeyDown(Key.RightAlt))
{
return;
}
if (e.Key == Key.Return)
{
_viewModel.ExecuteSelected();
}
else if (e.Key == Key.Tab)
{
_viewModel.PopulateSearchTextWithSelectedResult();
}
else if (e.Key == Key.Down)
>>>>>>>
// ignore the key command if modifiers are present
if (e.KeyboardDevice.IsKeyDown(Key.LeftCtrl) ||
e.KeyboardDevice.IsKeyDown(Key.RightCtrl) ||
e.KeyboardDevice.IsKeyDown(Key.LeftAlt) ||
e.KeyboardDevice.IsKeyDown(Key.RightAlt))
{
return;
}
switch (e.Key) |
<<<<<<<
using System.Windows.Threading;
=======
using ICSharpCode.AvalonEdit;
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
using System.Xml;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.AvalonEdit.Editing;
>>>>>>>
using System.Windows.Threading;
using ICSharpCode.AvalonEdit;
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
using System.Xml;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.AvalonEdit.Editing;
<<<<<<<
public class CodeNodeTextBox : DynamoTextBox
{
bool shift, enter;
public CodeNodeTextBox(string s)
: base(s)
{
shift = enter = false;
//Remove the select all when focused feature
RemoveHandler(GotKeyboardFocusEvent, focusHandler);
//Allow for event processing after textbook has been focused to
//help set the Caret position
selectAllWhenFocused = false;
//Set style for Watermark
this.SetResourceReference(TextBox.StyleProperty, "CodeBlockNodeTextBox");
this.Tag = "Your code goes here";
}
/// <summary>
/// To allow users to remove focus by pressing Shift Enter. Uses two bools (shift / enter)
/// and sets them when pressed/released
/// </summary>
#region Key Press Event Handlers
protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.LeftShift || e.Key == Key.RightShift)
{
shift = true;
}
else if (e.Key == Key.Enter || e.Key == Key.Return)
{
enter = true;
}
else if (e.Key == Key.Escape)
{
HandleEscape();
}
if (shift == true && enter == true)
{
OnRequestReturnFocusToSearch();
shift = enter = false;
}
}
protected override void OnPreviewKeyUp(KeyEventArgs e)
{
if (e.Key == Key.LeftShift || e.Key == Key.RightShift)
{
shift = false;
}
else if (e.Key == Key.Enter || e.Key == Key.Return)
{
enter = false;
}
}
#endregion
protected override void OnTextChanged(TextChangedEventArgs e)
{
e.Handled = true; //hide base
}
/// <summary>
///
/// </summary>
protected override void OnLostFocus(RoutedEventArgs e)
{
Pending = true;
base.OnLostFocus(e);
}
private void HandleEscape()
{
var text = this.Text;
var cb = DataContext as CodeBlockNodeModel;
if (cb == null || cb.Code != null && text.Equals(cb.Code))
OnRequestReturnFocusToSearch();
else
(this as TextBox).Text = (DataContext as CodeBlockNodeModel).Code;
}
}
=======
>>>>>>>
public class CodeNodeTextBox : DynamoTextBox
{
bool shift, enter;
public CodeNodeTextBox(string s)
: base(s)
{
shift = enter = false;
//Remove the select all when focused feature
RemoveHandler(GotKeyboardFocusEvent, focusHandler);
//Allow for event processing after textbook has been focused to
//help set the Caret position
selectAllWhenFocused = false;
//Set style for Watermark
this.SetResourceReference(TextBox.StyleProperty, "CodeBlockNodeTextBox");
this.Tag = "Your code goes here";
}
/// <summary>
/// To allow users to remove focus by pressing Shift Enter. Uses two bools (shift / enter)
/// and sets them when pressed/released
/// </summary>
#region Key Press Event Handlers
protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.LeftShift || e.Key == Key.RightShift)
{
shift = true;
}
else if (e.Key == Key.Enter || e.Key == Key.Return)
{
enter = true;
}
else if (e.Key == Key.Escape)
{
HandleEscape();
}
if (shift == true && enter == true)
{
OnRequestReturnFocusToSearch();
shift = enter = false;
}
}
protected override void OnPreviewKeyUp(KeyEventArgs e)
{
if (e.Key == Key.LeftShift || e.Key == Key.RightShift)
{
shift = false;
}
else if (e.Key == Key.Enter || e.Key == Key.Return)
{
enter = false;
}
}
#endregion
protected override void OnTextChanged(TextChangedEventArgs e)
{
e.Handled = true; //hide base
}
/// <summary>
///
/// </summary>
protected override void OnLostFocus(RoutedEventArgs e)
{
Pending = true;
base.OnLostFocus(e);
}
private void HandleEscape()
{
var text = this.Text;
var cb = DataContext as CodeBlockNodeModel;
if (cb == null || cb.Code != null && text.Equals(cb.Code))
OnRequestReturnFocusToSearch();
else
(this as TextBox).Text = (DataContext as CodeBlockNodeModel).Code;
}
} |
<<<<<<<
=======
public class CreateAnnotationCommand : RecordableCommand
{
#region Public Class Methods
public CreateAnnotationCommand(Guid nodeId, string annotationText,
double x, double y, bool defaultPosition)
{
if (string.IsNullOrEmpty(annotationText))
annotationText = string.Empty;
AnnotationId = nodeId;
AnnotationText = annotationText;
X = x;
Y = y;
DefaultPosition = defaultPosition;
}
internal static CreateAnnotationCommand DeserializeCore(XmlElement element)
{
XmlElementHelper helper = new XmlElementHelper(element);
Guid annotationId = helper.ReadGuid("AnnotationId");
string annotationText = helper.ReadString("AnnotationText");
double x = helper.ReadDouble("X");
double y = helper.ReadDouble("Y");
return new CreateAnnotationCommand(annotationId, annotationText, x, y,
helper.ReadBoolean("DefaultPosition"));
}
#endregion
#region Public Command Properties
internal Guid AnnotationId { get; private set; }
internal string AnnotationText { get; private set; }
internal double X { get; private set; }
internal double Y { get; private set; }
internal bool DefaultPosition { get; private set; }
#endregion
#region Protected Overridable Methods
protected override void ExecuteCore(DynamoModel dynamoModel)
{
dynamoModel.CreateAnnotationImpl(this);
}
protected override void SerializeCore(XmlElement element)
{
XmlElementHelper helper = new XmlElementHelper(element);
helper.SetAttribute("NodeId", AnnotationId);
helper.SetAttribute("NoteText", AnnotationText);
helper.SetAttribute("X", X);
helper.SetAttribute("Y", Y);
helper.SetAttribute("DefaultPosition", DefaultPosition);
}
#endregion
}
}
>>>>>>>
public class CreateAnnotationCommand : RecordableCommand
{
#region Public Class Methods
public CreateAnnotationCommand(Guid nodeId, string annotationText,
double x, double y, bool defaultPosition)
{
if (string.IsNullOrEmpty(annotationText))
annotationText = string.Empty;
AnnotationId = nodeId;
AnnotationText = annotationText;
X = x;
Y = y;
DefaultPosition = defaultPosition;
}
internal static CreateAnnotationCommand DeserializeCore(XmlElement element)
{
XmlElementHelper helper = new XmlElementHelper(element);
Guid annotationId = helper.ReadGuid("AnnotationId");
string annotationText = helper.ReadString("AnnotationText");
double x = helper.ReadDouble("X");
double y = helper.ReadDouble("Y");
return new CreateAnnotationCommand(annotationId, annotationText, x, y,
helper.ReadBoolean("DefaultPosition"));
}
#endregion
#region Public Command Properties
internal Guid AnnotationId { get; private set; }
internal string AnnotationText { get; private set; }
internal double X { get; private set; }
internal double Y { get; private set; }
internal bool DefaultPosition { get; private set; }
#endregion
#region Protected Overridable Methods
protected override void ExecuteCore(DynamoModel dynamoModel)
{
dynamoModel.CreateAnnotationImpl(this);
}
protected override void SerializeCore(XmlElement element)
{
XmlElementHelper helper = new XmlElementHelper(element);
helper.SetAttribute("NodeId", AnnotationId);
helper.SetAttribute("NoteText", AnnotationText);
helper.SetAttribute("X", X);
helper.SetAttribute("Y", Y);
helper.SetAttribute("DefaultPosition", DefaultPosition);
}
#endregion
} |
Subsets and Splits