Ejemplo n.º 1
0
        public MainWindow()
        {
            Tag = new DependencyManager(this, (s, e) => PropertyChanged(s, e));
            System.Windows.Forms.Application.EnableVisualStyles();

            // Create commands
            NewFlowCommand = new DelegateCommand(NewFlowCommandCallback);
            OpenFlowCommand = new DelegateCommand(OpenFlowCommandCallback);
            SaveFlowCommand = new DelegateCommand(SaveFlowCommandCallback, p => CurrentHistory?.Actions?.Any() == true);
            SaveAllFlowsCommand = new DelegateCommand(SaveAllFlowsCommandCallback, p => Flows.Any(f => f.History.Actions.Any()));
            UndoCommand = new DelegateCommand(UndoCommandCallback, p => CurrentHistory?.CanUndo == true);
            RedoCommand = new DelegateCommand(RedoCommandCallback, p => CurrentHistory?.CanRedo == true);
            RunFlowCommand = new DelegateCommand(RunFlowCommandCallback, p => Debugger?.State != DebuggerState.Running);
            StepFlowCommand = new DelegateCommand(StepFlowCommandCallback, p => Debugger?.State != DebuggerState.Running);
            BreakFlowCommand = new DelegateCommand(BreakFlowCommandCallback, p => Debugger?.State == DebuggerState.Running);
            StopFlowCommand = new DelegateCommand(StopFlowCommandCallback, p => (Debugger?.State ?? DebuggerState.Idle) != DebuggerState.Idle);

            // Redirect console output
            Log.Verbosity = LogVerbosity.Trace;
            LogMessages.Add(Log.Category.Common.Name, new ObservableCollection<LogMessage>());
            LogMessages.Add(FlowDebugger.DebuggerCategory.Name, new ObservableCollection<LogMessage>());
            logTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(100), DispatcherPriority.ApplicationIdle, Log_TimerCallback, Dispatcher.CurrentDispatcher);
            Log.Message += Log_Message;

            // Analyze loaded assemblies
            AppDomain.CurrentDomain.AssemblyLoad += (s, a) => AnalyzeAssembly(a.LoadedAssembly);
            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
                AnalyzeAssembly(assembly);

            // Load referenced assemblies
            if (Settings.Default.Assemblies != null)
            {
                foreach (string path in Settings.Default.Assemblies)
                {
                    string assemblyPath = path;

                    if (!Path.IsPathRooted(assemblyPath))
                        assemblyPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), assemblyPath);

                    try
                    {
                        Assembly.LoadFrom(assemblyPath);
                    }
                    catch { }
                }
            }

            // Load referenced flows
            RefreshReferencedFlows();

            DataContext = this;
            InitializeComponent();

            // Load specified arguments
            string[] args = Environment.GetCommandLineArgs();
            foreach (string arg in args.Skip(1))
                Open(arg);

            Log.Info("FlowTomator is ready");
        }
Ejemplo n.º 2
0
        public XFlowEditor()
        {
            Tag = new DependencyManager(this, (s, e) => NotifyPropertyChanged(e.PropertyName));
            InitializeComponent();

            DataContextChanged += XFlowEditor_DataContextChanged;
            Loaded += XFlowEditor_Loaded;

            SelectedNodes.CollectionChanged += SelectedNodes_CollectionChanged;
        }
Ejemplo n.º 3
0
 public FlowEditor()
 {
     dependencyManager = new DependencyManager(this, (s, e) => NotifyPropertyChanged(e.PropertyName));
 }
Ejemplo n.º 4
0
        public MainWindow()
        {
            Tag = new DependencyManager(this, (s, e) => PropertyChanged(s, e));
            System.Windows.Forms.Application.EnableVisualStyles();

            // Create commands
            NewFlowCommand      = new DelegateCommand(NewFlowCommandCallback);
            OpenFlowCommand     = new DelegateCommand(OpenFlowCommandCallback);
            SaveFlowCommand     = new DelegateCommand(SaveFlowCommandCallback, p => CurrentHistory?.Actions?.Any() == true);
            SaveAllFlowsCommand = new DelegateCommand(SaveAllFlowsCommandCallback, p => Flows.Any(f => f.History.Actions.Any()));
            UndoCommand         = new DelegateCommand(UndoCommandCallback, p => CurrentHistory?.CanUndo == true);
            RedoCommand         = new DelegateCommand(RedoCommandCallback, p => CurrentHistory?.CanRedo == true);
            RunFlowCommand      = new DelegateCommand(RunFlowCommandCallback, p => Debugger?.State != DebuggerState.Running);
            StepFlowCommand     = new DelegateCommand(StepFlowCommandCallback, p => Debugger?.State != DebuggerState.Running);
            BreakFlowCommand    = new DelegateCommand(BreakFlowCommandCallback, p => Debugger?.State == DebuggerState.Running);
            StopFlowCommand     = new DelegateCommand(StopFlowCommandCallback, p => (Debugger?.State ?? DebuggerState.Idle) != DebuggerState.Idle);

            // Redirect console output
            Log.Verbosity = LogVerbosity.Trace;
            LogMessages.Add(Log.Category.Common.Name, new ObservableCollection <LogMessage>());
            LogMessages.Add(FlowDebugger.DebuggerCategory.Name, new ObservableCollection <LogMessage>());
            logTimer     = new DispatcherTimer(TimeSpan.FromMilliseconds(100), DispatcherPriority.ApplicationIdle, Log_TimerCallback, Dispatcher.CurrentDispatcher);
            Log.Message += Log_Message;

            // Analyze loaded assemblies
            AppDomain.CurrentDomain.AssemblyLoad += (s, a) => AnalyzeAssembly(a.LoadedAssembly);
            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                AnalyzeAssembly(assembly);
            }

            // Load referenced assemblies
            if (Settings.Default.Assemblies != null)
            {
                foreach (string path in Settings.Default.Assemblies)
                {
                    string assemblyPath = path;

                    if (!Path.IsPathRooted(assemblyPath))
                    {
                        assemblyPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), assemblyPath);
                    }

                    try
                    {
                        Assembly.LoadFrom(assemblyPath);
                    }
                    catch { }
                }
            }

            // Load referenced flows
            RefreshReferencedFlows();

            DataContext = this;
            InitializeComponent();

            // Load specified arguments
            string[] args = Environment.GetCommandLineArgs();
            foreach (string arg in args.Skip(1))
            {
                Open(arg);
            }

            Log.Info("FlowTomator is ready");
        }