コード例 #1
0
 public ProjectEventForwarder(OmnisharpWorkspace workspace, [ImportMany] IEnumerable<IProjectSystem> projectSystems, IEventEmitter emitter)
 {
     _projectSystems = projectSystems;
     _workspace = workspace;
     _emitter = emitter;
     _workspace.WorkspaceChanged += OnWorkspaceChanged;
 }
コード例 #2
0
		protected override void OnCreate(Bundle savedInstanceState)
		{
			// When extending the BrightcovePlayer, we must assign the BrightcoveVideoView before
			// entering the superclass. This allows for some stock video player lifecycle
			// management.
			SetContentView(Resource.layout.ima_activity_main);
			brightcoveVideoView = FindViewById<BrightcoveVideoView>(Resource.id.brightcove_video_view);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.brightcove.player.mediacontroller.BrightcoveMediaController mediaController = new com.brightcove.player.mediacontroller.BrightcoveMediaController(brightcoveVideoView);
			BrightcoveMediaController mediaController = new BrightcoveMediaController(brightcoveVideoView);

			// Add "Ad Markers" where the Ads Manager says ads will appear.
			mediaController.AddListener(GoogleIMAEventType.ADS_MANAGER_LOADED, new EventListenerAnonymousInnerClassHelper(this, mediaController));
			brightcoveVideoView.MediaController = mediaController;
			base.onCreate(savedInstanceState);
			eventEmitter = brightcoveVideoView.EventEmitter;

			// Use a procedural abstraction to setup the Google IMA SDK via the plugin.
			setupGoogleIMA();

			IDictionary<string, string> options = new Dictionary<string, string>();
			IList<string> values = new List<string>(Arrays.asList(VideoFields.DEFAULT_FIELDS));
			values.Remove(VideoFields.HLS_URL);
			options["video_fields"] = StringUtil.join(values, ",");

			BrightcoveSDK.Player.Media.Catalog catalog = new Catalog("ErQk9zUeDVLIp8Dc7aiHKq8hDMgkv5BFU7WGshTc-hpziB3BuYh28A..");
			catalog.findVideoByReferenceID("shark", new VideoListenerAnonymousInnerClassHelper(this));
		}
コード例 #3
0
        public DnxProjectSystem(OmnisharpWorkspace workspace,
                                    IOmnisharpEnvironment env,
                                    IOptions<OmniSharpOptions> optionsAccessor,
                                    ILoggerFactory loggerFactory,
                                    IMetadataFileReferenceCache metadataFileReferenceCache,
                                    IApplicationLifetime lifetime,
                                    IFileSystemWatcher watcher,
                                    IEventEmitter emitter,
                                    DnxContext context)
        {
            _workspace = workspace;
            _env = env;
            _logger = loggerFactory.CreateLogger<DnxProjectSystem>();
            _metadataFileReferenceCache = metadataFileReferenceCache;
            _options = optionsAccessor.Options;
            _dnxPaths = new DnxPaths(env, _options, loggerFactory);
            _designTimeHostManager = new DesignTimeHostManager(loggerFactory, _dnxPaths);
            _packagesRestoreTool = new PackagesRestoreTool(_options, loggerFactory, emitter, context, _dnxPaths);
            _context = context;
            _watcher = watcher;
            _emitter = emitter;
            _directoryEnumerator = new DirectoryEnumerator(loggerFactory);

            lifetime.ApplicationStopping.Register(OnShutdown);
        }
コード例 #4
0
 public ProjectEventForwarder(DnxContext dnxContext, MSBuildContext msbuildContext, OmnisharpWorkspace workspace, IEventEmitter emitter)
 {
     _dnxContext = dnxContext;
     _msbuildContext = msbuildContext;
     _workspace = workspace;
     _emitter = emitter;
     _workspace.WorkspaceChanged += OnWorkspaceChanged;
 }
