Exemplo n.º 1
0
        internal void Init(AdapterSettings adapterSettings)
        {
            if (adapterSettings != null)
            {
                string typeName = adapterSettings.Class;
                Type   type     = ObjectFactory.Locate(typeName);
                if (type != null)
                {
                    _adapter = ObjectFactory.CreateInstance(type) as ServiceAdapter;
                    _adapter.SetDestination(this);
                    _adapter.SetAdapterSettings(adapterSettings);
                    _adapter.SetDestinationSettings(_settings);
                    _adapter.Init();
                }
            }
            MessageBroker messageBroker = this.Service.GetMessageBroker();

            messageBroker.RegisterDestination(this, _service);

            //If the source has application scope create an instance here, so the service can listen for SessionCreated events for the first request
            if (this.Scope == "application")
            {
                FactoryInstance factoryInstance = GetFactoryInstance();
                object          inst            = factoryInstance.Lookup();
            }
        }
Exemplo n.º 2
0
 public override void TestsInitialize()
 {
     base.TestsInitialize();
     WcfServiceHost.StartService <TestService, ITestService>();
     ServiceAdapter = new ServiceAdapter <ITestService>();
     ClientServiceLocator.Instance().CommandDispatcher = new WcfServiceHost();
 }
        public AuthorizationPresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            AuthorizationServiceAdapter  = new ServiceAdapter <IAuthorizationService>(exceptionManager);
            AuthenticationServiceAdapter = new ServiceAdapter <IAuthenticationService>(exceptionManager);
        }
        private void confirmButton_Click(object sender, EventArgs e)
        {
            if (FilteringSystem.IsAdminPassword(passTB.Text))
            {
                //Unlock the system
                Program.menuForm.unlockForm();

                //Release the internet blocking
                ServiceAdapter.CustomCommend("GUIAdapter", (int)ServiceAdapter.CustomCommends.releaseScheduelBlocking);
            }
            else
            {
                if (attempts > 1)
                {
                    attempts--;
                    attemptsLable.Text      = attempts.ToString();
                    attemptsLable.ForeColor = attempts == 1 ? System.Drawing.Color.Red : attemptsLable.ForeColor;
                    label4.ForeColor        = attempts == 1 ? System.Drawing.Color.Red : attemptsLable.ForeColor;
                }
                else
                {
                    label4.ForeColor      = System.Drawing.Color.Red;
                    label4.Text           = "התראה על שימוש בסיסמה שגויה נשלחה למנהל המערכת";
                    label5.Text           = "הגלישה ברשת במחשב זה נחסמה.";
                    attemptsLable.Visible = false;
                    label2.Visible        = false;
                    ServiceAdapter.CustomCommend("GUIAdapter", (int)ServiceAdapter.CustomCommends.startScheduelBlocking); //tell the service to bloke the internt
                    MessageBox.Show("התראה על שימוש בסיסמה שגויה נשלחה למנהל המערכת", "סיסמה שגויה!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            passTB.Text = "";
        }
 public void CustomerServiceTestsInitialize()
 {
     ClientServiceLocator.Instance().CommandDispatcher = new DirectCommandDispatcher();
     GlobalContext.Instance().TransFactory             = new TransManagerEntityStoreFactory();
     Container.RequestContext = new RequestContextNaive();
     ServiceAdapter           = new ServiceAdapter <ICustomerService>();
 }
Exemplo n.º 6
0
        public AppDomainPresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            AppDomainServiceAdapter = new ServiceAdapter <IApplicationDomainService>(exceptionManager);
            DataServiceAdapter      = new ServiceAdapter <IDataService>(exceptionManager);
        }
Exemplo n.º 7
0
        public void RefreshStatus()
        {
            if (FilteringSystem.IsScheduelActive())
            {
                if (FIlterScheduelingSystem.isBlockdAt(DateTime.Now))
                {
                    statusLabel.Text      = "חסימה מתוזמנת";
                    statusLabel.ForeColor = Color.Red;

                    //Block the Internt using the service
                    ServiceAdapter.StartInternetBlocking();
                }
                else
                {
                    statusLabel.Text      = "גלישה מאופשרת";
                    statusLabel.ForeColor = Color.LimeGreen;

                    //release service's internet blocking
                    ServiceAdapter.StopInterntBlocking();
                }
            }
            else
            {
                statusLabel.Text      = "לא פעיל";
                statusLabel.ForeColor = Color.Red;
                ServiceAdapter.StopInterntBlocking();
            }
        }
Exemplo n.º 8
0
        public ServiceCategoryJobPresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            ServiceJobServiceAdapter    = new ServiceAdapter <IServiceJobs>(exceptionManager);
            ServiceCatJobServiceAdapter = new ServiceAdapter <IServiceCategoryJob>(exceptionManager);
        }
Exemplo n.º 9
0
        public SecurityUserPresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            SecurityUserServiceAdapter = new ServiceAdapter <ISecurityUserService>(exceptionManager);
            MembershipServiceAdapter   = new ServiceAdapter <IMembershipProviderService>(exceptionManager);
        }
        protected override async Task LoadDataAsync()
        {
            try
            {
                var authorizationSession = AccountService.CurrentAuthorizationSession;

                if (authorizationSession != null)
                {
                    var dataAccess = ServiceAdapter.Create <Contracts.Persistence.Configuration.IIdentitySetting>(authorizationSession.Token);
                    var items      = await dataAccess.QueryAllAsync(CreatePredicate(AccountService)).ConfigureAwait(false);

                    storedEntries = new Dictionary <string, string>();
                    foreach (var item in items)
                    {
                        storedEntries.Add(item.Key, item.Value);
                        if (UnstoredEntries.ContainsKey(item.Key))
                        {
                            UnstoredEntries.Remove(item.Key);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error in {MethodBase.GetCurrentMethod().Name}: {ex.Message}");
            }
        }
 public CustomerViewModel()
 {
     CustomerServiceAdapter = new ServiceAdapter <ICustomerService>();
     Refresh();
     View = new CustomerView {
         DataContext = this
     };
     View.ShowDialog();
 }
        public MainViewModel()
        {
            bloggingServiceAdapter = new ServiceAdapter <IBloggingService>();

            Blogs               = new ObservableCollection <Blog>();
            FirstBlogCommand    = new RelayCommand(SelectFirstBlog, CanSelectFirstBlog);
            RefreshBlogsCommand = new RelayCommand(RefreshBlogs, CanRefreshBlogs);
            LoadData();
        }
        partial void BeforeFirstRender(ref bool handled)
        {
            handled = true;

            var adapterAccess = ServiceAdapter.Create <TContract>();

            DataGridHandler          = new SettingDataGridHandler(this, new SettingAdapterAccess(adapterAccess, Settings));
            DataGridHandler.PageSize = Settings.GetValueTyped <int>($"{ComponentName}.{nameof(DataGridHandler.PageSize)}", DataGridHandler.PageSize);
        }
Exemplo n.º 14
0
 public ISE.Framework.Common.Token.UserIdentity FindIdentity(string userName, string password, string systemName)
 {
     if (systemName == "IseFood")
     {
         ServiceAdapter <IIdentity> iseFoodIdentityService = new ServiceAdapter <IIdentity>();
         UserIdentity identity = (UserIdentity)iseFoodIdentityService.Execute(s => s.GetUserIdentity(userName, password));
         return(identity);
     }
     return(null);
 }
Exemplo n.º 15
0
 public AddressDetailViewModel(AddressDto operation)
 {
     AddressServiceAdapter = new ServiceAdapter <IAddressService>();
     Model = new AddressDetailModel {
         Address = new AddressDto()
     };
     Model.Address = operation;
     View          = new AddressDetailView {
         DataContext = this
     };
 }
Exemplo n.º 16
0
 public CustomerDetailViewModel(CustomerDto operation)
 {
     CustomerServiceAdapter = new ServiceAdapter <ICustomerService>();
     Model = new CustomerDetailModel {
         Customer = new CustomerDto()
     };
     if (operation != null)
     {
         Model.Customer = operation;
     }
     View = new CustomerDetailView {
         DataContext = this
     };
 }
        private void Refresh()
        {
            //var result = CustomerServiceInstance.FindAll();
            var adapter = new ServiceAdapter <ICustomerService>();
            var result  = adapter.Execute(service => service.FindAll());

            Model = new CustomerModel()
            {
                NewCustomerOperation = new CustomerDto(),
                CustomerList         = result.Customers,
                IsEnabled            = true
            };

            RaisePropertyChanged(() => Model);
        }
Exemplo n.º 18
0
 private Boolean CloseingPreventionChecking()
 {
     if (ServiceAdapter.GetServiceStatus("GUIAdapter") == "Running")
     {
         CloseingPreventionStatusLabel.Text      = "פעיל";
         CloseingPreventionStatusLabel.ForeColor = Color.LimeGreen;
         return(true);
     }
     else
     {
         CloseingPreventionStatusLabel.Text      = "לא פעיל";
         CloseingPreventionStatusLabel.ForeColor = Color.Red;
         ServiceAdapter.StartService("GUIAdapter", 10000);
         return(false);
     }
 }
Exemplo n.º 19
0
 private void CloseingPreventionStatusLabel_Click(object sender, EventArgs e)
 {
     if (CloseingPreventionChecking() == false)
     {
         try
         {
             string servicePath = (System.Reflection.Assembly.GetExecutingAssembly().CodeBase).Replace("file:///", "").Replace("MMB-Filter.exe", "MMB-Service.exe");
             MessageBox.Show(servicePath.Replace("MMB-Filter.exe", "MMB - Service.exe") + "    ," + File.Exists(servicePath));
             ServiceAdapter.InstallService(servicePath);
             ServiceAdapter.StartService("GUIAdapter", 10000);
         }
         catch
         {
             MessageBox.Show("לא ניתן להתקין תוסף שירות");
         }
     }
 }
Exemplo n.º 20
0
        public void ConnectToBrokerAsServer(NB.Configuration.Config config)
        {
            serviceAdapter = new ServiceAdapter();
            publisher = new Publisher(config, "NetServer", serviceAdapter);    

            //NB.Configuration.Config config = Config.InstanceOf(AppDomain.CurrentDomain.BaseDirectory + "\\NetBroker.xml");
            //BrokerPlugConfig plugConfig = new BrokerPlugConfig(config, NB.Transport.Enums.PlugType.Server);

            //publisher = new Publisher(plugConfig);

            //serviceAdapter.RegisterDelegates();
            ////publisher.Register(serviceAdapter);
            //((RequestHandler)publisher.BrokerConnection).RegisterServiceHandler(serviceAdapter);

            log.InfoFormat("Connected to message broker as server on {0}.", config.Server_URL);

            return;
        }
Exemplo n.º 21
0
        public static Boolean IsRunInSafeMode()
        {
            string minimalSafeMode = GetRegistryKeyValue(RegistryHive.LocalMachine, @"SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\GUIAdapter", "");
            string networkSafeMode = GetRegistryKeyValue(RegistryHive.LocalMachine, @"SYSTEM\CurrentControlSet\Control\SafeBoot\Network\GUIAdapter", "");

            if (minimalSafeMode != null && networkSafeMode != null)
            {
                if (minimalSafeMode == "Service" && networkSafeMode == "Service")
                {
                    return(true);
                }
                return(false);
            }
            else
            {
                ServiceAdapter.CustomCommend((int)ServiceAdapter.CustomCommends.addToSafeMode);
                return(false);
            }
        }
Exemplo n.º 22
0
        Func <dynamic, dynamic> Create_handler(ServiceInfo service)
        {
            return((dynamic param) => {
                try {
                    var input = Get_input(param, service);

                    var handler = new ServiceAdapter(service.ServiceType, service.EntryPointMethodname, service.SetupMethodname, service.TeardownMethodname);
                    var output = handler.Execute(input);

                    var response = Produce_output(output);
                    return CORS.Handle_simple_request(Request, response);
                }
                catch (Exception ex) {
                    var resp = (Response)($"ServiceHost: Service request could not be handled! Exception: {ex}");
                    resp.StatusCode = HttpStatusCode.InternalServerError;
                    return resp;
                }
            });
        }
Exemplo n.º 23
0
        /// <summary>
        /// Initializes the current Destination.
        /// </summary>
        /// <param name="adapterDefinition">Adapter definition.</param>
        public virtual void Init(AdapterDefinition adapterDefinition)
        {
            if (_initialized)
            {
                throw new NotSupportedException(__Res.GetString(__Res.Destination_Reinit, this.Id, this.GetType().Name));
            }
            _initialized = true;
            if (adapterDefinition != null)
            {
                string typeName = adapterDefinition.Class;
                Type   type     = ObjectFactory.Locate(typeName);
                if (type != null)
                {
                    _adapter = ObjectFactory.CreateInstance(type) as ServiceAdapter;
                    _adapter.SetDestination(this);
                    _adapter.SetAdapterSettings(adapterDefinition);
                    _adapter.SetDestinationSettings(_destinationDefinition);
                    _adapter.Init();
                }
                else
                {
                    log.Error(__Res.GetString(__Res.Type_InitError, adapterDefinition.Class));
                }
            }
            else
            {
                log.Error(__Res.GetString(__Res.MessageServer_MissingAdapter, this.Id, this.GetType().Name));
            }
            MessageBroker messageBroker = this.Service.GetMessageBroker();

            messageBroker.RegisterDestination(this, _service);

            //If the source has application scope create an instance here, so the service can listen for SessionCreated events for the first request
            if (this.Scope == "application")
            {
                FactoryInstance factoryInstance = GetFactoryInstance();
                object          inst            = factoryInstance.Lookup();
            }
        }
Exemplo n.º 24
0
        public BuildViewModel()
        {
            serviceadapter = new ServiceAdapter();
            serviceadapter.OnFundProcessed    += new ServiceAdapter.FundProcessedHandler(serviceadapter_OnFundProcessed);
            serviceadapter.OnFundProcessError += new ServiceAdapter.FundProcessErrorHandler(serviceadapter_OnFundProcessError);

            TasksComplete = new ObservableCollection <string>();

            StepType = true;

            //TasksComplete = new ObservableCollection<string>();
            if (DesignerProperties.IsInDesignTool)
            {
                Step        = "Sample step...";
                StepType    = false;
                ProgressPct = 50;
                Total       = 50;
                TasksComplete.Add("Task 1");
                TasksComplete.Add("Task 2");
                return;
            }

            ShellViewService.Current.RebuildRequested += new EventHandler(BeginBuild);
        }
Exemplo n.º 25
0
 public void RemoveService(Service service)
 {
     _client.removeService(ServiceAdapter.Create(service));
 }
Exemplo n.º 26
0
 public void AddService(Service service)
 {
     _client.addService(ServiceAdapter.Create(service));
 }
Exemplo n.º 27
0
        public SecurityCompanyPresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            SecurityCompanyServiceAdapter = new ServiceAdapter <ISecurityCompanyService>(exceptionManager);
        }
Exemplo n.º 28
0
        public ResourcePresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            SecurityResourceServiceAdapter = new ServiceAdapter <IResourceService>(exceptionManager);
        }
Exemplo n.º 29
0
        public WorkPresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            WorkServiceAdapter = new ServiceAdapter <IWorkService>(exceptionManager);
        }
 public override void TestsInitialize()
 {
     base.TestsInitialize();
     ServiceAdapter = new ServiceAdapter <ICustomerService>();
 }
Exemplo n.º 31
0
        public AccountPresenter()
        {
            IseBussinessExceptionManager exceptionManager = new IseBussinessExceptionManager();

            MembershipProviderServiceAdapter = new ServiceAdapter <IMembershipProviderService>(exceptionManager);
        }