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); } }
private void SimaticMonitorForm_Load(object sender, EventArgs e) { try { this.Text = $"Monitor:{GetDriverTypes()}"; objChannelManager = ChannelService.GetChannelManager(); objDeviceManager = DeviceService.GetDeviceManager(); objDataBlockManager = DataBlockService.GetDataBlockManager(); objTagManager = TagService.GetTagManager(); string xmlFile = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT); if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile)) { return; } InitializeData(objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT)); // GetWCF(); } catch (CommunicationException ex) { txtHistory.Text += string.Format("+ ERROR: {0}" + Environment.NewLine, ex.Message); } catch (Exception ex) { txtHistory.Text += string.Format("+ ERROR: {0}" + Environment.NewLine, ex.Message); } }
public AddColumn() { objChannelManager = ChannelService.GetChannelManager(); objDeviceManager = DeviceService.GetDeviceManager(); objDataBlockManager = DataBlockService.GetDataBlockManager(); objTagManager = TagService.GetTagManager(); InitializeComponent(); }
public FrmAddAlarm(ClassAlarm AlarmCurrent = null) { objChannelManager = ChannelService.GetChannelManager(); objDeviceManager = DeviceService.GetDeviceManager(); objDataBlockManager = DataBlockService.GetDataBlockManager(); objTagManager = TagService.GetTagManager(); InitializeComponent(); Alarm = AlarmCurrent; }
public AddColumn(Server SQLParam, DataBase dbsParam, Table tbParam, Column coParam = null) { InitializeComponent(); DBS = dbsParam; Tb = tbParam; SQL = SQLParam; Co = coParam; objChannelManager = ChannelService.GetChannelManager(); objDeviceManager = DeviceService.GetDeviceManager(); objDataBlockManager = DataBlockService.GetDataBlockManager(); objTagManager = TagService.GetTagManager(); }
BuildServiceAndDependencies(ContentDbContext contentDbContext) { var tableBuilderService = new Mock <ITableBuilderService>(Strict); var userService = AlwaysTrueUserService(); var controller = new DataBlockService( contentDbContext, tableBuilderService.Object, userService.Object ); return(controller, (tableBuilderService, CacheService)); }
private void AssertSecurityPoliciesChecked <T>( Func <DataBlockService, Task <Either <ActionResult, T> > > protectedAction, params SecurityPolicies[] policies) { var(userService, persistenceHelper, fileStorageService) = Mocks(); using (var context = DbUtils.InMemoryApplicationDbContext()) { context.Add(new ReleaseContentBlock { Release = _release, ContentBlockId = _dataBlock.Id }); context.SaveChanges(); var service = new DataBlockService(context, AdminMapper(), persistenceHelper.Object, userService.Object, fileStorageService.Object); PermissionTestUtil.AssertSecurityPoliciesChecked(protectedAction, _release, userService, service, policies); } }
private void SimaticMonitorForm_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; } InitializeData(objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT)); SetCreateChannel(); } catch (Exception ex) { EventscadaException?.Invoke(this.GetType().Name, ex.Message); } }
private DataBlockService BuildDataBlockService( ContentDbContext?contentDbContext = null, IPersistenceHelper <ContentDbContext>?persistenceHelper = null, IReleaseFileService?releaseFileService = null, IReleaseContentBlockRepository?releaseContentBlockRepository = null, IUserService?userService = null, IBlobCacheService?cacheService = null, ICacheKeyService?cacheKeyService = null) { using var context = DbUtils.InMemoryApplicationDbContext(); var service = new DataBlockService( contentDbContext ?? Mock.Of <ContentDbContext>(Strict), persistenceHelper ?? PersistenceHelperMock().Object, releaseFileService ?? Mock.Of <IReleaseFileService>(Strict), releaseContentBlockRepository ?? Mock.Of <IReleaseContentBlockRepository>(Strict), userService ?? Mock.Of <IUserService>(Strict), AdminMapper(), cacheService ?? Mock.Of <IBlobCacheService>(Strict), cacheKeyService ?? Mock.Of <ICacheKeyService>(Strict) ); return(service); }
private void PLC_MonitorForm_Load(object sender, EventArgs e) { KryptonDockingWorkspace w = kryptonDockingManager1.ManageWorkspace("Workspace", kryptonDockableWorkspace1); kryptonDockingManager1.ManageControl("Control", kryptonSplitContainer1.Panel2, w); kryptonDockingManager1.ManageFloating("Floating", this); kryptonDockingManager1.AddAutoHiddenGroup("Control", DockingEdge.Right, new KryptonPage[] { NewUserPropertyGrid() }); objChannelManager = ChannelService.GetChannelManager(); objDeviceManager = DeviceService.GetDeviceManager(); objDataBlockManager = DataBlockService.GetDataBlockManager(); objTagManager = TagService.GetTagManager(); string xmlFile = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT); if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile)) { return; } InitializeData(xmlFile); SetCreateChannel(); }