Beispiel #1
0
 public AuthController(
     StargateLocator serviceLocation,
     AuthService <KahlaUser> authService,
     UserManager <KahlaUser> userManager,
     SignInManager <KahlaUser> signInManager,
     UserService userService,
     AppsContainer appsContainer,
     KahlaPushService pusher,
     ChannelService channelService,
     KahlaDbContext dbContext,
     IOptions <List <DomainSettings> > optionsAccessor,
     EventService eventService,
     OnlineJudger onlineJudger)
 {
     _stargateLocator = serviceLocation;
     _authService     = authService;
     _userManager     = userManager;
     _signInManager   = signInManager;
     _userService     = userService;
     _appsContainer   = appsContainer;
     _pusher          = pusher;
     _channelService  = channelService;
     _dbContext       = dbContext;
     _eventService    = eventService;
     _onlineJudger    = onlineJudger;
     _appDomains      = optionsAccessor.Value;
 }
Beispiel #2
0
 public EducationController()
 {
     _channelService  = new ChannelService();
     _commentService  = new CommentService();
     _memberService   = new MemberService();
     _categoryService = new CategoryService();
 }
        private void FormS7Studio_Load(object sender, EventArgs e)
        {
            Registry.SetValue("HKEY_CURRENT_USER\\Software\\FormConfiguration", "IPAddress", "localhost");
            Registry.SetValue("HKEY_CURRENT_USER\\Software\\FormConfiguration", "Port", "8080");


            XCollection.eventLoggingMessage += ServiceBase_eventChannelCount;
            XCollection.EventscadaException += ServiceBase_eventChannelCount;
            var objChannelManager = ChannelService.GetChannelManager();

            try
            {
                var msg = new Message("AdvancedScada");
                alertControl1.Show(this, msg.Caption, msg.Text, string.Empty, msg.Image, msg);
                Text = "Main Studio 2019 : AdvancedScada";
                barCheckEnabele.Checked = Settings.Default.CheckEnabele;
            }
            catch (Exception ex)
            {
                txtHistory.Text += string.Format("+ ERROR: {0}" + Environment.NewLine, ex.Message);
            }
            var xmlFile = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT);

            if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile))
            {
                return;
            }
            var chList = objChannelManager.GetChannels(xmlFile);

            if (chList.Count < 1)
            {
                return;
            }
            //ServiceItem_LinkClicked(null, null);
        }
Beispiel #4
0
        public void TestGetSubscribersByChannelId_ShouldReturnChannelSubscribers()
        {
            var options = new DbContextOptionsBuilder <TubeDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                          .Options;

            var context = new TubeDbContext(options);

            SeedData(context);

            var mockMapper = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new TubeProfile());
            });
            var mapper = mockMapper.CreateMapper();

            var userService    = new UserService(context, mapper);
            var channelService = new ChannelService(context, userService, mapper);

            var expectedData = new List <TubeUserChannelDTO> {
                TubeUserChannel
            };
            var id         = "1111";
            var actualData = channelService.GetSubscribersByChannelId(id);

            Assert.True(expectedData[0].TubeUserId == actualData[0].TubeUserId);
            Assert.True(expectedData[0].ChannelId == actualData[0].ChannelId);
        }
        public void Add_ExternalSourceExists()
        {
            // Arrange
            var sourceId       = "sourceId";
            var userName       = "******";
            var unitOfWork     = unitOfWorkMockSetup.Object;
            var contextManager = new TestContextManager(unitOfWork, unitOfWork);

            UserIdentificationMock.Setup(s => s.UserName).Returns(userName);
            ExternalSourceRepoMock.Setup(s => s.All())
            .Returns(new List <ExternalSource>()
            {
                new ExternalSource {
                    SourceId = sourceId, RelationId = userName, ObjectType = typeof(Model.Models.ServiceChannel).Name
                }
            }.AsQueryable());
            var serviceUtilities = new ServiceUtilities(UserIdentificationMock.Object, LockingManager, contextManager, UserOrganizationService,
                                                        VersioningManager, UserInfoService, UserOrganizationChecker);

            var service = new ChannelService(contextManager, UserIdentification, translationManagerMockSetup.Object, TranslationManagerVModel,
                                             Logger, ServiceChannelLogic, serviceUtilities, CommonService, new VmListItemLogic(), DataUtils, new VmOwnerReferenceLogic(),
                                             AddressService, CacheManager, PublishingStatusCache, VersioningManager, UserOrganizationChecker, UrlService);

            // Act
            Action act = () => service.AddServiceChannel(new VmOpenApiServiceChannelIn()
            {
                SourceId = sourceId
            }, false, DefaultVersion, null);

            // Assert
            act.ShouldThrowExactly <ExternalSourceExistsException>(string.Format(CoreMessages.OpenApi.ExternalSourceExists, sourceId));
        }
