Example #1
0
        private static bool LoadDllAndRunDataLoader(Dictionary<string, string> config, ILoaderConfigHandler configHandler, IStatusHandler statusHandler)
        {

            //UGLY CODE BEGINS
            string path = "";
            if (config["PATH"] == "")
            {
                if (Directory.Exists("DataLoaders"))
                {
                    path = Environment.CurrentDirectory + @"\DataLoaders\" + config["DLL"] + ".dll";
                }
                else
                {
                    Console.WriteLine("Folder DataLoaders not found, created folder");
                    Directory.CreateDirectory("DataLoaders");
                    return false;
                }
            }
            else
            {
                path = config["PATH"] + config["DLL"] + ".dll";
            }
            //UGLY CODE ENDS

            //bool oneDataLoader = config["TYPENAME"] != "";
            try
            {
                Assembly plugin = Assembly.LoadFile(path);
                Type[] types = plugin.GetTypes();

                foreach (var type in types)
                {
                    //TODO: Find a cleaner and more readeble solution to this if possible
                    //This terrible implementation is trying to do the following:
                    //If the name parameter in config is specified we only want to create an instance of that class and run the DataLoader
                    //if no name is set then we want to execute RunDataLoader for all classes that implement BaseDataLoader

                    //if (oneDataLoader)
                    //{
                        if (type.Name == config["TYPENAME"])
                        {
                            RunDataLoader(type, configHandler, statusHandler);
                        return true;
                        }
                    //}
                    //else
                    //{
                    //    RunDataLoader(type, propertyHandler, statusHandler);
                    //}
                }

                return false;
            }
            catch (FileNotFoundException ex)
            {
                Console.WriteLine("File: " + path + " exception came up: " + ex.Message);
                return false;
            }
        }
Example #2
0
 public BankIDHttpClientService(
     IHttpClientFactory httpClientFactory,
     IStatusHandler statusHandler,
     BankIDServiceSettings bankIdServiceSettings)
 {
     _httpClientFactory     = httpClientFactory;
     _statusHandler         = statusHandler;
     _bankIdServiceSettings = bankIdServiceSettings;
 }
 public CommonPlayerActionHandler(IActorController actionController, IStatusHandler netStatusHandler)
 {
     this.ActController     = actionController;
     this.mNetStatusHandler = netStatusHandler;
     mTouchHandler          = TouchHandler.GetInstance();
     mStateHelper           = new StateHelper();
     mStateHelper.SetActionController(actionController);
     mStateHelper.UseNet = true;
     InitStatus();
 }
        public void InitializeHandlers(ILoaderConfigHandler configHandler, IStatusHandler statusHandler)
        {
            _guid = Guid.NewGuid().ToString();

            //Note: This implementation form is sub-optimal in terms of performance.  Perhaps it is better to find another way to to this
            string dllName = this.GetType().Assembly.GetName().Name; //System.Reflection.Assembly.GetExecutingAssembly().FullName;

            string typeName = this.GetType().Name;
            _config = configHandler.GetLoaderConfig(dllName, typeName);
            _statusHandler = statusHandler;
        }
Example #5
0
 public RealignmentEvaluator(IChromosomeIndelSource indelSource, IStatusHandler statusCounter,
                             IReadRealigner readRealinger, IRealignmentJudger judger, string chromosome, bool trackActualMismatches,
                             bool checkSoftclipsForMismatches, bool allowRescoringOrig0, bool softclipUnknownIndels, IRegionFilterer regionFilterer,
                             bool lightDebug)
 {
     _indelSource                 = indelSource;
     _statusCounter               = statusCounter;
     _readRealigner               = readRealinger;
     _judger                      = judger;
     _chromosome                  = chromosome;
     _trackActualMismatches       = trackActualMismatches;
     _checkSoftclipsForMismatches = checkSoftclipsForMismatches;
     _allowRescoringOrig0         = allowRescoringOrig0;
     _softclipUnknownIndels       = softclipUnknownIndels;
     _regionFilterer              = regionFilterer;
     _lightDebug                  = lightDebug;
 }
 public BankIDController(
     IBankIDService bankIdService,
     IAuthRequest authRequest,
     ISignRequest signRequest,
     ICancelRequest cancelRequest,
     ICollectRequest collectRequest,
     IStatusHandler statusHandler,
     IHttpContextAccessor httpContextAccessor)
 {
     _bankIdService       = bankIdService;
     _authRequest         = authRequest;
     _signRequest         = signRequest;
     _cancelRequest       = cancelRequest;
     _collectRequest      = collectRequest;
     _statusHandler       = statusHandler;
     _httpContextAccessor = httpContextAccessor;
 }