コード例 #5
0
        public PackagesRestoreTool(ILoggerFactory logger, IEventEmitter emitter)
        {
            _logger = logger.CreateLogger<PackagesRestoreTool>();
            _emitter = emitter;

            _projectLocks = new ConcurrentDictionary<string, object>();
            _semaphore = new SemaphoreSlim(Environment.ProcessorCount / 2);
        }
コード例 #6
0
 public DnxTestCommandProvider(DnxContext context,
                                   IOmnisharpEnvironment env,
                                   ILoggerFactory loggerFactory,
                                   IEventEmitter emitter)
 {
     _context = context;
     var dnxPaths = new DnxPaths(env, context.Options, loggerFactory);
     _dnx = dnxPaths.Dnx != null ? dnxPaths.Dnx + " ." : dnxPaths.K;
 }
コード例 #7
0
        protected ChainedEventEmitter(IEventEmitter nextEmitter)
        {
            if (nextEmitter == null)
            {
                throw new ArgumentNullException("nextEmitter");
            }

            this.nextEmitter = nextEmitter;
        }
コード例 #8
0
 public PackagesRestoreTool(OmniSharpOptions options, ILoggerFactory logger, IEventEmitter emitter, DnxContext context, DnxPaths paths)
 {
     _options = options;
     _logger = logger.CreateLogger<PackagesRestoreTool>();
     _emitter = emitter;
     _context = context;
     _paths = paths;
     _lock = new object();
     _projectLocks = new Dictionary<string, object>();
     _semaphore = new SemaphoreSlim(Environment.ProcessorCount / 2);
 }
コード例 #9
0
ファイル: Robot.cs プロジェクト: martinskuta/Nubot
        public Robot(string name, ILogger logger, IEventEmitter eventEmitter)
        {
            Name = name;
            Logger = logger;
            EventEmitter = eventEmitter;

            Version = "1.0"; //todo replace harcoding of the version number

            _listeners = new List<Listener>();

            Settings = new AppSettings();

            _compositionManager = new CompositionManager(this);
        }
コード例 #10
0
 public MSBuildProjectSystem(OmnisharpWorkspace workspace,
                             IOmnisharpEnvironment env,
                             ILoggerFactory loggerFactory,
                             IEventEmitter emitter,
                             IMetadataFileReferenceCache metadataReferenceCache,
                             IFileSystemWatcher watcher,
                             MSBuildContext context)
 {
     _workspace = workspace;
     _metadataReferenceCache = metadataReferenceCache;
     _watcher = watcher;
     _env = env;
     _logger = loggerFactory.CreateLogger<MSBuildProjectSystem>();
     _emitter = emitter;
     _context = context;
 }
コード例 #11
0
        public DotNetProjectSystem(IOmnisharpEnvironment environment,
                                   OmnisharpWorkspace omnisharpWorkspace,
                                   IMetadataFileReferenceCache metadataFileReferenceCache,
                                   ILoggerFactory loggerFactory,
                                   IFileSystemWatcher watcher,
                                   IEventEmitter emitter)
        {
            _environment = environment;
            _omnisharpWorkspace = omnisharpWorkspace;
            _logger = loggerFactory.CreateLogger<DotNetProjectSystem>();
            _emitter = emitter;
            _metadataFileReferenceCache = metadataFileReferenceCache;
            _watcher = watcher;

            _packageRestore = new PackagesRestoreTool(loggerFactory, _emitter);
            _projectStates = new ProjectStatesCache(loggerFactory);
        }
コード例 #12
0
        private IObjectGraphVisitor CreateEmittingVisitor(IEmitter emitter, IObjectGraphTraversalStrategy traversalStrategy, IEventEmitter eventEmitter, IObjectDescriptor graph)
        {
            IObjectGraphVisitor emittingVisitor = new EmittingObjectGraphVisitor(eventEmitter);

            emittingVisitor = new CustomSerializationObjectGraphVisitor(emitter, emittingVisitor, Converters);

            if (!IsOptionSet(SerializationOptions.DisableAliases))
            {
                var anchorAssigner = new AnchorAssigner();
                traversalStrategy.Traverse(graph, anchorAssigner);

                emittingVisitor = new AnchorAssigningObjectGraphVisitor(emittingVisitor, eventEmitter, anchorAssigner);
            }

            if (!IsOptionSet(SerializationOptions.EmitDefaults))
            {
                emittingVisitor = new DefaultExclusiveObjectGraphVisitor(emittingVisitor);
            }

            return emittingVisitor;
        }