Beispiel #6
0
        public void TestIsYours_ShouldReturnFalse()
        {
            var options = new DbContextOptionsBuilder <TubeDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                          .Options;

            var context = new TubeDbContext(options);

            SeedData(context);

            var mockMapper = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new TubeProfile());
            });
            var mapper = mockMapper.CreateMapper();

            var userService    = new UserService(context, mapper);
            var channelService = new ChannelService(context, userService, mapper);

            var channelName        = "MyChannel";
            var channelDescription = "TestChannel";
            var tubeUsername       = "******";

            var channel  = channelService.Create(channelName, channelDescription, string.Empty, tubeUsername);
            var id       = channel.Id;
            var username = Users[1].UserName;

            var isYours = channelService.IsYours(id, username);

            Assert.False(isYours);
        }
Beispiel #7
0
        public void TestGetChannelByUserName_ShouldReturnCorrectChannel()
        {
            var options = new DbContextOptionsBuilder <TubeDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                          .Options;

            var context = new TubeDbContext(options);

            SeedData(context);

            var mockMapper = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new TubeProfile());
            });
            var mapper = mockMapper.CreateMapper();

            var userService    = new UserService(context, mapper);
            var channelService = new ChannelService(context, userService, mapper);

            var channelName        = "MyChannel";
            var channelDescription = "TestChannel";
            var tubeUsername       = "******";

            channelService.Create(channelName, channelDescription, string.Empty, tubeUsername);

            var expectedData = channelService.GetChannelByTubeUserName(tubeUsername);

            Assert.False(expectedData == null);
        }
Beispiel #8
0
        public void TestSubscribe_UserShouldSubscribeChannel()
        {
            var options = new DbContextOptionsBuilder <TubeDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                          .Options;

            var context = new TubeDbContext(options);

            SeedData(context);

            var mockMapper = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new TubeProfile());
            });
            var mapper = mockMapper.CreateMapper();

            var userService    = new UserService(context, mapper);
            var channelService = new ChannelService(context, userService, mapper);

            var channelName        = "MyChannel";
            var channelDescription = "TestChannel";
            var tubeUsername       = "******";

            var channel = new Channel {
                Id = "1", Name = channelName, Description = channelDescription
            };
            //var channel = channelService.Create(channelName, channelDescription, string.Empty,  tubeUsername);
            var id = "1";

            channelService.Subscribe(id, tubeUsername);
            var subscribers = channelService.GetSubscribersByChannelId(id);

            Assert.Single(subscribers);
        }
        public CommandHandlingService(
            IServiceProvider provider,
            DiscordSocketClient discord,
            CommandService commands,
            MangaService mangaService,
            UserAlertService userAlertService,
            ChannelService channelService,
            ServerAlertService serverAlertService,
            MangaUpdatesCrawlerService mangaUpdatesService,
            UnionMangasCrawlerService unionMangasService,
            //TuMangaCrawlerService tuMangaService,
            InfoAnimeCrawlerService infoAnimeCrawlerService,
            AppDbContext dbContext)
        {
            this.discord             = discord;
            this.commands            = commands;
            this.mangaService        = mangaService;
            this.userAlertService    = userAlertService;
            this.channelService      = channelService;
            this.serverAlertService  = serverAlertService;
            this.mangaUpdatesService = mangaUpdatesService;
            this.unionMangasService  = unionMangasService;
            //this.tuMangaService = tuMangaService;
            this.infoAnimeService = infoAnimeCrawlerService;
            this.provider         = provider;
            this.dbContext        = dbContext;

            this.discord.Connected += Update;
            resourceManager         = new ResourceManager(typeof(WebJobResource));
        }
