Exemplo n.º 1
0
 public HighAvailabilityModeSwitcher(SwitchToSlave switchToSlave, SwitchToMaster switchToMaster, Election election, ClusterMemberAvailability clusterMemberAvailability, ClusterClient clusterClient, System.Func <StoreId> storeIdSupplier, InstanceId instanceId, ComponentSwitcher componentSwitcher, DataSourceManager neoStoreDataSourceSupplier, LogService logService)
 {
     this._switchToSlave             = switchToSlave;
     this._switchToMaster            = switchToMaster;
     this._election                  = election;
     this._clusterMemberAvailability = clusterMemberAvailability;
     this._clusterClient             = clusterClient;
     this._storeIdSupplier           = storeIdSupplier;
     this._instanceId                = instanceId;
     this._componentSwitcher         = componentSwitcher;
     this._msgLog  = logService.GetInternalLog(this.GetType());
     this._userLog = logService.GetUserLog(this.GetType());
     this._neoStoreDataSourceSupplier = neoStoreDataSourceSupplier;
     this._haCommunicationLife        = new LifeSupport();
 }
Exemplo n.º 2
0
        public MainWindowModel(string key)
        {
            Switcher     = new ComponentSwitcher();
            PasswordForm = new PasswordItem();
            KeyPassword  = Encryptor.HashedKeyByMD5(key);
            SetUserFavicon();
            UpdateTagList();

            // Commands
            CloseCommand              = new RelayCommand(Close);
            ShowAddNewPwFormCommand   = new RelayCommand(ShowAddNewPwForm);
            AddNewPasswordCommand     = new RelayCommand(AddNewPassword);
            SelectPasswordItemCommand = new RelayCommand <PasswordItem>(t => SelectPasswordItem(t));
            CopyCommand               = new RelayCommand <string>(t => Copy(t));
            OpenWeblinkCommand        = new RelayCommand(OpenWeblink);
            UpdateCommand             = new RelayCommand(Update);
            UpdateOKCommand           = new RelayCommand(UpdateOK);
            DeletePasswordItemCommand = new RelayCommand(DeletePasswordItem);
            SearchCommand             = new RelayCommand <string>(t => Search(t));
            AboutCommand              = new RelayCommand(About);
            OpenCSVFileCommand        = new RelayCommand(OpenCSVFile);
        }
Exemplo n.º 3
0
        public VisHost(Player.Player player)
            : base(
                GameWindowSettings.Default,
                //new GameWindowSettings {
                //    IsMultiThreaded = false,
                //    UpdateFrequency = 120
                //},
                new NativeWindowSettings
        {
            Size       = new Vector2i(1600, 900),
            APIVersion = new Version(4, 5),
            Profile    = ContextProfile.Compatability,
            Flags      = ContextFlags.Default,
            Title      = "NeuralBeat3",
            API        = ContextAPI.OpenGL
        })
        {
            Player = player;


            //TargetRenderFrequency = 144f;
            //this.RenderFrequency = 144.0;
            VSync = VSyncMode.On;

            UpdateFrame += VisHost_UpdateFrame;
            RenderFrame += VisHost_RenderFrame;
            Load        += VisHost_Load;
            Unload      += VisHost_Unload;
            Resize      += VisHost_Resize;
            Closed      += VisHost_Closed;
            Closing     += VisHost_Closing;

            //Keyboard.KeyDown += Keyboard_KeyDown;
            //Keyboard.KeyUp += Keyboard_KeyUp;
            this.KeyDown += Keyboard_KeyDown;
            this.KeyUp   += Keyboard_KeyUp;

            // set default shader loader
            ShaderProgram.DefaultLoader = new OpenTKExtensions.Loaders.MultiPathFileSystemLoader(SHADERPATH);


            // framedata setup
            frameData.GlobalTextures = globalTextures;

            // create components
            //components.Add(font = new Font(@"res\font\calibrib.ttf_sdf.2048.png", @"res\font\calibrib.ttf_sdf.2048.txt"), 1);
            components.Add(font            = new Font(@"res\font\lucon.ttf_sdf.1024.png", @"res\font\lucon.ttf_sdf.1024.txt"), 1);
            components.Add(text            = new TextManager("texmgr", font), 2);
            components.Add(keyboardActions = new KeyboardActionManager()
            {
                KeyboardPriority = int.MaxValue
            }, 1);
            components.Add(globalTextures);
            components.Add(frameCounter = new OpenTKExtensions.Components.FrameCounter(font));
            components.Add(switcher     = new ComponentSwitcher()
            {
                KeyForward = new KeySpec(Keys.Tab), KeyBackward = new KeySpec(Keys.Tab, KeyModifiers.Shift)
            });

            switcher.Add(new Renderers.AnalysisDebugRenderer(font, Player));
            switcher.Add(new Renderers.BasicShaderRenderer());
            switcher.Add(new Renderers.ParticleRenderer());

            var graph = new ComponentGraph();

            graph.Add(new ParticleNode()
            {
                Name = "particles"
            });
            graph.Add(new ScreenOutputNode()
            {
                Name = "output"
            });;
            graph.AddEdge(new NodePortReference()
            {
                Node = "particles", Port = "tex"
            }, new NodePortReference()
            {
                Node = "output", Port = "tex"
            });

            switcher.Add(graph);


            //Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
        }
Exemplo n.º 4
0
 public virtual void Add(ComponentSwitcher componentSwitcher)
 {
     _componentSwitchers.Add(componentSwitcher);
 }