Example #1
0
        protected override ProcessingStream <Image <Gray, byte>, Image <Gray, byte> > CreateStream()
        {
            var strategy = factory.Create(Settings.Algorithm);

            StrategyManager.SetStrategy(strategy);
            return(new CorrectionStream(strategy, Counter, CancellationToken.None, Logger));
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="isReload"></param>
        /// <returns></returns>
        protected override int LoadDocData(string fileName, bool isReload)
        {
            int result = base.LoadDocData(fileName, isReload);

            // Initialisation des stratégies
            CandleModel model = CandleModel.GetInstance(this.Store);

            StrategyManager.GetInstance(this.Store);

            // Execution du wizard d'initialisation (voir commentaire dans SoftwareComponentInsertRule
            if (model != null && model.SoftwareComponent != null && model.Name == "?")
            {
                using (Transaction transaction = model.Store.TransactionManager.BeginTransaction("Component initialization"))
                {
                    DSLFactory.Candle.SystemModel.Rules.SoftwareComponentInsertRule.ShowComponentWizard(model.SoftwareComponent);
                    transaction.Commit();
                }
            }

            Mapper.Instance.SetModel(model, fileName);

            // Force la validation du modèle - NON Validation sur open
            // model.ValidateReferences(new Microsoft.VisualStudio.Modeling.Validation.ValidationContext(Microsoft.VisualStudio.Modeling.Validation.ValidationCategories.Open, model));

            Mapper.Instance.RegisterEvents();

            return(result);
        }
Example #3
0
        public MvbdConnectionTCPIP(StrategyManager strategyMgr, Object o)
        {
            this.strategyMgr = strategyMgr;
            if (!isMvbdRunning())
            {
                Debug.WriteLine("MVBD isn't running!"); return;
            }
            // if (!strategyMgr.getSpecifiedOperationSystem().isApplicationRunning("NVDA")) { Debug.WriteLine("NVDA isn't running!"); return; }
            if (o.GetType().Equals(typeof(DisplayStrategyMVBD)))
            {
                displayStrategyMVBD = (DisplayStrategyMVBD)o;
            }
            else
            {
                if (o.GetType().Equals(typeof(ExternalScreenreaderNVDA)))
                {
                    externalScreenreaderNVDA = (ExternalScreenreaderNVDA)o;
                }
            }

            _endPoint = new IPEndPoint(IPAddress.Loopback, 2017); //TODO: auslesen

            ThreadPool.QueueUserWorkItem(new WaitCallback(Thread_Callback));
            System.Threading.Thread.Sleep(100); // Wait of connection to MVBD
            SendIdentifierOfClient();
        }
Example #4
0
        public ShadowsocksController()
        {
            _config          = Configuration.Load();
            _strategyManager = new StrategyManager(this);

            StartReleasingMemory();
        }
Example #5
0
        public void Initialize()
        {
            strategyMgr = new StrategyManager();
            grantTrees  = new GeneratedGrantTrees();
            Settings settings = new Settings();

            searchNodes   = new SearchNodes(strategyMgr, grantTrees, treeOperation);
            treeOperation = new TreeOperation(strategyMgr, grantTrees);
            strategyMgr.setSpecifiedTree(settings.getPossibleTrees()[0].className);
            strategyMgr.setSpecifiedEventStrategy(settings.getPossibleEventManager()[0].className);
            strategyMgr.setSpecifiedFilter(Settings.getPossibleFilters()[0].className);
            strategyMgr.setSpecifiedDisplayStrategy(settings.getPosibleDisplayStrategies()[0].className);
            strategyMgr.setSpecifiedGeneralTemplateUi(settings.getPossibleUiTemplateStrategies()[0].className);
            strategyMgr.getSpecifiedGeneralTemplateUi().setGeneratedGrantTrees(grantTrees);
            strategyMgr.getSpecifiedGeneralTemplateUi().setTreeOperation(treeOperation);
            List <GRANTManager.Strategy> posibleOS = settings.getPossibleOperationSystems();

            strategyMgr.setSpecifiedOperationSystem(settings.getPossibleOperationSystems()[0].className);
            strategyMgr.getSpecifiedFilter().setGeneratedGrantTrees(grantTrees);
            strategyMgr.getSpecifiedFilter().setTreeOperation(treeOperation);
            guiFuctions = new GuiFunctions(strategyMgr, grantTrees, treeOperation);

            pathToTemplate = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Template");
            pathToTemplate = System.IO.Path.Combine(pathToTemplate, "TemplateUi.xml");
            //
            guiFuctions.deleteGrantTrees();
        }
Example #6
0
        /// <summary>
        /// Mise à jour des noms du package et de la couche d'interface
        /// </summary>
        /// <param name="slayer">The slayer.</param>
        private static void UpdateInterfaceAndLayerPackageName(SoftwareLayer slayer)
        {
            Layer layer = slayer as Layer;

            if (layer == null)
            {
                return;
            }

            LayerPackage package = layer.LayerPackage;

            if (String.IsNullOrEmpty(package.Name) && package.Name != "?")
            {
                package.Name = StrategyManager.GetInstance(layer.Store).NamingStrategy.GetLayerName(layer);
            }

            if (package.InterfaceLayer != null)
            {
                if (String.IsNullOrEmpty(package.InterfaceLayer.Name))
                {
                    package.InterfaceLayer.Name =
                        StrategyManager.GetInstance(layer.Store).NamingStrategy.CreateLayerName(package,
                                                                                                package.InterfaceLayer,
                                                                                                layer.Name);
                }
            }
        }
Example #7
0
        /// <summary>
        /// Merges the configure.
        /// </summary>
        /// <param name="elementGroup">The element group.</param>
        protected override void MergeConfigure(Microsoft.VisualStudio.Modeling.ElementGroup elementGroup)
        {
            base.MergeConfigure(elementGroup);

            DomainClassInfo.SetUniqueName(this, StrategyManager.GetInstance(this.Store).NamingStrategy.CreateLayerName(null, this, this.Name));
            Namespace = StrategyManager.GetInstance(this.Store).NamingStrategy.CreateNamespace(Component.Namespace, Name, this);
        }
Example #8
0
        /// <summary>
        /// Prise en compte d'une référence sur un SoftwareLayer
        /// </summary>
        /// <param name="layer">The layer.</param>
        private void AcceptSoftwareLayer(SoftwareLayer layer)
        {
            if (_scope == ReferenceScope.Compilation)
            {
                if (layer is Layer && ((Layer)layer).InterfaceLayer != null)
                {
                    return;
                }

                if (!IsExternalModel && _initialModelIsInSolution)
                {
                    // Pour une compilation, si il n'y a pas d'interface et qu'on est dans le modèle initial, on
                    // se contente de prendre le nom du projet
                    _references.Add(layer.VSProjectName);
                    return;
                }
            }

            string extension = ".dll";

            if (_initialModelIsInSolution)
            {
                extension = StrategyManager.GetInstance(layer.Store).GetAssemblyExtension(layer);
            }

            AddFullNameAssembly(layer, extension);
        }
Example #9
0
        protected void ValidateRoleNames(ValidationContext context)
        {
            if (TargetMultiplicity != Multiplicity.NotApplicable)
            {
                if (String.IsNullOrEmpty(TargetRoleName))
                {
                    context.LogError(
                        String.Format("Target role name required for relation between {0} & {1}", Source.Name,
                                      Target.Name), "REL001", this);
                }
                else if (!StrategyManager.GetInstance(Store).NamingStrategy.IsClassNameValid(TargetRoleName))
                {
                    context.LogError(
                        String.Format("Invalid target role name for relation between {0} & {1}", Source.Name,
                                      Target.Name), "REL002", this);
                }
            }

            if (SourceMultiplicity != Multiplicity.NotApplicable)
            {
                if (String.IsNullOrEmpty(SourceRoleName))
                {
                    context.LogError(
                        String.Format("Target role name required for relation between {0} & {1}", Source.Name,
                                      Target.Name), "REL001", this);
                }
                else if (!StrategyManager.GetInstance(Store).NamingStrategy.IsClassNameValid(SourceRoleName))
                {
                    context.LogError(
                        String.Format("Invalid target role name for relation between {0} & {1}", Source.Name,
                                      Target.Name), "REL002", this);
                }
            }
        }
Example #10
0
        //internal void InitProperties( RepositoryItem repositoryItem )
        //{
        //    txtNamespace.Text = repositoryItem.Name;
        //    UpdateApplicationName();
        //    txtVersionBuild.Value = repositoryItem.Version.Revision;
        //    txtVersionMajor.Value = repositoryItem.Version.Major;
        //    txtVersionMinor.Value = repositoryItem.Version.Minor;
        //    txtDescription.Text = repositoryItem.Description;
        //}

        /// <summary>
        /// Validates the data.
        /// </summary>
        /// <returns></returns>
        private bool ValidateData()
        {
            bool error = false;

            errors.Clear();

            if (!StrategyManager.GetInstance(_component.Store).NamingStrategy.IsClassNameValid(txtApplicationName.Text))
            {
                errors.SetError(txtApplicationName, "Invalid name");
                error = true;
            }
            else if (RepositoryManager.Instance.ModelsMetadata.Metadatas.NameExists(txtApplicationName.Text))
            {
                errors.SetError(txtApplicationName,
                                "Invalid name. This name is already used. You must provide an unique appplication name.");
                error = true;
            }

            if (txtDomainPath.Text.Length == 0)
            {
                errors.SetError(txtDomainPath, "The domain path is mandatory.");
                error = true;
            }

            if (!StrategyManager.GetInstance(_component.Store).NamingStrategy.IsNamespaceValid(txtNamespace.Text))
            {
                errors.SetError(txtNamespace, "Invalid Namespace");
                error = true;
            }
            return(!error);
        }
Example #11
0
    IEnumerator Start()
    {
        Time.fixedDeltaTime = Const.FixedDeltaTime;
        Configuration.ReadFromFileOrCreate("config.json");

        if (gameObject.name != "Entity")
        {
            throw new ArgumentException("PlayMain is not binding in an Entity");
        }
        Singleton = gameObject;
        DontDestroyOnLoad(gameObject);

        StrategyManager = new StrategyManager();
        GlobalMatchInfo = MatchInfo.NewDefaultPreset();
        // 绑定物体
        ObjectManager = new ObjectManager();
        ObjectManager.RebindObject();
        ObjectManager.RebindMatchInfo(GlobalMatchInfo);
        Event.Register(Event.EventType0.PlaySceneExited, SceneExited);

        // 等待当前帧渲染完毕后暂停,确保还原后的场景显示到屏幕上
        yield return(new WaitForEndOfFrame());

        ObjectManager.Pause();
    }
Example #12
0
        protected void ValidateName(ValidationContext context)
        {
            if (String.IsNullOrEmpty(Name))
            {
                return; // voir validation pour NamedElement
            }
            string msg     = "Name is not valid ({0}).";
            bool   isValid = false;

            try
            {
                // Set the test boolean to true, if validation is correct.
                isValid = StrategyManager.GetInstance(Store).NamingStrategy.IsClassNameValid(Name);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }

            if (!isValid)
            {
                context.LogError(
                    String.Format(msg, Name),
                    "InvalidName1", // Unique error number
                    this);
            }
        }
Example #13
0
        public void Initialize()
        {
            strategyMgr = new StrategyManager();
            grantTrees  = new GeneratedGrantTrees();
            Settings settings = new Settings();

            treeOperation = new TreeOperation(strategyMgr, grantTrees);
            List <GRANTManager.Strategy> posibleOS = settings.getPossibleOperationSystems();

            strategyMgr.setSpecifiedTree(settings.getPossibleTrees()[0].className);
            strategyMgr.setSpecifiedEventStrategy(settings.getPossibleEventManager()[0].className);
            strategyMgr.setSpecifiedFilter(Settings.getPossibleFilters()[0].className);
            strategyMgr.setSpecifiedDisplayStrategy(settings.getPosibleDisplayStrategies()[0].className);
            strategyMgr.setSpecifiedGeneralTemplateUi(settings.getPossibleUiTemplateStrategies()[0].className);
            strategyMgr.getSpecifiedGeneralTemplateUi().setGeneratedGrantTrees(grantTrees);
            strategyMgr.getSpecifiedGeneralTemplateUi().setTreeOperation(treeOperation);
            strategyMgr.getSpecifiedFilter().setGeneratedGrantTrees(grantTrees);
            strategyMgr.setSpecifiedOperationSystem(settings.getPossibleOperationSystems()[0].className);
            strategyMgr.getSpecifiedFilter().setTreeOperation(treeOperation);
            guiFuctions = new GuiFunctions(strategyMgr, grantTrees, treeOperation);
            String projectPath;

            projectPath  = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "SavedTrees");
            treePathUia2 = System.IO.Path.Combine(projectPath, "filteredTree_Rechner.grant");
        }
