Exemplo n.º 1
0
 public void AddNodeRegistry(INodeRegistry registry)
 {
     foreach (var node in registry)
     {
         _nodeTypes = _nodeTypes.Add(new NodeTypeDeclaration(node.Name, node.Type));
     }
 }
Exemplo n.º 2
0
 public RabbitNodeChannelManager(INodeConfiguration nodeConfiguration, INodeHealthMonitor nodeMonitor,
                                 INodeRegistry nodeRegistry, IBus bus)
 {
     NodeConfiguration = nodeConfiguration;
     NodeMonitor       = nodeMonitor;
     NodeRegistry      = nodeRegistry;
     Bus = bus;
 }
Exemplo n.º 3
0
 public RabbitNodeChannelManager( INodeConfiguration nodeConfiguration, INodeHealthMonitor nodeMonitor,
                                  INodeRegistry nodeRegistry, IBus bus )
 {
     NodeConfiguration = nodeConfiguration;
     NodeMonitor = nodeMonitor;
     NodeRegistry = nodeRegistry;
     Bus = bus;
 }
Exemplo n.º 4
0
        // TODO: move this to Extension
        private string GetSimpleNameForRegistry(INodeRegistry registry)
        {
            string registryName = registry.ToString().Replace("NodeRegistry", "").FriendlyNameify();

            registryName = registryName.Substring(registryName.LastIndexOf(".") + 1);
            registryName = registryName.Replace("UnityEngine", "");
            return(registryName);
        }
Exemplo n.º 5
0
 public ScriptViewModel(INodeRegistry registry = null, INodeViewModelFactory viewModelFactory = null,
                        Script script          = null)
 {
     _registry            = registry ?? EmptyNodeRegistry.Instance;
     _viewModelFactory    = viewModelFactory ?? new NodeViewModelFactory(_registry);
     GroupSelectedCommand = new ScriptingCommand(() => GroupSelected())
     {
         CanExecute = false
     };
     UngroupSelectedCommand = new ScriptingCommand(UngroupSelected)
     {
         CanExecute = false
     };
     CopySelectedCommand = new ScriptingCommand(CopySelected)
     {
         CanExecute = false
     };
     CutSelectedCommand = new ScriptingCommand(CutSelected)
     {
         CanExecute = false
     };
     DuplicateSelectedCommand = new ScriptingCommand(DuplicateSelected)
     {
         CanExecute = false
     };
     PasteCommand = new ScriptingCommand(() => Paste())
     {
         CanExecute = true
     };
     UndoCommand = new ScriptingCommand(Undo)
     {
         CanExecute = false
     };
     RedoCommand = new ScriptingCommand(Redo)
     {
         CanExecute = false
     };
     //BindingOperations.SetBinding(UndoCommand, ScriptingCommand.CanExecuteProperty, new Binding
     //{
     //    Path = new PropertyPath(nameof(UndoStackViewModel.CanUndo)),
     //    Source = UndoStack
     //});
     //BindingOperations.SetBinding(RedoCommand, ScriptingCommand.CanExecuteProperty, new Binding
     //{
     //    Path = new PropertyPath(nameof(UndoStackViewModel.CanRedo)),
     //    Source = UndoStack
     //});
     SelectAllCommand      = new ScriptingCommand(SelectAll);
     DeleteSelectedCommand = new ScriptingCommand(DeleteSelected);
     ResetZoomCommand      = new ScriptingCommand(ResetZoom);
     if (script != null)
     {
         SetScript(script);
     }
 }
Exemplo n.º 6
0
 public Server(
     ITransportListener transportListener,
     Func <ITransport, IServerChannel> serverChannelFactory,
     SessionCompression[] enabledCompressionOptions,
     SessionEncryption[] enabledEncryptionOptions,
     AuthenticationScheme[] schemeOptions,
     Func <Identity, Authentication, CancellationToken, Task <AuthenticationResult> > authenticator,
     Func <IChannelInformation, IChannelListener> channelListenerFactory,
     INodeRegistry nodeRegistry = null,
     Func <Exception, Task <bool> > exceptionHandler = null,
     int maxActiveChannels = -1)
 {
     _transportListener         = transportListener ?? throw new ArgumentNullException(nameof(transportListener));
     _serverChannelFactory      = serverChannelFactory ?? throw new ArgumentNullException(nameof(serverChannelFactory));
     _enabledCompressionOptions = enabledCompressionOptions ?? throw new ArgumentNullException(nameof(enabledCompressionOptions));
     _enabledEncryptionOptions  = enabledEncryptionOptions ?? throw new ArgumentNullException(nameof(enabledEncryptionOptions));
     _schemeOptions             = schemeOptions ?? throw new ArgumentNullException(nameof(schemeOptions));
     _authenticator             = authenticator ?? throw new ArgumentNullException(nameof(authenticator));
     _channelListenerFactory    = channelListenerFactory ?? throw new ArgumentNullException(nameof(channelListenerFactory));
     _nodeRegistry      = nodeRegistry ?? new NodeRegistry();
     _exceptionHandler  = exceptionHandler;
     _maxActiveChannels = maxActiveChannels;
     _semaphore         = new SemaphoreSlim(1, 1);
 }