Beispiel #10
0
        private async Task DoDeleteMessagesAsync(ITextChannel channel, IGuildChannel guildChannel, IEnumerable <IMessage> messages)
        {
            await channel.DeleteMessagesAsync(messages);

            using (var transaction = await DeletedMessageBatchRepository.BeginCreateTransactionAsync())
            {
                await ChannelService.TrackChannelAsync(guildChannel);

                await DeletedMessageBatchRepository.CreateAsync(new DeletedMessageBatchCreationData()
                {
                    CreatedById = AuthorizationService.CurrentUserId.Value,
                    GuildId     = AuthorizationService.CurrentGuildId.Value,
                    Data        = messages.Select(
                        x => new DeletedMessageCreationData()
                    {
                        AuthorId  = x.Author.Id,
                        ChannelId = x.Channel.Id,
                        Content   = x.Content,
                        GuildId   = AuthorizationService.CurrentGuildId.Value,
                        MessageId = x.Id,
                        Reason    = "Mass-deleted.",
                    }),
                });

                transaction.Commit();
            }
        }
Beispiel #11
0
        /// <inheritdoc />
        public async Task DeleteMessageAsync(IMessage message, string reason)
        {
            AuthorizationService.RequireAuthenticatedUser();
            AuthorizationService.RequireClaims(AuthorizationClaim.ModerationDeleteMessage);

            if (!(message.Channel is IGuildChannel guildChannel))
            {
                throw new InvalidOperationException($"Cannot delete message {message.Id} because it is not a guild message");
            }

            await UserService.TrackUserAsync(message.Author as IGuildUser);

            await ChannelService.TrackChannelAsync(guildChannel);

            using (var transaction = await DeletedMessageRepository.BeginCreateTransactionAsync())
            {
                await DeletedMessageRepository.CreateAsync(new DeletedMessageCreationData()
                {
                    GuildId     = guildChannel.GuildId,
                    ChannelId   = guildChannel.Id,
                    MessageId   = message.Id,
                    AuthorId    = message.Author.Id,
                    Content     = message.Content,
                    Reason      = reason,
                    CreatedById = AuthorizationService.CurrentUserId.Value
                });

                await message.DeleteAsync();

                transaction.Commit();
            }
        }
        public bool GetStartService()
        {
            var objChannelManager = ChannelService.GetChannelManager();

            try
            {
                var xmlFile = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT);
                if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile))
                {
                    return(false);
                }


                objChannelManager.Channels.Clear();
                TagCollection.Tags.Clear();
                var channels = objChannelManager.GetChannels(xmlFile);


                driverHelper.InitializeService(channels);
                driverHelper.Connect();



                return(true);
            }
            catch (Exception ex)
            {
                EventscadaException?.Invoke(this.GetType().Name, ex.Message);
            }
            return(true);
        }