Example #14
0
        public void TestNoPositions()
        {
            var orderCreator = new OrderCreator();
            var manager      = new StrategyManager(orderCreator);

            Assert.Equal(0, manager.StrategyInfo.MarketPosition);
        }
Example #15
0
        protected void ValidateNamespace(ValidationContext context)
        {
            string msg  = "Invalid namespace";
            bool   test = false;

            try
            {
                // Set the test boolean to true, if validation is correct.
                test = !String.IsNullOrEmpty(Name) &&
                       StrategyManager.GetInstance(Store).NamingStrategy.IsNamespaceValid(Name);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }

            if (!test)
            {
                context.LogError(
                    msg,
                    "1", // Unique error number
                    this);
            }
            else if (!String.IsNullOrEmpty(StrategyManager.GetInstance(Store).NamingStrategy.DefaultNamespace) &&
                     !Name.StartsWith(StrategyManager.GetInstance(Store).NamingStrategy.DefaultNamespace))
            {
                context.LogWarning(
                    String.Format("Namespace must begin with '{0}'",
                                  StrategyManager.GetInstance(Store).NamingStrategy.DefaultNamespace),
                    "2", // Unique error number
                    this);
            }
        }
Example #16
0
        public void Initialize()
        {
            strategyMgr = new StrategyManager();
            grantTrees  = new GeneratedGrantTrees();
            Settings settings = new Settings();

            treeOperation = new TreeOperation(strategyMgr, grantTrees);
            List <GRANTManager.Strategy> posibleOS = settings.getPossibleOperationSystems();
            List <Strategy> str = settings.getPossibleTrees();

            strategyMgr.setSpecifiedTree(settings.getPossibleTrees()[0].className);
            strategyMgr.setSpecifiedEventStrategy(settings.getPossibleEventManager()[0].className);
            strategyMgr.setSpecifiedFilter(Settings.getPossibleFilters()[0].className);
            // strategyMgr.setSpecifiedDisplayStrategy(settings.getPosibleDisplayStrategies()[0].className);

            /* strategyMgr.setSpecifiedGeneralTemplateUi(settings.getPossibleUiTemplateStrategies()[0].className);
             * strategyMgr.getSpecifiedGeneralTemplateUi().setGeneratedGrantTrees(grantTrees);
             * strategyMgr.getSpecifiedGeneralTemplateUi().setTreeOperation(treeOperation);*/
            strategyMgr.getSpecifiedFilter().setGeneratedGrantTrees(grantTrees);
            strategyMgr.setSpecifiedOperationSystem(settings.getPossibleOperationSystems()[0].className);

            /*strategyMgr.setSpecifiedBrailleDisplay(settings.getPossibleBrailleDisplays()[0].className);
             * strategyMgr.getSpecifiedBrailleDisplay().setGeneratedGrantTrees(grantTrees);
             * strategyMgr.getSpecifiedBrailleDisplay().setStrategyMgr(strategyMgr);
             * strategyMgr.getSpecifiedBrailleDisplay().setTreeOperation(treeOperation);*/
            strategyMgr.getSpecifiedFilter().setTreeOperation(treeOperation);
            guiFuctions = new GuiFunctions(strategyMgr, grantTrees, treeOperation);

            //Anwendung starten
            HelpFunctions hf = new HelpFunctions(strategyMgr, grantTrees);

            hf.startApp(applicationName, applicationPathName);
        }