Example #7
0
        public PipelineManager()
        {
            var notStartedHandler = new StatusHandler(IssueStatuses.NotStarted);
            var inAnalysisHandler = new StatusHandler(IssueStatuses.InAnalysis);
            var inProgressHandler = new StatusHandler(IssueStatuses.InProgress);
            var inReviewHandler   = new StatusHandler(IssueStatuses.InReview);
            var doneHandler       = new StatusHandler(IssueStatuses.Done);
            var releasedHandler   = new StatusHandler(IssueStatuses.Released);

            notStartedHandler.SetNextHandler(inAnalysisHandler);
            inAnalysisHandler.SetNextHandler(inProgressHandler);
            inProgressHandler.SetNextHandler(inReviewHandler);
            inReviewHandler.SetNextHandler(doneHandler);
            doneHandler.SetNextHandler(releasedHandler);

            _initialStatusHandler = notStartedHandler;
        }
Example #8
0
        public bool manage_session(System.Web.HttpRequest request,
                                   System.Web.HttpResponse response,
                                   string cookieName,
                                   IStatusHandler handler)
        {
            error_descr_ = "";
            if (null == cookieName || "" == cookieName)
            {
                throw new System.Exception("Access Manager Cookie name must be setupped throught 'AccessManager.Cookie' variable in web.config");
            }
            try
            {
                if (null != request.Params["login"] &&
                    null != request.Params["password"])
                {
                    logon(
                        request.Params["login"].ToString(),
                        request.Params["password"].ToString());


                    if (request.Params["remember"] != null)
                    {
                        response.Cookies[cookieName].Value   = ctx_.ToString();
                        response.Cookies[cookieName].Expires = DateTime.Now.AddDays(32);
                    }

                    handler.on_logon();
                }

                if (null != request.Params["logoff"] && request.Params["logoff"].Equals("true"))
                {
                    logof();
                    return(handler.on_logof());
                }
            }
            catch (System.Exception ee)
            {
                error_descr_ = ee.Message;
            }
            return(true);
        }
Example #9
0
    public void Update(IStatusHandler netStatusHandlerDelegate)
    {
        if (!IgnoreGlobalPause && GlobalPause && CurStatus != STATUS.DEAD)
        {
            return;
        }
        if (!IsPlayer && Time.frameCount % 4 > 0)
        {
            return;
        }
        IStatus status = null;

        if (statusMap.TryGetValue(CurStatus, out status))
        {
            status.UpdateLogic();
            if (!IsLockAutoChange() && mActionController.IsUnderControl())
            {
                STATUS next = status.GetNextStatus();
                if (next != STATUS.NONE)
                {
                    next = GameLibrary.Instance().SetIdleStatusByScene(next);
                    if (UseNet && netStatusHandlerDelegate != null)
                    {
                        LockAutoChange();
                        netStatusHandlerDelegate.ChangeStatusTo(next);
                    }
                    else
                    {
                        ChangeStatusTo(next);
                    }
                }
            }
        }
        else
        {
            Debug.Log("Invalid Status:" + CurStatus);
        }
    }
 private IReadRestitcher GetRestitcher(PairHandler pairHandler, IStatusHandler statusHandler)
 {
     // TODO also allow not restitch
     return(new PostRealignmentStitcher(pairHandler, statusHandler, _stitcherOptions.StringTagsToKeepFromR1));
 }