Beispiel #13
0
 public AcceleratorPackage(
     AssortmentService assortmentService,
     FieldTemplateService fieldTemplateService,
     StructureInfoService structureInfoService,
     MarketService marketService,
     ChannelService channelService,
     CurrencyService currencyService,
     WebsiteService websiteService,
     InventoryService inventoryService,
     PriceListService priceListService,
     DomainNameService domainNameService,
     GroupService groupService,
     FolderService folderService,
     PersonService personService,
     LanguageService languageService,
     SlugifyService slugifyService)
 {
     _assortmentService    = assortmentService;
     _fieldTemplateService = fieldTemplateService;
     _structureInfoService = structureInfoService;
     _marketService        = marketService;
     _channelService       = channelService;
     _currencyService      = currencyService;
     _websiteService       = websiteService;
     _inventoryService     = inventoryService;
     _priceListService     = priceListService;
     _domainNameService    = domainNameService;
     _groupService         = groupService;
     _folderService        = folderService;
     _personService        = personService;
     _languageService      = languageService;
     _slugifyService       = slugifyService;
 }
Beispiel #14
0
        public async Task Recover(
            DeveloperUser user,
            DeveloperApp appInDb,
            CoreApiService coreApiService,
            AppsContainer appsContainer,
            SitesService sitesService,
            EventService eventService,
            ChannelService channelService,
            RecordsService recordsService,
            int pageNumber)
        {
            RootRecover(user);
            var token = await appsContainer.AccessToken(appInDb.AppId, appInDb.AppSecret);

            Grants = await coreApiService.AllUserGrantedAsync(token, pageNumber, 15);

            var sites = await sitesService.ViewMySitesAsync(token);

            Sites = sites.Sites;

            var errorLogs = await eventService.ViewAsync(token);

            ErrorLogs = errorLogs.Logs;

            var channels = await channelService.ViewMyChannelsAsync(token);

            Channels = channels.Channels;

            var records = await recordsService.ViewMyRecordsAsync(token);

            Records = records.Records;

            Trusted = appInDb.TrustedApp;
        }
        private IActionResult PostServiceChannel <TModel, TValidator>(TModel vmBase, TValidator validator) where TModel : class, IVmOpenApiServiceChannelIn where TValidator : ServiceChannelValidator <TModel>
        {
            // Get languages user has added into model
            vmBase.AvailableLanguages = GetServiceChannelAvailableLanguages(vmBase).ToList();
            // For post method the required and available languages are the same
            validator.RequiredLanguages  = vmBase.AvailableLanguages;
            validator.AvailableLanguages = vmBase.AvailableLanguages;

            // Set publishing status as Draft or Published
            if (vmBase.PublishingStatus != PublishingStatus.Published.ToString())
            {
                vmBase.PublishingStatus = PublishingStatus.Draft.ToString();
            }

            // Validate request data
            validator.Validate(ModelState);
            // Check validation status
            if (!ModelState.IsValid)
            {
                return(new BadRequestObjectResult(ModelState));
            }

            SetAddressProperties(vmBase);

            return(Ok(ChannelService.AddServiceChannel(vmBase, Settings.AllowAnonymous, versionNumber)));
        }
Beispiel #16
0
        public Sora(SoraDbContext ctx,
                    IServiceProvider provider,
                    PresenceService ps,
                    ChannelService cs,
                    EventManager ev
                    )
        {
            _provider = provider;
            _ctx      = ctx;
            _ps       = ps;
            _cs       = cs;
            _ev       = ev;

            #region DEFAULT COMMANDS

            RegisterCommandClass <RestrictCommand>();
            RegisterCommandClass <DebugCommand>();

            #endregion

            ctx.Migrate();

            // this will fail if bot already exists!
            DbUser.RegisterUser(_ctx, Permission.From(Permission.GROUP_ADMIN), "Sora", "*****@*****.**",
                                Crypto.RandomString(32), false, PasswordVersion.V2, 100);

            _dbUser = DbUser.GetDbUser(ctx, 100).Result;
        }
Beispiel #17
0
 public KisiselController()
 {
     _channelService  = new ChannelService();
     _commentService  = new CommentService();
     _memberService   = new MemberService();
     _categoryService = new CategoryService();
 }
        public async Task <CreateChannelViewModel> Init()
        {
            var token   = AppsContainer.AccessToken();
            var channel = await ChannelService.CreateChannelAsync(await token(), "");

            return(channel);
        }