Example #17
0
        /// <summary>
        /// Calculates the transfers.
        /// </summary>
        /// <param name="superRegion">The super region.</param>
        public void CalculateTransfers(SuperRegion superRegion)
        {
            bool skipSuperRegion = StrategyManager.SkipSuperRegion(superRegion);

            if (skipSuperRegion)
            {
                return;
            }

            bool transferDone = false;

            bool borderTerritoriesWithEnemyArmies = StrategyManager.EnemyBorderTerritories(superRegion, SuperRegions);
            bool regionsWithEnemyArmies           = StrategyManager.EnemyRegions(superRegion);

            if (!borderTerritoriesWithEnemyArmies && !regionsWithEnemyArmies)
            {
                transferDone = CalculateForNoEnemies(superRegion);
            }

            if (borderTerritoriesWithEnemyArmies && !transferDone)
            {
                transferDone = CalculateForEnemyBorderTerritories(superRegion);
            }

            if (regionsWithEnemyArmies && !transferDone)
            {
                transferDone = CalculateForEnemyRegions(superRegion);
            }

            var stuckArmies = StrategyManager.GetStuckArmies(superRegion, Transfers);

            CalculateForStuckArmies(stuckArmies);
        }
Example #18
0
        public void Initialize()
        {
            strategyMgr = new StrategyManager();
            grantTrees  = new GeneratedGrantTrees();
            Settings settings = new Settings();

            treeOperation = new TreeOperation(strategyMgr, grantTrees);
            List <GRANTManager.Strategy> posibleOS = settings.getPossibleOperationSystems();
            List <Strategy> str = settings.getPossibleTrees();

            strategyMgr.setSpecifiedTree(settings.getPossibleTrees()[0].className);
            strategyMgr.setSpecifiedEventStrategy(settings.getPossibleEventManager()[0].className);
            strategyMgr.setSpecifiedFilter(Settings.getPossibleFilters()[0].className);
            strategyMgr.setSpecifiedBrailleDisplay(settings.getPossibleBrailleDisplays()[0].className);
            strategyMgr.getSpecifiedBrailleDisplay().setStrategyMgr(strategyMgr);
            strategyMgr.getSpecifiedBrailleDisplay().setTreeOperation(treeOperation);
            strategyMgr.getSpecifiedBrailleDisplay().setGeneratedGrantTrees(grantTrees);
            strategyMgr.setSpecifiedDisplayStrategy(settings.getPosibleDisplayStrategies()[0].className);
            strategyMgr.setSpecifiedGeneralTemplateUi(settings.getPossibleUiTemplateStrategies()[0].className);
            strategyMgr.getSpecifiedGeneralTemplateUi().setGeneratedGrantTrees(grantTrees);
            strategyMgr.getSpecifiedGeneralTemplateUi().setTreeOperation(treeOperation);
            strategyMgr.getSpecifiedFilter().setGeneratedGrantTrees(grantTrees);
            strategyMgr.setSpecifiedOperationSystem(settings.getPossibleOperationSystems()[0].className);
            strategyMgr.setSpecifiedExternalScreenreader(settings.getPossibleExternalScreenreaders()[0].className);
            strategyMgr.setSpecifiedBrailleConverter(settings.getPossibleBrailleConverter()[0].className);
            strategyMgr.getSpecifiedFilter().setTreeOperation(treeOperation);
            guiFuctions = new GuiFunctions(strategyMgr, grantTrees, treeOperation);

            treePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "SavedTrees", "calc.grant");
        }