Exemplo n.º 7
0
 public void QueueOpenFocusedSearch(INodeRegistry registry, Vector2 position)
 {
     _searchWindowPosition = position;
     _focusedSearchWindow.targetRegistry = registry;
     EditorApplication.update           += TryOpenFocusedSearch;
 }
Exemplo n.º 8
0
 public NodeViewModelFactory(INodeRegistry registry)
 {
     _registry = registry;
 }
 public string CompileGraph(
     IUdonCompilableGraph graph, INodeRegistry nodeRegistry,
     out Dictionary <string, (string uid, string fullName, int index)> linkedSymbols,
Exemplo n.º 10
0
        override public List <SearchTreeEntry> CreateSearchTree(SearchWindowContext context)
        {
            if (_slowRegistryCache != null && _slowRegistryCache.Count > 0)
            {
                return(_slowRegistryCache);
            }

            _slowRegistryCache = new List <SearchTreeEntry>
            {
                new SearchTreeGroupEntry(new GUIContent("Full Search"), 0)
            };

            var topRegistries = UdonEditorManager.Instance.GetTopRegistries();

            Texture2D icon         = null;
            var       groupEntries = new Dictionary <string, SearchTreeGroupEntry>();

            foreach (var topRegistry in topRegistries)
            {
                string topName = topRegistry.Key.Replace("NodeRegistry", "");

                if (topName != "Udon")
                {
                    _slowRegistryCache.Add(new SearchTreeGroupEntry(new GUIContent(topName), 1));
                }

                // get all registries, save into registryName > INodeRegistry Lookup
                var subRegistries = new Dictionary <string, INodeRegistry>();
                foreach (KeyValuePair <string, INodeRegistry> registry in topRegistry.Value.OrderBy(s => s.Key))
                {
                    string baseRegistryName = registry.Key.Replace("NodeRegistry", "").FriendlyNameify().ReplaceFirst(topName, "");
                    string registryName     = baseRegistryName.UppercaseFirst();
                    subRegistries.Add(registryName, registry.Value);
                }

                // Go through each registry entry and add the top-level registry and associated array registry
                foreach (KeyValuePair <string, INodeRegistry> regEntry in subRegistries)
                {
                    INodeRegistry registry     = regEntry.Value;
                    string        registryName = regEntry.Key;

                    int level = 2;
                    // Special cases for Udon sub-levels, added at top
                    if (topName == "Udon")
                    {
                        level = 1;
                        if (registryName == "Event" || registryName == "Type")
                        {
                            registryName = $"{registryName}s";
                        }
                    }

                    if (!registryName.EndsWith("[]"))
                    {
                        // add Registry Level
                        var groupEntry = new SearchTreeGroupEntry(new GUIContent(registryName, icon), level)
                        {
                            userData = registry
                        };
                        _slowRegistryCache.Add(groupEntry);
                    }

                    // Check for Array Type first
                    string regArrayType = $"{registryName}[]";
                    if (subRegistries.TryGetValue(regArrayType, out INodeRegistry arrayRegistry))
                    {
                        // we have a matching subRegistry, add that next
                        var arrayLevel      = level + 1;
                        var arrayGroupEntry = new SearchTreeGroupEntry(new GUIContent(regArrayType, icon), arrayLevel)
                        {
                            userData = registry
                        };
                        _slowRegistryCache.Add(arrayGroupEntry);

                        // Add all array entries
                        AddEntriesForRegistry(_slowRegistryCache, arrayRegistry, arrayLevel + 1);
                    }

                    AddEntriesForRegistry(_slowRegistryCache, registry, level + 1, true);
                }
            }
            return(_slowRegistryCache);
        }
 // adds all entries so we can use this for regular and array registries
 internal void AddEntriesForRegistry(List <SearchTreeEntry> cache, INodeRegistry registry, int level,
                                     bool stripToLastDot = false)
 {
     AddEntries(cache, registry.GetNodeDefinitions(), level, stripToLastDot);
 }
Exemplo n.º 12
0
 public DataNodeRunner(NodeDefinitionProvider provider, INodeRegistry <TDataItem> registry)
 {
     _provider = provider;
     _registry = registry;
 }
Exemplo n.º 13
0
 public Node(INodeRegistry nodes, IBus bus, INodeConfiguration configuration)
 {
     Nodes         = nodes;
     Bus           = bus;
     Configuration = configuration;
 }
Exemplo n.º 14
0
 public ScriptDialog(Script script, INodeRegistry registry = null, INodeViewModelFactory viewModelFactory = null)
 {
     InitializeComponent();
     this.DataContext = new ScriptViewModel(registry, viewModelFactory, script);
 }
Exemplo n.º 15
0
 public NodeChangeHandler(INodeRegistry registry, INodeChannelManager nodeChannelManager)
 {
     NodeChannelManager = nodeChannelManager;
     Registry           = registry;
 }
Exemplo n.º 16
0
 public ServerBuilder WithNodeRegistry(INodeRegistry nodeRegistry)
 {
     NodeRegistry = nodeRegistry ?? throw new ArgumentNullException(nameof(nodeRegistry));
     return(this);
 }