Beispiel #19
0
 public AuthController(
     ServiceLocation serviceLocation,
     IWebHostEnvironment env,
     AuthService <KahlaUser> authService,
     UserManager <KahlaUser> userManager,
     SignInManager <KahlaUser> signInManager,
     UserService userService,
     AppsContainer appsContainer,
     KahlaPushService pusher,
     ChannelService channelService,
     VersionChecker version,
     KahlaDbContext dbContext,
     IOptions <List <DomainSettings> > optionsAccessor,
     AiurCache cache)
 {
     _serviceLocation = serviceLocation;
     _env             = env;
     _authService     = authService;
     _userManager     = userManager;
     _signInManager   = signInManager;
     _userService     = userService;
     _appsContainer   = appsContainer;
     _pusher          = pusher;
     _channelService  = channelService;
     _version         = version;
     _dbContext       = dbContext;
     _cache           = cache;
     _appDomains      = optionsAccessor.Value;
 }
Beispiel #20
0
        public ActionResult MakeDomain(string DomainName)
        {
            //make new domain here for the user that decided to make a new domain.
            Users user = (Users)HttpContext.Session["user"];

            Domains d = new Domains
            {
                Name      = DomainName,
                UpdatedOn = DateTime.Now
            };

            UserDomains ud = new UserDomains
            {
                UserID   = user.UserID,
                DomainID = -1
            };
            int id = DomainService.MakeDomain(d, ud);

            Channels c = new Channels
            {
                DomainID  = id,
                Name      = "Default",
                CreatedOn = DateTime.Now,
                UpdatedOn = DateTime.Now
            };

            ChannelService.MakeChannel(c);

            //will redirect user to their chat room once done. redirects to home/index now.
            return(RedirectToAction("Index", "Chat"));
        }
Beispiel #21
0
        private void PLC_MonitorForm2_Load(object sender, EventArgs e)
        {
            try
            {
                Text = "Monitor:AdvancedScada";
                objChannelManager   = ChannelService.GetChannelManager();
                objDeviceManager    = DeviceService.GetDeviceManager();
                objDataBlockManager = DataBlockService.GetDataBlockManager();
                objTagManager       = TagService.GetTagManager();

                var xmlFile = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT);
                if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile))
                {
                    return;
                }
                gvTags.Appearance.FocusedRow.BackColor       = Color.Yellow;
                gvTags.Appearance.FocusedRow.ForeColor       = Color.Black;
                gvTags.Appearance.HideSelectionRow.BackColor = gvTags.Appearance.FocusedRow.BackColor;
                gvTags.Appearance.HideSelectionRow.ForeColor = Color.Black;
                bsSource          = new BindingSource();
                gcTags.DataSource = bsSource;
                InitializeTreeList(objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT));
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Beispiel #22
0
 public AuthController(
     ServiceLocation serviceLocation,
     IConfiguration configuration,
     IHostingEnvironment env,
     AuthService <KahlaUser> authService,
     AccountService accountService,
     UserManager <KahlaUser> userManager,
     SignInManager <KahlaUser> signInManager,
     UserService userService,
     AppsContainer appsContainer,
     KahlaPushService pusher,
     ChannelService channelService,
     VersionChecker version,
     KahlaDbContext dbContext,
     IMemoryCache cache)
 {
     _serviceLocation = serviceLocation;
     _configuration   = configuration;
     _env             = env;
     _authService     = authService;
     _accountService  = accountService;
     _userManager     = userManager;
     _signInManager   = signInManager;
     _userService     = userService;
     _appsContainer   = appsContainer;
     _pusher          = pusher;
     _channelService  = channelService;
     _version         = version;
     _dbContext       = dbContext;
     _cache           = cache;
 }