Example #19
0
        /// <summary>
        /// Allows the model element to configure itself immediately after the Merge process has related it to the target element.
        /// </summary>
        /// <param name="elementGroup">The group of source elements that have been added back into the target store.</param>
        protected override void MergeConfigure(ElementGroup elementGroup)
        {
            base.MergeConfigure(elementGroup);
            LayerPackage.Level = Level;

            DomainClassInfo.SetUniqueName(this,
                                          StrategyManager.GetInstance(Store).NamingStrategy.CreateLayerName(
                                              LayerPackage, this, Name));
            Namespace =
                StrategyManager.GetInstance(Store).NamingStrategy.CreateNamespace(Component.Namespace, Name, this);

            Layer mainLayer = SoftwareComponent.GetMainLayer();

            if (mainLayer == null)
            {
                mainLayer = SoftwareComponent.SuggestMainLayer(null);
                if (mainLayer == this)
                {
                    mainLayer.StartupProject = true;
                    mainLayer.HostingContext = HostingContext.Standalone;
                }
            }
            else if (mainLayer.Level < Level)
            {
                HostingContext = mainLayer.HostingContext;
            }
        }
Example #20
0
        public void TestOrderCanceledTriggeredAfterNotSendingOrder()
        {
            var orderCreator = new OrderCreator();
            var manager      = new StrategyManager(orderCreator);

            using var monitoredManager = manager.Monitor();
            orderCreator.Limit(new SOrderParameters()).Send(20);
            manager.TriggerOrders(new Bar()
            {
                Low = 21
            });
            orderCreator.Limit(new SOrderParameters()).Send(20);
            manager.TriggerOrders(new Bar()
            {
                Low = 22
            });

            monitoredManager.Should()
            .Raise("OrderValidated")
            .WithArgs <OrderInfo>(info => info.Price == 20)
            .OnlyOnce();
            monitoredManager.Should().NotRaise("OrderCanceled");
            Assert.Equal(0, manager.StrategyInfo.MarketPosition);

            // If we don't send the order again, it should be canceled
            manager.TriggerOrders(new Bar()
            {
                Low = 23
            });
            monitoredManager.Should().Raise("OrderCanceled");
            Assert.Equal(0, manager.StrategyInfo.MarketPosition);
        }