Example #11
0
 public LogoutModel(SignInManager <IdentityUser> signInManager, ILogger <LogoutModel> logger, IStatusHandler statusHandler)
 {
     _signInManager     = signInManager;
     _logger            = logger;
     this.statusHandler = statusHandler;
 }
Example #12
0
        private static void RunDataLoader(Type type, ILoaderConfigHandler configHandler, IStatusHandler statusHandler)
        {

            if (type.IsSubclassOf(typeof(BaseDataLoader)))
            {
                var loader = (BaseDataLoader)Activator.CreateInstance(type);
                loader.InitializeHandlers(configHandler, statusHandler);
                loader.RunDataLoader();
            }
        }
Example #13
0
 public PostRealignmentStitcher(IReadPairHandler stitchedPairHandler, IStatusHandler statusHandler, List <string> tagsToKeepFromR1 = null)
 {
     _stitchedPairHandler = stitchedPairHandler;
     _statusHandler       = statusHandler;
     _tagsToKeepFromR1    = tagsToKeepFromR1 ?? new List <string>();
 }
 public StatusController(IStatusHandler handler)
 {
     m_handler = handler;
 }
Example #15
0
 public static IActionHandler CreateCommonActionHandler(IActorController actionController, IStatusHandler statusHandler, MobaObjectID type)
 {
     return(new CommonPlayerActionHandler(actionController, statusHandler));
 }
Example #16
0
 public void InitializeHandlers(IPropertyHandler propertyHandler, IStatusHandler statusHandler)
 {
     string typeName = this.GetType().Name;
     _properties = propertyHandler.GetProperties(typeName);
     _statusHandler = statusHandler;
 }
Example #17
0
        private static bool SetHandlers(ref ILoaderConfigHandler configStore, ref IStatusHandler statusHandler)
        {
            string reportStoreType = "";
            string reportStoreConnectionString = "";
            string configStoreName = "";
            string configStoreConnectionString = "";

            try
            {
                IniParser ini = new IniParser("conf.ini");
                reportStoreType = ini.GetSetting("STATUS_REPORT", "REPORT_TO");
                reportStoreConnectionString = ini.GetSetting("STATUS_REPORT", "REPORT_CONNECTION");
                configStoreName = ini.GetSetting("CONFIG_STORE", "TYPE");
                configStoreConnectionString = ini.GetSetting("CONFIG_STORE", "CONNECTION");
            }
            catch (System.IO.FileNotFoundException ex)
            {
                Console.WriteLine(ex.Message);
                return false;
            }

            //Setup property store
            //Currently we hardcode this to SQL Server, the infrastructure to reflect on it is in place
            configStore = new Aih.DataLoader.ConfigHandlers.SQLServerLoaderConfigHandler(configStoreConnectionString);


            //Setup where to report status to
            //Currently we hardcode this to SQL Server, the infrastructure to reflect on it is in place
            statusHandler = new Aih.DataLoader.StatusHandlers.SQLServerStatusHandler(reportStoreConnectionString);

            return true;
        }
        public bool TryFind(Credential credential, out IStatusHandler statusHandler)
        {
            if (AvailableStatusHandlers == null)
                AvailableStatusHandlers = _composeStatusHandler();

            statusHandler = null;

            IStatusHandler newStatusHandler = AvailableStatusHandlers.Any()
                                                  ? AvailableStatusHandlers.SingleOrDefault(
                                                      b => b.Protocol.Matches(credential.Protocol))
                                                  : null;

            if (newStatusHandler == null)
                return false;

            statusHandler = CompositionManager.Get<IStatusHandler>(newStatusHandler.GetType());

            if (statusHandler == null)
                return false;

            statusHandler.Credentials = credential;

            return true;
        }
Example #19
0
 public void SetNextHandler(IStatusHandler nextHandler)
 {
     _nextHandler = nextHandler;
 }