コード例 #13
0
        public DnxProjectSystem(OmnisharpWorkspace workspace,
                                IOmnisharpEnvironment env,
                                ILoggerFactory loggerFactory,
                                IMetadataFileReferenceCache metadataFileReferenceCache,
                                IApplicationLifetime lifetime,
                                IFileSystemWatcher watcher,
                                IEventEmitter emitter,
                                DnxContext context)
        {
            _workspace = workspace;
            _env = env;
            _loggerFactory = loggerFactory;
            _logger = loggerFactory.CreateLogger<DnxProjectSystem>();
            _metadataFileReferenceCache = metadataFileReferenceCache;
            _context = context;
            _watcher = watcher;
            _emitter = emitter;
            _directoryEnumerator = new DirectoryEnumerator(loggerFactory);

            lifetime?.ApplicationStopping.Register(OnShutdown);
        }
コード例 #14
0
		public TypeAssigningEventEmitter(IEventEmitter nextEmitter, bool assignTypeWhenDifferent)
			: base(nextEmitter)
		{
			_assignTypeWhenDifferent = assignTypeWhenDifferent;
		}
コード例 #15
0
 public async Task HandleEventAsync(IEventEmitter emitter, PlayerConnectedEvent @event)
 {
     await((UconomyEconomyProvider)Container.Resolve <IEconomyProvider>()).CreateAccountAsync(@event.Player.User);
 }
コード例 #16
0
 public CustomTagEventEmitter(IEventEmitter inner, IDictionary<Type, string> tagMappings)
     : base(inner)
 {
     this.tagMappings = tagMappings;
 }
コード例 #17
0
 public void SetEmitter(IEventEmitter e)
 {
     Emitter = e;
 }
コード例 #18
0
 public VSTestManager(Project project, string workingDirectory, IDotNetCliService dotNetCli, SemanticVersion dotNetCliVersion, IEventEmitter eventEmitter, ILoggerFactory loggerFactory)
     : base(project, workingDirectory, dotNetCli, dotNetCliVersion, eventEmitter, loggerFactory.CreateLogger <VSTestManager>())
 {
 }