Example #21
0
        public void TestOrderValidatedTriggeredAgain()
        {
            var orderCreator = new OrderCreator();
            var manager      = new StrategyManager(orderCreator);

            using var monitoredManager = manager.Monitor();
            orderCreator.Limit(new SOrderParameters()).Send(20);
            manager.TriggerOrders(new Bar()
            {
                Low = 19
            });

            Assert.Equal(100, manager.StrategyInfo.MarketPosition);
            monitoredManager.Should()
            .Raise("OrderValidated")
            .WithArgs <OrderInfo>(info => info.Price == 20)
            .OnlyOnce()
            .Reset();

            // The same order is allowed to be sent again after being filled
            orderCreator.Limit(new SOrderParameters()).Send(20);
            monitoredManager.Should()
            .Raise("OrderValidated")
            .WithArgs <OrderInfo>(info => info.Price == 20)
            .OnlyOnce();
        }
        public override void PreApplicationStartInitialize()
        {
            //初始化策略管理器
            StrategyManager = new StrategyManager();
            //初始化插件管理器
            PlusManager = new PlusManager();
            //【优先加载框架策略】加载框架策略作为默认策略,如果插件实现了该策略,则会被覆盖
            //默认集成了日志策略
            PlusManager.LoadPlusStrategys(this.GetType().Assembly);
            //初始化资源压缩类
            ResourceMinHelper = new ResourceMinHelper();
            //初始化嵌入资源管理器
            ManifestResourceManager = new ManifestResourceManager();
            //初始化资源管理辅助类
            CurrentResourceHelper = new ResourceHelper();
            //初始化配置管理器
            ConfigManager = new ConfigManager();
            //加载程序集
            LoadAssemblies();

            GlobalConfigurationManager.MapHttpAttributeRoutes();
            //初始化OData
            GlobalConfigurationManager.InitializeODATA();
            //初始化WebApi
            GlobalConfigurationManager.InitializeWebAPI();
            //初始化MVC插件引擎
            GlobalConfigurationManager.InitializeMVCEngines();
        }
 public FuckshadowsController()
 {
     _config = Configuration.Load();
     StatisticsConfiguration = StatisticsStrategyConfiguration.Load();
     _strategyManager        = new StrategyManager(this);
     StartTrafficStatistics(61);
 }
