コード例 #1
0
        public IWatchNotification GetWatchWindow(string ID, IWatchList Watches)
        {
            string ActualID = ID.Remove(0, SourceConstants.ID_PREFIX.Length);

            //create a watch window
            return new MFBWatchNotification(mIncidentList.GetIncidentDictionary()[ActualID], Watches, mOptions, this);
        }
コード例 #2
0
        public WatchNotification(IncidentItem inciItem, IWatchList parent, CFAIncidentSourceOptions progOptions, CFAIncidentSource ParentSource)
        {
            InitializeComponent();

            mIncidentItem = inciItem;
            mParent = parent;
            mProgramOptions = progOptions;
            mParentSource = ParentSource;

            mfFadeOut = true;

            if (inciItem.Responsible == "DSE")
            {
                //Swap the background image
                this.BackgroundImage = dseImageDummy.BackgroundImage;
            }

            //Check if a stream exists for this region
            if (String.IsNullOrEmpty(mProgramOptions.GetRegionStream(mIncidentItem.Region)) == true ||
                String.IsNullOrEmpty(mParentSource.GetIncidentWatcher().GetStreamListenerPath()) == true)
            {
                btn2.Visible = false;
            }
            else
            {
                btn2.Visible = true;

                //If we have it set to open the stream
                if (mParentSource.GetIncidentWatcher().GetAutoOpenStreamOnWatch() == true)
                {
                    OpenStream();
                }
            }
        }
コード例 #3
0
        internal SimpleWatcher(SimpleIncident incident, IWatchList parent)
        {
            InitializeComponent();

            mParent = parent;
            mIncident = incident;
        }
コード例 #4
0
        public async Task <IWatchList> AddCustomAsync(string userId, IWatchList watchList)
        {
            await _customWatchListRepository.UpsertAsync(userId, watchList);

            await ReLoadCustomWatchListToNoSqlCache(userId);

            return(watchList);
        }
コード例 #5
0
        public async Task UpsertAsync(IWatchList watchList)
        {
            var entity = Mapper.Map <PredefinedWatchListEntity>(watchList);

            entity.PartitionKey = GetPartitionKey();
            entity.RowKey       = GetRowKey(watchList.Id);

            await _predefinedWatchListTable.InsertOrReplaceAsync(entity);
        }
コード例 #6
0
        public async Task <IWatchList> AddPredefinedAsync(IWatchList watchList)
        {
            await _predefinedWatchListRepository.UpsertAsync(watchList);

            await _myNoSqlWriterPredefined.TryInsertOrReplaceAsync(WatchListPredefinedNoSql.Create(watchList));


            return(watchList);
        }
コード例 #7
0
        public async Task UpsertAsync(string userId, IWatchList watchList)
        {
            var entity = Mapper.Map <CustomWatchListEntity>(watchList);

            entity.PartitionKey = GetPartitionKey(userId);
            entity.RowKey       = GetRowKey(watchList.Id);

            await _customWatchListTable.InsertOrReplaceAsync(entity);
        }
コード例 #8
0
        public bool Initialize(IIncidentWatcher IncidentWatcher, IWatchList Watches)
        {
            mIncidentWatcher = IncidentWatcher;
            mWatchList = Watches;
            mOptions = new MFBIncidentSourceOptions();

            //Create a new Incident List
            mIncidentList = new MFBIncidentItemList(this);

            return true;
        }
コード例 #9
0
 public static WatchListModel ToApiModel(this IWatchList watchList)
 {
     return(new WatchListModel
     {
         Id = watchList.Id,
         Name = watchList.Name,
         Order = watchList.Order,
         ReadOnlyProperty = watchList.ReadOnly,
         AssetPairIds = watchList.AssetIds ?? new List <string>()
     });
 }
コード例 #10
0
 public static WatchListPredefinedNoSql Create(IWatchList watchList)
 {
     return(new WatchListPredefinedNoSql()
     {
         PartitionKey = GeneratePartitionKey(),
         RowKey = GenerateRowKey(watchList.Id),
         Id = watchList.Id,
         Name = watchList.Name,
         Order = watchList.Order,
         ReadOnly = watchList.ReadOnly,
         AssetIds = watchList.AssetIds.ToList()
     });
 }
