protected InheritanceItem CreateInheritanceItem()
        {
            var result = new InheritanceItem();

            DefaultSettingsOfCodeEntityHelper.SetUpInheritanceItem(result, CurrentDefaultSetings);
            return(result);
        }
Exemple #2
0
        public void Run()
        {
            _logger.Info("Begin");

            var context = TstEngineContextHelper.CreateAndInitContext().EngineContext;

            var defaultSettings = new DefaultSettingsOfCodeEntity();

            defaultSettings.Holder = NameHelper.CreateName("Tor");

            _logger.Info($"defaultSettings = {defaultSettings}");

            var applicationInheritanceItem = new InheritanceItem()
            {
                IsSystemDefined = true
            };

            applicationInheritanceItem.SubName   = NameHelper.CreateName("PeaseKeeper");
            applicationInheritanceItem.SuperName = context.CommonNamesStorage.AppName;
            applicationInheritanceItem.Rank      = new LogicalValue(1.0F);

            _logger.Info($"applicationInheritanceItem (1) = {applicationInheritanceItem}");

            DefaultSettingsOfCodeEntityHelper.SetUpInheritanceItem(applicationInheritanceItem, defaultSettings);

            _logger.Info($"applicationInheritanceItem (2) = {applicationInheritanceItem}");

            _logger.Info("End");
        }
Exemple #3
0
        private void ProcessUseNotInheritance()
        {
            var paramsList = TakePositionedParameters(4);

#if DEBUG
            //Log($"paramsList = {paramsList.WriteListToString()}");
            //Log($"_currentCodeFrame = {_currentCodeFrame.ToDbgString()}");
#endif

            var inheritenceItem = new InheritanceItem();
            DefaultSettingsOfCodeEntityHelper.SetUpInheritanceItem(inheritenceItem, _currentCodeFrame.LocalContext.Storage.DefaultSettingsOfCodeEntity);

            var subName = paramsList[0].AsStrongIdentifierValue;

            var superName = paramsList[1].AsStrongIdentifierValue;

#if DEBUG
            //Log($"paramsList[2] = {paramsList[2]}");
#endif

            var rank = _logicalValueLinearResolver.Resolve(paramsList[2], _currentCodeFrame.LocalContext, ResolverOptions.GetDefaultOptions(), true).Inverse();

#if DEBUG
            //Log($"subName = {subName}");
            //Log($"superName = {superName}");
            //Log($"rank = {rank}");
#endif

            inheritenceItem.SubName   = subName;
            inheritenceItem.SuperName = superName;
            inheritenceItem.Rank      = rank;

#if DEBUG
            //Log($"inheritenceItem = {inheritenceItem}");
#endif

            _globalStorage.InheritanceStorage.SetInheritance(inheritenceItem);

            _currentCodeFrame.CurrentPosition++;
        }