private void Filter()
    {
        try
        {
            var context = new Model.DataModel();

            var advertismentsWorkflow = new AdvertismentsLoadingWorkflow(context);
            var advertisments         = advertismentsWorkflow.LoadTodayAdversitments(AdvertismentState.JustParsed, _advertismentSectionCode);

            if (advertisments != null)
            {
                var advertsProcessing = new FilterWorkflow(_advertismentSectionCode, context);
                advertsProcessing.SetLog(_log);

                int goodAdvertismentsCount = advertsProcessing.FilterFromRealtors(advertisments);
                _log.WriteLog("Filtering finished. Good - " + goodAdvertismentsCount);
            }
        }
        catch (Exception e)
        {
            _log.WriteLog("Filtering inner error!" + Environment.NewLine +
                          "Error message: " + e.Message + Environment.NewLine +
                          ". Trace:" + e.StackTrace);
        }
        finally
        {
            if (HttpContext.Current != null)
            {
                HttpContext.Current.Application[_webFilterProcessName + "_TaskExecuted"] = false;
            }
        }
    }
Example #2
0
        /// <summary>
        /// Process the files.
        /// </summary>
        /// <param name="options">The parsed options.</param>
        private static void ProcessFiles(Options options)
        {
            WorkflowWriter.WriteLine(options.ToString());
            IFileSystem fileSystem     = new FileSystemHandler();
            IWorkflow   parse          = new ParseWorkflow(fileSystem);
            IWorkflow   validation     = new ValidateWorkflow(fileSystem);
            IWorkflow   filterWorkflow = new FilterWorkflow();
            IWorkflow   process        = new ProcessWorkflow(filterWorkflow);
            IWorkflow   target         = new TargetWorkflow();
            IWorkflow   copy           = new CopyWorkflow(fileSystem);
            IWorkflow   mainworkflow   = new MainWorkflow(
                parse,
                validation,
                process,
                target,
                copy);

            try
            {
                var result = mainworkflow.Process(options, Array.Empty <AstroFile>());
            }
            catch (Exception ex)
            {
                WorkflowWriter.WriteLine($"Error encountered: {ex.Message}.");
            }

            return;
        }
        public static void SetShowForAllFilters(FilterWorkflow filterWorkflow, bool selected)
        {
            const int kMaxLayers = 32;

            for (int i = 0; i < kMaxLayers; i++)
            {
                SetShowCollisionLayer(filterWorkflow, i, selected);
            }
            SetShowStaticColliders(filterWorkflow, selected);
            SetShowTriggers(filterWorkflow, selected);
            SetShowRigidbodies(filterWorkflow, selected);
            SetShowKinematicBodies(filterWorkflow, selected);
            SetShowSleepingBodies(filterWorkflow, selected);

            SetShowBoxColliders(filterWorkflow, selected);
            SetShowSphereColliders(filterWorkflow, selected);
            SetShowCapsuleColliders(filterWorkflow, selected);
            SetShowMeshColliders(filterWorkflow, MeshColliderType.Convex, selected);
            SetShowMeshColliders(filterWorkflow, MeshColliderType.NonConvex, selected);
            SetShowTerrainColliders(filterWorkflow, selected);
        }
 public static bool GetShowCapsuleColliders(FilterWorkflow filterWorkflow)
 {
     return(false);
 }
 public extern static bool GetShowTerrainColliders(FilterWorkflow filterWorkflow);
 public extern static bool GetShowSleepingBodies(FilterWorkflow filterWorkflow);
 public extern static bool GetShowCollisionLayer(FilterWorkflow filterWorkflow, int layer);
 public extern static bool GetShowRigidbodies(FilterWorkflow filterWorkflow);
 public extern static bool GetShowKinematicBodies(FilterWorkflow filterWorkflow);
 public extern static bool GetShowStaticColliders(FilterWorkflow filterWorkFlow);
 public extern static bool GetShowTriggers(FilterWorkflow filterWorkflow);
 public static void SetShowPhysicsSceneMask(FilterWorkflow filterWorkflow, int mask)
 {
 }
 public static void SetShowForAllFilters(FilterWorkflow filterWorkflow, bool selected)
 {
 }
 public static int GetShowPhysicsSceneMask(FilterWorkflow filterWorkflow)
 {
     return(0);
 }
 public static void SetShowTerrainColliders(FilterWorkflow filterWorkflow, bool show)
 {
 }
 public static bool GetShowTerrainColliders(FilterWorkflow filterWorkflow)
 {
     return(false);
 }
 public static bool GetShowMeshColliders(FilterWorkflow filterWorkflow, MeshColliderType colliderType)
 {
     return(false);
 }
 public static void SetShowCapsuleColliders(FilterWorkflow filterWorkflow, bool show)
 {
 }
 public extern static void SetShowStaticColliders(FilterWorkflow filterWorkflow, bool show);
 public extern static int GetShowCollisionLayerMask(FilterWorkflow filterWorkflow);
 public extern static void SetShowTriggers(FilterWorkflow filterWorkflow, bool show);
 public extern static void SetShowCollisionLayerMask(FilterWorkflow filterWorkflow, int mask);
 public extern static void SetShowRigidbodies(FilterWorkflow filterWorkflow, bool show);
 public extern static bool GetShowSphereColliders(FilterWorkflow filterWorkflow);
 public extern static void SetShowKinematicBodies(FilterWorkflow filterWorkflow, bool show);
 public extern static bool GetShowCapsuleColliders(FilterWorkflow filterWorkflow);
 public extern static void SetShowSleepingBodies(FilterWorkflow filterWorkflow, bool show);
 public extern static bool GetShowMeshColliders(FilterWorkflow filterWorkflow, MeshColliderType colliderType);
 public extern static void SetShowCollisionLayer(FilterWorkflow filterWorkflow, int layer, bool show);
 public extern static void SetShowMeshColliders(FilterWorkflow filterWorkflow, MeshColliderType colliderType, bool show);