コード例 #11
0
 public static WatchListCustomNoSql Create(string clientId, IWatchList watchList)
 {
     return(new WatchListCustomNoSql()
     {
         PartitionKey = GeneratePartitionKey(clientId),
         RowKey = GenerateRowKey(watchList.Id),
         Id = watchList.Id,
         Name = watchList.Name,
         Order = watchList.Order,
         ClientId = clientId,
         ReadOnly = watchList.ReadOnly,
         AssetIds = watchList.AssetIds.ToList()
     });
 }
コード例 #12
0
        public ACTFBWatchNotification(ACTFBIncidentItem IncidentItem, IWatchList Parent, ACTFBIncidentSourceOptions Options, ACTFBIncidentSource ParentSource)
        {
            InitializeComponent();

            mIncidentItem = IncidentItem;
            mParent = Parent;
            mOptions = Options;
            mParentSource = ParentSource;

            mfFadeOut = true;

            UpdateDialog();

            //Check if a stream exists for this region
            if (String.IsNullOrEmpty(mOptions.StreamURL) == false &&
                String.IsNullOrEmpty(mParentSource.GetIncidentWatcher().GetStreamListenerPath()) == false)
            {
                //If we have it set to open the stream
                if (mParentSource.GetIncidentWatcher().GetAutoOpenStreamOnWatch() == true)
                {
                    OpenStream();
                }
            }
        }
コード例 #13
0
        private async Task <IWatchList> FilterAssetPairsAsync(IWatchList watchList, List <string> availableAssetPairIds = null)
        {
            availableAssetPairIds = availableAssetPairIds ?? await GetAvailableAssetPairIdsAsync();

            var filteredAssetPairIds = watchList.AssetIds
                                       .Where(x => availableAssetPairIds.Contains(x))
                                       .ToList();

            if (!filteredAssetPairIds.Any())
            {
                return(null);
            }

            var result = new WatchListDto()
            {
                AssetIds = filteredAssetPairIds,
                Id       = watchList.Id,
                Name     = watchList.Name,
                Order    = watchList.Order,
                ReadOnly = watchList.ReadOnly
            };

            return(result);
        }
コード例 #14
0
 public async Task UpdatePredefinedAsync(IWatchList watchList)
 {
     await _predefinedWatchListRepository.UpsertAsync(watchList);
 }
コード例 #15
0
 public bool Initialize(IIncidentWatcher IncidentWatcher, IWatchList Watches)
 {
     mIncidentWatcher = IncidentWatcher;
     mWatches = Watches;
     return true;
 }
コード例 #16
0
 public bool Initialize(IIncidentWatcher IncidentWatcher, IWatchList Watches)
 {
     return true;
 }
コード例 #17
0
        public IWatchNotification GetWatchWindow(string ID, IWatchList Watches)
        {
            string ActualID = ID.Remove(0, SimpleConstants.ID_PREFIX.Length);

            return new SimpleWatcher(mOptions.GenerateSimpleIncident(this), Watches);
        }
コード例 #18
0
        public IWatchNotification GetWatchWindow(string ID, IWatchList parent)
        {
            //Create a new Watch Window
            //Does the supplied ID match this source
            if (ID.StartsWith(SourceConstants.ID_PREFIX) == true)
            {
                string actualID = ID.Remove(0, SourceConstants.ID_PREFIX.Length);

                return new WatchNotification(mIncidentList.GetIncidentDictionary()[actualID], parent, mOptions, this);
            }
            else
            {
                return null;
            }
        }
コード例 #19
0
 private IWatchList FilterAssetsPairs(IWatchList watchList, List <string> availableAssetPairIds = null)
 {
     return(FilterAssetPairsAsync(watchList, availableAssetPairIds).GetAwaiter().GetResult());
 }
コード例 #20
0
 public async Task UpdateCustomAsync(string userId, IWatchList watchList)
 {
     await _customWatchListRepository.UpsertAsync(userId, watchList);
 }
コード例 #21
0
        public async Task <IWatchList> AddPredefinedAsync(IWatchList watchList)
        {
            await _predefinedWatchListRepository.UpsertAsync(watchList);

            return(watchList);
        }
コード例 #22
0
 private static bool IsAllAssetsWatchList(IWatchList watchList)
 {
     // Legacy. Probably, we should use settings to detect all assets watch list.
     return(watchList.Name.Equals(Constants.AllAssetsWatchListName, StringComparison.InvariantCultureIgnoreCase));
 }