public becFeatureCWPAnalysisExtension(folderNode __folder, IAceOperationSetExecutor __parent) : base(__folder, __parent)
 {
     _rendering = new becDocumentRenderingExtension(__parent, __folder);
     _features  = new becFeatureVectorExtension(__folder, __parent);
     _weight    = new becWeightingModelExtension(__folder, __parent);
     SetSubBinding();
 }
Example #2
0
 /// <summary>
 /// Use as built-in plugin to a console
 /// </summary>
 /// <param name="__parent">The parent.</param>
 /// <param name="__name">The name.</param>
 protected aceConsolePluginBase(IAceOperationSetExecutor __parent, String __name, String __help = "")
 {
     name         = __name;
     _consoleHelp = __help;
     parent       = __parent;
     prepare();
 }
Example #3
0
        public becDataSetReportingExtension(folderNode __folder, IAceOperationSetExecutor __parent) : base(__folder, __parent)
        {
            dataSet = new becDataSetProviderExtension(__folder, __parent);

            render = new becDocumentRenderingExtension(__parent, __folder);

            SetSubBinding();
        }
Example #4
0
        public becGlobalWeightTableConstructionExtension(folderNode __folder, IAceOperationSetExecutor __parent) : base(__folder, __parent)
        {
            _weighting = new becWeightingModelExtension(__folder, this);


            _rendering = new becDocumentRenderingExtension(this, __folder);
            SetSubBinding();
        }
        public imbMCManager(IAceOperationSetExecutor __parent = null, string repoRootFolder = "") : base(__parent, MCManagerName, MCManagerHelpLine)
        {
            if (repoRootFolder.isNullOrEmpty())
            {
                repoRootFolder = MCRepo_DefaultDirectoryName;
            }

            folder = GetMCRepoNode(); //new folderNode(repoRootFolder, "MC repositories", "Root directory of a MC Repository Manager");
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProceduralFolderFor{TP, T, TCMAIN, TCEXTRA}"/> class.
        /// </summary>
        /// <param name="folds">The folds.</param>
        /// <param name="setup">The setup.</param>
        /// <param name="_notes">The notes.</param>
        public ProceduralFolderFor(IList <ExperimentDataSetFold> folds, T setup, ToolkitExperimentNotes _notes, IAceOperationSetExecutor __executor)
        {
            executor = __executor;
            DeployFolder(folds, setup, _notes);

#if DEBUG
            EnableParallel = false;
#endif
        }
Example #7
0
        public nlpOperationsPlugin(folderNode _folder, IAceOperationSetExecutor __parent) : base(__parent)
        {
            folder = _folder;
            //_wtConstructor = new becGlobalWeightTableConstructionExtension(_folder, __parent);
            _docSelection          = new becDocumentSelectionExtension(_folder, this);
            _wtConstructor         = new becGlobalWeightTableConstructionExtension(_folder, this);
            _docClassification     = new becClassificationExtension(_folder, this);
            _projectionConstructor = new becProjectionWeightTableExtension(_folder, this);

            _analysis = new becFeatureCWPAnalysisExtension(_folder, this);
        }
        //public DocumentRankingMethod data { get; set; } = new DocumentRankingMethod();

        public becDocumentSelectionExtension(folderNode __folder, IAceOperationSetExecutor __parent) : base(__folder, __parent)
        {
            //_weighting = new becWeightingModelExtension(__folder.Add(", this);
            _rendering = new becDocumentRenderingExtension(this, __folder);


            _weight = new becWeightingModelExtension(__folder, this);


            _features = new becFeatureVectorExtension(__folder, __parent);
            SetSubBinding();
        }
        public becProjectionWeightTableExtension(folderNode _folder, IAceOperationSetExecutor __parent) : base(_folder, __parent)
        {
            folder = _folder;

            _primaryRendering = new becDocumentRenderingExtension(this, _folder);


            _secondaryRendering = new becDocumentRenderingExtension(this, _folder);


            _secondaryModel = new becDocumentSelectionExtension(_folder, __parent);
        }
Example #10
0
        /// <summary>
        /// Builds the command tree.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="includeParentTypes">if set to <c>true</c> it will include only this type.</param>
        /// <returns></returns>
        public static commandTree BuildCommandTree(IAceOperationSetExecutor source, Boolean includeParentTypes = true)
        {
            commandTree rootDesc = new commandTree();

            rootDesc.name        = "commands";
            rootDesc.nodeLevel   = commandTreeNodeLevel.root;
            rootDesc.description = $"Reference of console commands available at {source.consoleTitle} command line interface.";
            rootDesc.helpLines.Add(source.consoleHelp);
            rootDesc.helpLines.AddRange(source.helpHeader);
            commandTree output = rootDesc;

            List <Type> types = new List <Type>();

            if (includeParentTypes)
            {
                types = source.GetType().GetBaseTypeList(true, true, typeof(aceOperationSetExecutorBase));
            }
            else
            {
                types.Add(source.GetType());
            }


            types.Reverse();

            foreach (Type t in types)
            {
                if (t.IsInterface)
                {
                    continue;
                }
                if (t.IsClass)
                {
                    output.Add(BuildTreeNodeForType(t, source, output), t.Name);
                }
            }

            return(output);
        }
Example #11
0
        //public propertyLoadSaveExtension file { get; set; }

        //public EntityPlaneMethodSettings entityMethod { get; set; } = new EntityPlaneMethodSettings();

        public becDocumentRenderingExtension(IAceOperationSetExecutor __parent, folderNode __folder) : base(__folder, __parent)
        {
        }
Example #12
0
 public becWeightingModelEditExtension(folderNode __folder, IAceOperationSetExecutor __parent) : base(__folder, __parent)
 {
 }
Example #13
0
 public becFeatureFilterModelExtension(folderNode __folder, IAceOperationSetExecutor __parent) : base(__folder, __parent)
 {
     model = new becWeightingModelEditExtension(__folder, __parent);
     SetSubBinding();
 }
Example #14
0
        public aceCommandEntry(IAceCommandConsole __console, string input) : base(input)
        {
            console = __console as aceCommandConsole;

            validate();
        }
Example #15
0
        protected void validate()
        {
            if (hasCommand)
            {
                IAceOperationSetExecutor executor = console;

                if (hasPrefix)
                {
                    String __prefix = prefix.toCsvInLine(COMMANDPREFIX_SEPARATOR);


                    executor = console.imbGetPropertySafe(__prefix, console) as IAceOperationSetExecutor;

                    if (executor == null)
                    {
                        if (console is aceCommandConsole)
                        {
                            aceCommandConsole aceConsole = console as aceCommandConsole;
                            __prefix = __prefix.removeStartsWith(aceConsole.commandSetTree.name + ".");


                            executor = console.imbGetPropertySafe(__prefix, console) as IAceOperationSetExecutor;

                            if (executor == null)
                            {
                                var coms = aceConsole.commandSetTree.GetCommands(__prefix);



                                if (coms.Any())
                                {
                                    var com = coms.FirstOrDefault(x => (x.name == command || x.menuMeta.aliasList.Contains(command)));

                                    if (com != null)
                                    {
                                        commandTreeDescription node = com.parent as commandTreeDescription;
                                        if (node != null)
                                        {
                                            switch (node.nodeLevel)
                                            {
                                            case commandTreeNodeLevel.group:

                                                break;

                                            case commandTreeNodeLevel.plugin:

                                                break;

                                            default:
                                                break;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        isSyntaxError = true;
                                        errorMessage  = "Command not found at [" + prefix.toCsvInLine(COMMANDPREFIX_SEPARATOR) + "][" + console.consoleTitle + "]. Suggestions:";
                                        foreach (var c in coms)
                                        {
                                            errorMessage = errorMessage.addLine(c.path);
                                        }
                                    }
                                }
                            }
                            else
                            {
                            }
                        }
                    }
                }

                if (isSyntaxError || (executor == null))
                {
                    isSyntaxError = true;
                    errorMessage  = "Unknown property prefix [" + prefix.toCsvInLine(COMMANDPREFIX_SEPARATOR) + "] at [" + console.consoleTitle + "].";
                }
                else
                {
                    operation = executor.commands.getItem(command, -1, false, true);
                }

                if (operation == null)
                {
                    isSyntaxError = true;
                    errorMessage  = "Unknown command [" + command + "] for console [" + console.consoleTitle + "]. Type 'help' to show list of commands.";
                }
                else
                {
                    if (operation.metaObject is aceOperationArgs)
                    {
                        marg = operation.metaObject as aceOperationArgs;
                        carg = marg.Clone() as aceOperationArgs;
                        String error = "";
                        switch (format)
                        {
                        case commandLineFormat.explicitFormat:
                            error = carg.paramSet.setValues(parameterName, parameterValue);
                            break;

                        case commandLineFormat.implicitFormat:
                            error = carg.paramSet.setValues(parameterValue);
                            break;

                        case commandLineFormat.onlyCommand:
                            break;
                        }
                    }
                    else
                    {
                        isSyntaxError = true;
                        errorMessage  = "Command [" + command + "] for console [" + console.consoleTitle + "] not supported. Type 'help' to show list of commands.";
                    }
                }
            }
        }
 public aceConsolePluginForFiles(IAceOperationSetExecutor __parent, string __name, string __help = "") : base(__parent, __name, __help)
 {
     folder = new DirectoryInfo(Directory.GetCurrentDirectory());
 }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="plugIn_dataLoader"/> class.
 /// </summary>
 /// <param name="__parent">The parent.</param>
 /// <param name="__name">Property name at parent executor</param>
 public plugIn_dataLoader(IAceOperationSetExecutor __parent, string __name) : base(__parent, __name, HELP)
 {
 }
Example #18
0
 public becDataSetProviderExtension(folderNode __folder, IAceOperationSetExecutor __parent) : base(__folder, __parent)
 {
 }
 public becFeatureVectorExtension(folderNode folder, IAceOperationSetExecutor __parent) : base(folder, __parent)
 {
 }
Example #20
0
        /// <summary>
        /// Builds the type of the tree node for.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="source">The source.</param>
        /// <param name="host">The host.</param>
        /// <returns></returns>
        internal static commandTreeDescription BuildTreeNodeForType(Type type, IAceOperationSetExecutor source, commandTreeDescription parent, String nameOverride = "", commandTreeNodeLevel level = commandTreeNodeLevel.type)
        {
            settingsMemberInfoEntry typeInfo = new settingsMemberInfoEntry(type);

            commandTreeDescription output = parent.Add(nameOverride.or(typeInfo.name, typeInfo.displayName, type.Name));

            commandTree host = parent.root as commandTree;

            output.description = typeInfo.description;
            output.nodeLevel   = level;
            output.helpLines.Add(typeInfo.info_helpTitle);
            output.helpLines.Add(typeInfo.info_helpTips);
            output.helpLines.AddRange(typeInfo.additionalInfo);


            var methods = type.GetMethods(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.DeclaredOnly);

            aceDictionarySet <String, commandTreeDescription> groups = new aceDictionarySet <string, commandTreeDescription>();

            aceDictionarySet <String, commandTreeDescription> group_nodes = new aceDictionarySet <string, commandTreeDescription>();


            foreach (MemberInfo __m in methods)
            {
                if (__m.Name.StartsWith(aceMenuItemMeta.METHOD_PREFIX))
                {
                    commandTreeDescription desc = new commandTreeDescription();

                    desc.setByMemberInfo(__m);
                    desc.nodeLevel = commandTreeNodeLevel.group;
                    groups.Add(desc.category, desc);
                }
            }

            foreach (String group in groups.Keys.OrderBy(x => x))
            {
                var ordered = groups[group].OrderBy(x => x.name);

                commandTreeDescription gdesc = parent.Add(group);

                gdesc.nodeLevel = commandTreeNodeLevel.group;

                foreach (var cdesc in ordered)
                {
                    cdesc.nodeLevel = commandTreeNodeLevel.command;
                    gdesc.Add(cdesc, cdesc.name);

                    host.flatAccess.Add(cdesc.path, cdesc);
                }
            }

            var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);

            foreach (PropertyInfo pi in properties)
            {
                if (pi.DeclaringType.Name == "aceCommandConsole")
                {
                    continue;
                }
                if (pi.DeclaringType.Name == "aceAdvancedConsole")
                {
                    continue;
                }

                if (pi.PropertyType.GetInterfaces().Contains(typeof(IAceOperationSetExecutor)))
                {
                    var plugin_instance = source.imbGetPropertySafe(pi) as IAceOperationSetExecutor;
                    var plugin_node     = BuildTreeNodeForType(pi.PropertyType, source, parent, pi.Name, commandTreeNodeLevel.plugin);
                    plugin_node.setByMemberInfo(pi);

                    host.plugins.Add(plugin_node.path, plugin_instance);
                }
                else if (pi.PropertyType.IsValueType || pi.PropertyType.isTextOrNumber() || pi.GetCustomAttributes(false).Any())
                {
                    if (pi.CanWrite)
                    {
                        var prop = parent.Add(pi.Name);

                        prop.setByMemberInfo(pi);
                        prop.nodeLevel = commandTreeNodeLevel.parameter;
                        host.properties.Add(prop.path, pi);
                    }
                }
                else if (pi.PropertyType.IsClass || pi.GetCustomAttributes(false).Any())
                {
                    if (!pi.PropertyType.IsGenericType)
                    {
                        var prop = parent.Add(pi.Name);
                        prop.setByMemberInfo(pi);
                        prop.nodeLevel = commandTreeNodeLevel.module;
                        host.modules.Add(prop.path, pi);
                    }
                }
            }

            return(output);
        }