Example #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityNameConfirmation"/> class.
 /// </summary>
 /// <param name="layer">The layer.</param>
 /// <param name="initialName">The initial name.</param>
 public EntityNameConfirmation(DataLayer layer, string initialName)
 {
     InitializeComponent();
     _layer             = layer;
     txtRootName.Text   = StrategyManager.GetInstance(layer.Store).NamingStrategy.ToPascalCasing(initialName);
     txtEntityName.Text =
         StrategyManager.GetInstance(layer.Store).NamingStrategy.CreateElementName(layer, txtRootName.Text);
 }
 public ShadowsocksController()
 {
     _config          = Configuration.Load();
     _strategyManager = new StrategyManager(this);
     _pluginsByServer = new ConcurrentDictionary <Server, Sip003Plugin>();
     StartReleasingMemory();
     StartTrafficStatistics(61);
 }
Example #26
0
 /// <summary>
 /// Nom du répertoire (logique) contenant le projet
 /// </summary>
 /// <returns></returns>
 public override string GetProjectFolderName()
 {
     return
         (StrategyManager.GetInstance(Store).NamingStrategy.CreateProjectFolderName(this,
                                                                                    LayerPackage != null
                                                                                       ? LayerPackage.Name
                                                                                       : null));
 }
 public bool IsFoodLessThan(StrategyManager strategyManager)
 {
     if (strategyManager.player.resources.food >= 50)
     {
         return(true);
     }
     return(false);
 }
