Beispiel #1
0
 /// <summary>
 /// Closes this instance.
 /// </summary>
 public override void Close() {
     base.Close();
     if (_tool != null) {
         _tool.PropertyChanged -= HandlePropertyChanged;
         _tool = null;
     }
 }
        /// <summary>
        /// Gets the target properties.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="targetTool">The target tool.</param>
        /// <param name="parent">The parent.</param>
        /// <returns></returns>
        private List<Property> GetTargetProperties(Property property, Tool targetTool, Node parent)
        {
            List<ns.Base.Plugins.Properties.Property> properties = new List<ns.Base.Plugins.Properties.Property>();

            foreach (Node node in parent.Childs) {
                if (node == targetTool) break;

                if (node is Property) {
                    ns.Base.Plugins.Properties.Property prop = node as ns.Base.Plugins.Properties.Property;
                    if (prop.IsOutput && (prop.Parent is Tool || prop.Parent is Operation) && property.GetType() == prop.GetType())
                        properties.Add(prop);
                }

                properties.AddRange(GetTargetProperties(property, targetTool, node));
            }

            return properties;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToolTreeItem"/> class.
 /// </summary>
 /// <param name="tool">The tool.</param>
 public ToolTreeItem(Tool tool)
     : base(tool) {
     _tool = tool;
     _tool.PropertyChanged += HandlePropertyChanged;
 }
Beispiel #4
0
        /// <summary>
        /// Validates the tool.
        /// </summary>
        /// <param name="tool">The tool.</param>
        /// <returns></returns>
        private bool ValidateTool(Tool tool)
        {
            bool result = false;

            try {
                if (ValidatePlugin(tool) == true) {

                    result = true;
                }
            } catch (Exception ex) {
                Trace.WriteLine(ex.Message, ex.StackTrace, LogCategory.Error);
            }

            return result;
        }