Beispiel #23
0
        public async Task UpdateAsync_Should_Update_Channel()
        {
            using (var context = new WarblerDbContext(Options))
            {
                var repo = new SqlChannelRepository(context);
                var test = new ChannelService(repo);

                var testChannel = new Channel
                {
                    Name        = "general",
                    Description = string.Empty,
                    State       = ChannelState.Active,
                    Type        = ChannelType.Normal,
                    Memberships = new List <Membership>()
                };

                await test.UpdateAsync(testChannel);
            }

            // Use separate context instance to verify correct data was saved to DB
            using (var context = new WarblerDbContext(Options))
            {
                Assert.AreEqual(1, context.Channels.Count());
                Assert.AreEqual(string.Empty, context.Channels
                                .FirstOrDefault(c => c.Name == "general").Description);
            }
        }
 public XChannelForm(string DriverTypes, ChannelService chm = null, Channel chCurrent = null)
 {
     InitializeComponent();
     objChannelManager = chm;
     ch           = chCurrent;
     _DriverTypes = DriverTypes;
 }
Beispiel #25
0
 public RequestModelActionFilter(
     RouteRequestLookupInfoAccessor routeRequestLookupInfoAccessor,
     RequestModelAccessor requestModelAccessor,
     RouteRequestInfoAccessor routeRequestInfoAccessor,
     ISecureConnectionResolver secureConnectionResolver,
     ChannelService channelService,
     DomainNameService domainNameService,
     LanguageService languageService,
     PageService pageService,
     FieldTemplateService fieldTemplateService,
     UrlService urlService,
     CountryService countryService)
 {
     _routeRequestLookupInfoAccessor = routeRequestLookupInfoAccessor;
     _requestModelAccessor           = requestModelAccessor;
     _routeRequestInfoAccessor       = routeRequestInfoAccessor;
     _secureConnectionResolver       = secureConnectionResolver;
     _channelService       = channelService;
     _domainNameService    = domainNameService;
     _languageService      = languageService;
     _pageService          = pageService;
     _fieldTemplateService = fieldTemplateService;
     _urlService           = urlService;
     _countryService       = countryService;
 }