Example #28
0
 //todo warum wird methode windowsEventsHandler.setStrategyMgr aufgerfuen und gleichzeitig übergabe des strategymgr in windowseventhandler? z38 auskommentiert
 /// <summary>
 /// Init des eventhandler, mit übergabe des tartagymanager für nutzung von diesem, und eventmonitor mit übergabe des eventhandler, da dieser in eventmonitor erzeugt und methoden daraus genutzt werden
 /// </summary>
 public OperationSystemStrategyWindows(StrategyManager manager)
 {
     strategyMgr          = manager;
     windowsEventsHandler = new Windows_EventsHandler(strategyMgr);
     //windowsEventsHandler.setStrategyMgr(strategyMgr);
     windowsEventsMonitor = new Windows_EventsMonitor(windowsEventsHandler);
     paintRecThread       = new Thread(delegate() { paintRecClear(null); });
 }
Example #29
0
 /// <summary>
 /// Handles the KeyUp event of the txtName control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Windows.Forms.KeyEventArgs"/> instance containing the event data.</param>
 private void txtName_KeyUp(object sender, KeyEventArgs e)
 {
     if (_iLayer != null)
     {
         txtContractName.Text =
             StrategyManager.GetInstance(_layer.Store).NamingStrategy.CreateElementName(_iLayer, txtName.Text);
     }
 }
 public ShadowsocksController()
 {
     _config = Configuration.Load();
     StatisticsConfiguration = StatisticsStrategyConfiguration.Load();
     _strategyManager        = new StrategyManager(this);
     StartReleasingMemory();
     StartTrafficStatistics(60);
 }
Example #31
0
        public Creature(StrategyManager strategyManager)
        {
            ResoursesStorage = new ResoursesStorage(50, 0);

            CreatureState = CreatureState.Idle;
            _aStar = new AStar(strategyManager, this);

            _strategyManager = strategyManager;

            AnimationState = CreatureAnimationState.MoveRight;
        }
Example #32
0
        public static Creature CreateHuman(StrategyManager strategyManager,
                                           CreatureRelation relation)
        {
            Creature human = new Creature(strategyManager)
                                 {
                                     MoveRightSprite = TextureManager.GetAnimSprite(SpriteType.HumanMoveRight),

                                     Kind = CreatureKind.Human,
                                     Relation = relation
                                 };
            human.MoveRightSprite.TimePerFrame = 250f;
            return human;
        }
Example #33
0
		public void TestStrategyManagerFindsOriginal()
		{
			if (!Global.IsReadyRedlineEnabled)
				return;
			
			IMail inboxMail = SendMailAndWaitForItToReturnToInbox();

			StrategyManager sm = new StrategyManager(inboxMail);
			IStrategyResult result = sm.OriginalMail;

			Assert.AreEqual(1, result.Count);

			IMail sentMail = result.First() as IMail;

			Assert.IsNotNull(sentMail);
			Assert.AreEqual(1, sentMail.Attachments.Count);
			Assert.IsTrue(sentMail.Attachments.First().IsModified == false);
			Assert.IsNotNull(sentMail.Attachments.First().TrackingId);
			Assert.IsTrue("ReadyRedlineDocumentTrackingTest.doc" == sentMail.Attachments.First().DisplayName);
		}
Example #34
0
 public AStar(StrategyManager strategyManager, Creature creature)
 {
     this.StrategyManager = strategyManager;
     this.Creature = creature;
 }
        public override void PreApplicationStartInitialize()
        {
            //初始化策略管理器
            StrategyManager = new StrategyManager();
            //初始化插件管理器
            PlusManager = new PlusManager();
            //【优先加载框架策略】加载框架策略作为默认策略,如果插件实现了该策略,则会被覆盖
            //默认集成了日志策略
            PlusManager.LoadPlusStrategys(this.GetType().Assembly);
            //初始化嵌入资源管理器
            ManifestResourceManager = new ManifestResourceManager();
            //初始化文档协议管理器
            DocumentsOpenProtocolManager = new DocumentsOpenProtocolManager();
            //初始化配置管理器
            ConfigManager = new ConfigManager();
            //加载程序集
            LoadAssemblies();

            GlobalConfigurationManager.MapHttpAttributeRoutes();
            //初始化OData
            GlobalConfigurationManager.InitializeODATA();
            //初始化WebApi
            GlobalConfigurationManager.InitializeWebAPI();
            //初始化MVC插件引擎
            GlobalConfigurationManager.InitializeMVCEngines();

        }
Example #36
0
 public StrategyState()
 {
     StrategyManager = new StrategyManager();
 }