コード例 #19
0
        public void Emit(IEventEmitter sender, IEvent @event, EventExecutedCallback callback = null)
        {
            if (!sender.IsAlive)
            {
                return;
            }

            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }

            if (@event == null)
            {
                throw new ArgumentNullException(nameof(@event));
            }

            string eventNameString = "[" + string.Join(", ", @event.Names.ToArray()) + "]" + " by \"" + sender.Name + "\"";
            string primaryName     = @event.Names.First();

            logger?.LogTrace(eventNameString + ": Emitting.");

            inProgress.Add(@event);

            List <EventAction> actions =
                eventListeners
                .Where(c => c.TargetEventType?.IsInstanceOfType(@event)
                       ?? @event.Names.Any(d => c.TargetEventNames.Any(e => d.Equals(e, StringComparison.OrdinalIgnoreCase))) &&
                       c.Owner.IsAlive)
                .ToList();

            actions.Sort((a, b) => ServicePriorityComparer.Compare(a.Handler.Priority, b.Handler.Priority));

            List <EventAction> targetActions =
                (from info in actions
                 /* ignore cancelled events */
                 where !(@event is ICancellableEvent) ||
                 !((ICancellableEvent)@event).IsCancelled ||
                 info.Handler.IgnoreCancelled
                 where CheckEmitter(info, sender.Name, @event.IsGlobal)
                 where CheckEvent(info, @event.Names)
                 select info)
                .ToList();

            void FinishEvent()
            {
                logger?.LogTrace(eventNameString + ": Finished.");
                inProgress.Remove(@event);
                callback?.Invoke(@event);
            }

            if (targetActions.Count == 0)
            {
                logger?.LogTrace(eventNameString + ": No listeners found.");
                FinishEvent();
                return;
            }

            container.TryResolve(null, out ITaskScheduler scheduler);
            if (scheduler == null && @event.ExecutionTarget != EventExecutionTargetContext.Sync)
            {
                FinishEvent();
                return;
            }

            int executionCount = 0;

            foreach (EventAction info in targetActions)
            {
                Util.WeakReference <ILifecycleObject> wk = info.Owner;
                if (!wk.IsAlive)
                {
                    actions.Remove(info);
                    continue;
                }

                var pl = wk.Target;

                if (scheduler == null)
                {
                    info.Action.Invoke(sender, @event);
                    continue;
                }

                scheduler.ScheduleUpdate(pl, () =>
                {
                    executionCount++;
                    info.Action.Invoke(sender, @event);

                    //all actions called; run OnEventExecuted
                    if (executionCount == targetActions.Count)
                    {
                        FinishEvent();
                    }
                }, primaryName + "EmitTask", (ExecutionTargetContext)@event.ExecutionTarget);
            }

            if (scheduler == null)
            {
                FinishEvent();
            }
        }
コード例 #20
0
 public WeatherEntropyExtractor(IEventEmitter eventEmitter) : base(eventEmitter)
 {
 }
コード例 #21
0
 public QuoteStringEventEmitter(IEventEmitter nextEmitter) : base(nextEmitter)
 {
 }
 public CreateUpdateConceptoCommandHandler(ConceptosContext dbContext, IEventEmitter eventEmitter, ICommandEventConverter converter)
 {
     this._dbContext    = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     this._eventEmitter = eventEmitter ?? throw new ArgumentNullException(nameof(eventEmitter));
     this._converter    = converter ?? throw new ArgumentNullException(nameof(converter));
 }
コード例 #23
0
        public void HandleEvent(IEventEmitter emitter, UnturnedPlayerDeathEvent @event)
        {
            var player = (UnturnedPlayer)@event.Player;

            UnturnedPlayer killer = ((UnturnedPlayerEntity)@event.Killer).Player;
            var            cause  = @event.DeathCause;
            var            limb   = @event.Limb;

            var deathmessageColor = Color.Red; //ConfigurationInstance.DeathMessagesColor;


            string headshot = Translations.Get("headshot");

            if (cause.ToString() == "SHRED" || cause.ToString() == "ZOMBIE" || cause.ToString() == "ANIMAL" ||
                cause.ToString() == "SPARK" || cause.ToString() == "VEHICLE" || cause.ToString() == "FOOD" ||
                cause.ToString() == "WATER" || cause.ToString() == "INFECTION" || cause.ToString() == "BLEEDING" ||
                cause.ToString() == "LANDMINE" || cause.ToString() == "BREATH" || cause.ToString() == "KILL" ||
                cause.ToString() == "FREEZING" || cause.ToString() == "SENTRY" || cause.ToString() == "CHARGE" ||
                cause.ToString() == "MISSILE" || cause.ToString() == "BONES" || cause.ToString() == "SPLASH" ||
                cause.ToString() == "ACID" || cause.ToString() == "SPIT" || cause.ToString() == "BURNING" ||
                cause.ToString() == "BURNER" || cause.ToString() == "BOULDER" || cause.ToString() == "ARENA" ||
                cause.ToString() == "GRENADE" ||
                (ConfigurationInstance.ShowSuicideMSG && cause.ToString() == "SUICIDE") ||
                cause.ToString() == "ROADKILL" || cause.ToString() == "MELEE" || cause.ToString() == "GUN" ||
                cause.ToString() == "PUNCH")
            {
                if (cause.ToString() != "ROADKILL" && cause.ToString() != "MELEE" && cause.ToString() != "GUN" &&
                    cause.ToString() != "PUNCH")
                {
                    _userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName);
                }
                else if (cause.ToString() == "ROADKILL")
                {
                    _userManager.BroadcastLocalized(Translations, "roadkill", deathmessageColor, player.DisplayName, killer.DisplayName);
                }
                else if (cause.ToString() == "MELEE" || cause.ToString() == "GUN")
                {
                    if (limb == ELimb.SKULL)
                    {
                        _userManager.BroadcastLocalized(Translations, cause.ToString().ToLower() + "_headshot", deathmessageColor, player.DisplayName, killer.DisplayName, headshot, killer.NativePlayer.equipment.asset.itemName);
                    }
                    else
                    {
                        _userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, killer.DisplayName, headshot, killer.NativePlayer.equipment.asset.itemName);
                    }
                }
                else if (cause.ToString() == "PUNCH")
                {
                    _userManager.BroadcastLocalized(Translations,
                                                    limb == ELimb.SKULL ? "punch_headshot" : "punch", deathmessageColor, player.DisplayName, killer.DisplayName, headshot);
                }

                return;
            }

            if (Translations.Get(cause.ToString().ToLower()) != null)
            {
                if (Translations.Get(cause.ToString().ToLower()).Contains("{1}"))
                {
                    _userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, killer.DisplayName, headshot);
                }
                else
                {
                    _userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, headshot);
                }

                return;
            }

            Logger.LogError("Please add translation for " + cause +
                            " | Parameters for custom translation: {0} = Player , {1} = Killer");
        }