Beispiel #26
0
        public string CreateChannel(string type, string business_id, [FromForm] string page_id, [FromForm] string page_name, [FromForm] string token)
        {
            try
            {
                var list = _channelService.GetChannelsByExtId(page_id).Result.Where(b => b.active).ToList();
                if (list == null || list.Count == 0)
                {
                    string longLivedToken = _facebookService.GetLonglivedToken(_appSettings.Value.ClientId, _appSettings.Value.ClientSecret, token);
                    page_name = Core.Helpers.CommonHelper.EnsureMaximumLength(page_name, 200);
                    Channel data = new Channel {
                        id = ChannelService.FormatId(business_id, page_id), business_id = business_id, ext_id = page_id, name = string.IsNullOrWhiteSpace(page_name) ? type + page_id : page_name, active = true, type = type, token = string.IsNullOrWhiteSpace(longLivedToken) ? token : longLivedToken
                    };


                    var resultData = _channelService.Create(data);

                    _facebookService.SubscribeToAppWebhook(page_id, data.token);
                }
                else
                {
                    var data = list[0];
                    var url  = string.Format("https://graph.facebook.com/v2.8/oauth/access_token?grant_type=fb_exchange_token&client_id={0}&client_secret={1}&fb_exchange_token={2}", _appSettings.Value.ClientId, _appSettings.Value.ClientSecret, token);

                    string longLivedToken = "";
                    try
                    {
                        longLivedToken = Core.Helpers.WebHelper.HttpGetAsync <dynamic>(url).Result.access_token;
                    }
                    catch (Exception ex)
                    {
                        _logService.Create(new Log
                        {
                            message  = ex.Message,
                            category = "Channels",
                            name     = "Get long lived token",
                            link     = url
                        });
                    }
                    _facebookService.SubscribeToAppWebhook(data.ext_id, data.token);
                    data.name  = page_name ?? data.type + "-" + data.ext_id;
                    data.token = longLivedToken ?? token;
                    return(_channelService.Create(data));
                    // throw new Exception("Channel already added");
                }
            }
            catch (Exception ex)
            {
                _logService.Create(new Log
                {
                    category = "Channels",
                    link     = $"{Request.HttpContext.Request.Scheme}://{Request.HttpContext.Request.Host}{Request.HttpContext.Request.Path}{Request.HttpContext.Request.QueryString}",
                    message  = ex.Message,
                    details  = ex.StackTrace,
                    name     = string.Format("Create channel for facebook page-{0} of business-{1} use token={2}", page_id, business_id, token)
                });
                throw ex;
            }
            return(page_id);
        }
        private void FormStudio_Load(object sender, EventArgs e)
        {
            Left = SystemInformation.WorkingArea.Size.Width - Size.Width;
            Top  = SystemInformation.WorkingArea.Size.Height - Size.Height;
            CheckEnabele.Checked = Settings.Default.CheckEnabele;

            Registry.SetValue("HKEY_CURRENT_USER\\Software\\FormConfiguration", "IPAddress", "localhost");
            Registry.SetValue("HKEY_CURRENT_USER\\Software\\FormConfiguration", "Port", "8080");


            try
            {
                EventChannelCount += ServiceBase_eventChannelCount;
            }
            catch (Exception ex)
            {
                EventscadaException?.Invoke(GetType().Name, ex.Message);
            }
            // Setup docking functionality
            KryptonDockingWorkspace w = kryptonDockingManager.ManageWorkspace(kryptonDockableWorkspace);

            kryptonDockingManager.ManageControl(panelFill, w);
            kryptonDockingManager.ManageFloating(this);

            // Add initial docking pages
            kryptonDockingManager.AddDockspace("Control", DockingEdge.Bottom, new KryptonPage[] { NewInput() });



            ThisNotificationPopup.TitleText     = "سكادا";
            ThisNotificationPopup.ContentText   = "برمجة عبداللة الصاوى";
            ThisNotificationPopup.IsRightToLeft = false;

            ThisNotificationPopup.Popup();

            btnFormMain_Click();
            ChannelService objChannelManager = ChannelService.GetChannelManager();
            string         xmlFile           = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT);

            if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile))
            {
                return;
            }

            System.Collections.Generic.List <DriverBase.Devices.Channel> chList = objChannelManager.GetChannels(xmlFile);
            if (chList.Count < 1)
            {
                return;
            }

            try
            {
                InitializeTags(true);
            }
            catch (Exception ex)
            {
                EventscadaException?.Invoke(GetType().Name, ex.Message);
            }
        }
Beispiel #28
0
 static void StartChannelService()
 {
     if (!ChannelService.IsRunning())
     {
         ChannelService.Start();
     }
     Debug.Log($"[Step 0] ChannelService Running: {ChannelService.GetAddress()}:{ChannelService.GetPort()}");
 }
Beispiel #29
0
        public ChatHub()
        {
            var context = DbService.NewDbContext();

            channelService = new ChannelService(context);
            userService    = new UserService(context);
            messageService = new MessageService(context);
        }
Beispiel #30
0
        public ActionResult AddChannelPost(ChannelSubscriptionViewModel vm)
        {
            vm.SubscriptionID = Int32.Parse(Request.Form.Get("select"));
            IChannelService ics = new ChannelService();

            ics.SaveChannelService(vm);
            return(RedirectToAction("Index"));
        }
Beispiel #31
0
 /// <summary>
 /// Default ChannelsController constructor.
 /// </summary>
 /// <param name="channels">The ChannelService automaticly injected.</param>
 /// <param name="musics">The MusicService automaticly injected.</param>
 public ChannelsController(ChannelService channels, MusicService musics)
 {   
     _channels = channels;
     _musics   = musics;
 }