コード例 #24
0
 public EmittingObjectGraphVisitor(IEventEmitter eventEmitter)
 {
     this.eventEmitter = eventEmitter;
 }
コード例 #25
0
 /// <summary>
 /// Sets the MvvmLightMessenger's default (static) instance to null.
 /// </summary>
 public static void Reset()
 {
     _defaultInstance = null;
 }
コード例 #26
0
 /// <summary>
 /// Provides a way to override the MvvmLightMessenger.Default instance with
 /// a custom instance, for example for unit testing purposes.
 /// </summary>
 /// <param name="newEventEmitter">The instance that will be used as MvvmLightMessenger.Default.</param>
 public static void OverrideDefault(IEventEmitter newEventEmitter)
 {
     _defaultInstance = newEventEmitter;
 }
コード例 #27
0
 protected TestManager(Project project, string workingDirectory, DotNetCliService dotNetCli, SemanticVersion dotNetCliVersion, IEventEmitter eventEmitter, ILogger logger)
 {
     Project          = project ?? throw new ArgumentNullException(nameof(project));
     WorkingDirectory = workingDirectory ?? throw new ArgumentNullException(nameof(workingDirectory));
     DotNetCli        = dotNetCli ?? throw new ArgumentNullException(nameof(dotNetCli));
     DotNetCliVersion = dotNetCliVersion ?? throw new ArgumentNullException(nameof(dotNetCliVersion));
     EventEmitter     = eventEmitter ?? throw new ArgumentNullException(nameof(eventEmitter));
     Logger           = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #28
0
 protected BaseTestService(OmniSharpWorkspace workspace, IDotNetCliService dotNetCli, IEventEmitter eventEmitter, ILoggerFactory loggerFactory)
 {
     Workspace     = workspace;
     DotNetCli     = dotNetCli;
     EventEmitter  = eventEmitter;
     LoggerFactory = loggerFactory;
 }
コード例 #29
0
 public ProjectEventForwarder(AspNet5Context aspnet5Context, MSBuildContext msbuildContext, OmnisharpWorkspace workspace, IEventEmitter emitter)
 {
     _aspnet5Context              = aspnet5Context;
     _msbuildContext              = msbuildContext;
     _workspace                   = workspace;
     _emitter                     = emitter;
     _workspace.WorkspaceChanged += OnWorkspaceChanged;
 }
コード例 #30
0
 public OrderRepository(ICommandEventConverter converter, IEventEmitter eventEmitter, IOrderContext orderContext)
 {
     _dbContext    = orderContext;
     _converter    = converter;
     _eventEmitter = eventEmitter;
 }
コード例 #31
0
 /// <summary>
 /// Create twin services
 /// </summary>
 /// <param name="client"></param>
 /// <param name="events"></param>
 public TwinServices(IEndpointServices client, IEventEmitter events)
 {
     _client = client ?? throw new ArgumentNullException(nameof(client));
     _events = events ?? throw new ArgumentNullException(nameof(events));
 }
コード例 #32
0
 public Startup(IOmniSharpEnvironment environment, IEventEmitter eventEmitter, ISharedTextWriter writer)
 {
     _environment   = environment;
     _eventEmitter  = eventEmitter;
     _configuration = new ConfigurationBuilder(environment).Build();
 }
コード例 #33
0
ファイル: TestUnitOfWork.cs プロジェクト: joshilewis/lending
 public TestUnitOfWork(IEventStoreConnection eventStoreConnection, IEventEmitter eventEmitter)
     : base(eventStoreConnection, eventEmitter)
 {
 }
 public AnchorAssigningObjectGraphVisitor(IObjectGraphVisitor <IEmitter> nextVisitor, IEventEmitter eventEmitter, IAliasProvider aliasProvider)
     : base(nextVisitor)
 {
     this.eventEmitter  = eventEmitter;
     this.aliasProvider = aliasProvider;
 }
コード例 #35
0
 protected EventStoreUnitOfWork(IEventStoreConnection eventStoreConnection, IEventEmitter eventEmitter)
 {
     this.eventEmitter = eventEmitter;
     connection = eventStoreConnection;
     transactionId = Guid.NewGuid();
 }
コード例 #36
0
 public DebugTestsInContextService(DebugSessionManager debugSessionManager, OmniSharpWorkspace workspace, IDotNetCliService dotNetCli, IEventEmitter eventEmitter, ILoggerFactory loggerFactory)
     : base(workspace, dotNetCli, eventEmitter, loggerFactory)
 {
     _debugSessionManager = debugSessionManager;
 }
コード例 #37
0
ファイル: Serializer.cs プロジェクト: aaubry/YamlDotNet
            private IObjectGraphVisitor<IEmitter> CreateEmittingVisitor(IEmitter emitter, IObjectGraphTraversalStrategy traversalStrategy, IEventEmitter eventEmitter, IObjectDescriptor graph)
            {
                IObjectGraphVisitor<IEmitter> emittingVisitor = new EmittingObjectGraphVisitor(eventEmitter);

                ObjectSerializer nestedObjectSerializer = (v, t) => SerializeValue(emitter, v, t);

                emittingVisitor = new CustomSerializationObjectGraphVisitor(emittingVisitor, Converters, nestedObjectSerializer);

                if (!IsOptionSet(SerializationOptions.DisableAliases))
                {
                    var anchorAssigner = new AnchorAssigner(Converters);
                    traversalStrategy.Traverse<Nothing>(graph, anchorAssigner, null);

                    emittingVisitor = new AnchorAssigningObjectGraphVisitor(emittingVisitor, eventEmitter, anchorAssigner);
                }

                if (!IsOptionSet(SerializationOptions.EmitDefaults))
                {
                    emittingVisitor = new DefaultExclusiveObjectGraphVisitor(emittingVisitor);
                }

                return emittingVisitor;
            }
コード例 #38
0
 public RolePermissionsUpdatedEvent(IEventEmitter emitter) : base(emitter)
 {
 }
コード例 #39
0
        public static TestManager Create(Project project, DotNetCliService dotNetCli, IEventEmitter eventEmitter, ILoggerFactory loggerFactory)
        {
            var workingDirectory = Path.GetDirectoryName(project.FilePath);

            var version = dotNetCli.GetVersion(workingDirectory);

            return(dotNetCli.IsLegacy(version)
                ? new LegacyTestManager(project, workingDirectory, dotNetCli, version, eventEmitter, loggerFactory)
                : (TestManager) new VSTestManager(project, workingDirectory, dotNetCli, version, eventEmitter, loggerFactory));
        }
コード例 #40
0
ファイル: Serializer.cs プロジェクト: bennidhamma/YamlDotNet
        private IObjectGraphVisitor CreateEmittingVisitor(Emitter emitter, SerializationOptions options, IObjectGraphTraversalStrategy traversalStrategy, IEventEmitter eventEmitter, object graph, Type type)
        {
            IObjectGraphVisitor emittingVisitor = new EmittingObjectGraphVisitor(eventEmitter);

            emittingVisitor = new CustomSerializationObjectGraphVisitor(emitter, emittingVisitor, converters);

            if ((options & SerializationOptions.DisableAliases) == 0)
            {
                var anchorAssigner = new AnchorAssigner();
                traversalStrategy.Traverse(graph, type, anchorAssigner);

                emittingVisitor = new AnchorAssigningObjectGraphVisitor(emittingVisitor, eventEmitter, anchorAssigner);
            }

            if ((options & SerializationOptions.EmitDefaults) == 0)
            {
                emittingVisitor = new DefaultExclusiveObjectGraphVisitor(emittingVisitor);
            }

            return emittingVisitor;
        }
コード例 #41
0
 public TestEntropyExtractor(Func <byte[]> extractionLogic, IEventEmitter eventEmitter) : base(eventEmitter) =>
     this.extractionLogic = extractionLogic;
コード例 #42
0
 public EventStoreUnitOfWork(string eventStoreIpAddress, int port, IEventEmitter eventEmitter)
     : this(EventStoreConnection.Create(new IPEndPoint(IPAddress.Parse(eventStoreIpAddress), port)), eventEmitter)
 {
 }
コード例 #43
0
        public MemberLocationEventProcessor(ILogger <MemberLocationEventProcessor> logger, IEventSubscriber eventSubscriber, IEventEmitter eventEmitter, ILocationCache locationCache)
        {
            this.logger            = logger;
            this.subscriber        = eventSubscriber;
            this.eventEmitter      = eventEmitter;
            this.proximityDetector = new ProximityDetector();
            this.locationCache     = locationCache;

            this.subscriber.MemberLocationRecordedEventReceived += (mlre) => {
                var memberLocations = locationCache.GetMemberLocations(mlre.TeamID);

                ICollection <ProximityDetectedEvent> proximityEvents = proximityDetector.DetectProximityEvents(mlre, memberLocations, 30.0f);
                foreach (var proximityEvent in proximityEvents)
                {
                    eventEmitter.EmitProximityDetectedEvent(proximityEvent);
                }

                locationCache.Put(mlre.TeamID, new MemberLocation
                {
                    MemberID = mlre.MemberID,
                    Location = new GpsCoordinate
                    {
                        Latitude  = mlre.Latitude,
                        Longitude = mlre.Longitude
                    }
                });
            };
        }
コード例 #44
0
 public TypeAssigningEventEmitter(IEventEmitter nextEmitter)
     : base(nextEmitter)
 {
 }
コード例 #45
0
ファイル: YamlSerializer.cs プロジェクト: rpatel2013/docfx
        private IObjectGraphVisitor <IEmitter> CreateEmittingVisitor(IEmitter emitter, IObjectGraphTraversalStrategy traversalStrategy, IEventEmitter eventEmitter, IObjectDescriptor graph)
        {
            IObjectGraphVisitor <IEmitter> emittingVisitor = new EmittingObjectGraphVisitor(eventEmitter);

            ObjectSerializer nestedObjectSerializer = (v, t) => SerializeValue(emitter, v, t);

            emittingVisitor = new CustomSerializationObjectGraphVisitor(emittingVisitor, Converters, nestedObjectSerializer);

            if (!IsOptionSet(SerializationOptions.DisableAliases))
            {
                var anchorAssigner = new AnchorAssigner(Converters);
                traversalStrategy.Traverse <Nothing>(graph, anchorAssigner, null);

                emittingVisitor = new AnchorAssigningObjectGraphVisitor(emittingVisitor, eventEmitter, anchorAssigner);
            }

            if (!IsOptionSet(SerializationOptions.EmitDefaults))
            {
                emittingVisitor = new DefaultExclusiveObjectGraphVisitor(emittingVisitor);
            }

            return(emittingVisitor);
        }
コード例 #46
0
		public AnchorAssigningObjectGraphVisitor(IObjectGraphVisitor nextVisitor, IEventEmitter eventEmitter, IAliasProvider aliasProvider)
			: base(nextVisitor)
		{
			this.eventEmitter = eventEmitter;
			this.aliasProvider = aliasProvider;
		}
コード例 #47
0
        public static TestManager Start(Project project, IDotNetCliService dotNetCli, IEventEmitter eventEmitter, ILoggerFactory loggerFactory, bool noBuild)
        {
            var manager = Create(project, dotNetCli, eventEmitter, loggerFactory);

            manager.Connect(noBuild);
            return(manager);
        }
コード例 #48
0
		public EmittingObjectGraphVisitor(IEventEmitter eventEmitter)
		{
			this.eventEmitter = eventEmitter;
		}
コード例 #49
0
 public TypeAssigningEventEmitter(IEventEmitter nextEmitter, bool assignTypeWhenDifferent)
     : base(nextEmitter)
 {
     _assignTypeWhenDifferent = assignTypeWhenDifferent;
 }
コード例 #50
0
 public AnchorEventEmitter(IEventEmitter nextEmitter)
     : base(nextEmitter)
 {
 }
コード例 #51
0
        private IObjectGraphVisitor CreateEmittingVisitor(IEmitter emitter, IObjectGraphTraversalStrategy traversalStrategy, IEventEmitter eventEmitter, IObjectDescriptor graph)
        {
            IObjectGraphVisitor emittingVisitor = new EmittingObjectGraphVisitor(eventEmitter);

            emittingVisitor = new CustomSerializationObjectGraphVisitor(emitter, emittingVisitor, Converters);

            if (!IsOptionSet(SerializationOptions.DisableAliases))
            {
                var anchorAssigner = new AnchorAssigner();
                traversalStrategy.Traverse(graph, anchorAssigner);

                emittingVisitor = new AnchorAssigningObjectGraphVisitor(emittingVisitor, eventEmitter, anchorAssigner);
            }

            if (!IsOptionSet(SerializationOptions.EmitDefaults))
            {
                emittingVisitor = new DefaultExclusiveObjectGraphVisitor(emittingVisitor);
            }

            return(emittingVisitor);
        }
コード例 #52
0
 public NewResourceActionAddedEvent(IEventEmitter emitter) : base(emitter)
 {
 }
コード例 #53
0
        public static TestManager Create(Project project, IDotNetCliService dotNetCli, IEventEmitter eventEmitter, ILoggerFactory loggerFactory)
        {
            var workingDirectory = Path.GetDirectoryName(project.FilePath);

            var version = dotNetCli.GetVersion(workingDirectory);

            if (dotNetCli.IsLegacy(version))
            {
                throw new NotSupportedException("Legacy .NET SDK is not supported");
            }

            return((TestManager) new VSTestManager(project, workingDirectory, dotNetCli, version, eventEmitter, loggerFactory));
        }
コード例 #54
0
 public JsonEventEmitter(IEventEmitter nextEmitter)
     : base(nextEmitter)
 {
 }
コード例 #55
0
ファイル: JsonEventEmitter.cs プロジェクト: roji/YamlDotNet
 public JsonEventEmitter(IEventEmitter nextEmitter)
     : base(nextEmitter)
 {
 }