public Result(MCN network)
 {
     Network     = network;
     Platform    = string.Empty;
     ErrorString = string.Empty;
     Success     = true;
 }
 public MorphemeAssetProcessorTask(MCN network, string exportRootPath, string exportSubPath, string assetCompilerExe, string commandLineOptions, ManualResetEvent doneEvent)
 {
     Network            = network;
     ExportRootPath     = exportRootPath;
     ProcessSubPath     = exportSubPath;
     AssetCompilerExe   = assetCompilerExe;
     CommandLineOptions = commandLineOptions;
     DoneEvent          = doneEvent;
 }
Example #3
0
        public string ExpandMacroUsingNetwork(string str, MCN network)
        {
            // replace strings with their macros, using the network context if required.

            if (string.IsNullOrEmpty(str))
            {
                return(string.Empty);
            }

            str = ExpandMacro(str);

            foreach (ReservedNetworkMacroKeys macro in Enum.GetValues(typeof(ReservedNetworkMacroKeys)))
            {
                string macroString = Prefix + Enum.GetName(typeof(ReservedNetworkMacroKeys), macro) + Suffix;

                var regex = new Regex(Regex.Escape(macroString), RegexOptions.IgnoreCase);

                if (regex.IsMatch(str))
                {
                    switch (macro)
                    {
                    case ReservedNetworkMacroKeys.MCP_PATH:
                    {
                        FileInfo fileInfo = new FileInfo(network.GetMCPPathAbsoluteExpanded());
                        str = regex.Replace(str, fileInfo.DirectoryName);
                        break;
                    }

                    case ReservedNetworkMacroKeys.MCN_NAME:
                    {
                        FileInfo fileInfo = new FileInfo(network.GetMCNPathAbsoluteExpanded());
                        str = regex.Replace(str, Path.GetFileNameWithoutExtension(fileInfo.Name));
                        break;
                    }

                    case ReservedNetworkMacroKeys.MCN_PATH:
                    {
                        FileInfo fileInfo = new FileInfo(network.GetMCNPathAbsoluteExpanded());
                        str = fileInfo.Directory.FullName;
                        break;
                    }

                    case ReservedNetworkMacroKeys.MCN_DIR:
                    {
                        FileInfo fileInfo = new FileInfo(network.GetMCNPathAbsoluteExpanded());
                        str = regex.Replace(str, fileInfo.Directory.Name);
                        break;
                    }
                    }
                }
            }

            return(str);
        }
        public static void GetFilePathsFromNetwork(MCN network, string exportRootPath, out string mcpFile, out string mcnFile, out string intermediateFile)
        {
            // build the xml file
            FileInfo mcnfileInfo        = new FileInfo(network.GetMCNPathAbsoluteExpanded());
            string   exportFileName     = mcnfileInfo.Name.Replace(MCN.MCNExtension, MCN.MCNIntermediateExtension);
            string   exportFileFullName = Path.Combine(exportRootPath, exportFileName);

            // format the paths to work with connect
            mcnFile          = network.GetMCNPathAbsoluteExpanded().Replace("\\", "/");
            mcpFile          = network.GetMCPPathAbsoluteExpanded().Replace("\\", "/");
            intermediateFile = exportFileFullName.Replace("\\", "/");
        }
 public Result(MCN mcn)
 {
     Network     = mcn;
     ErrorString = string.Empty;
     Success     = true;
 }
 public MorphemeConnectData(MCN network, string exportPath, ManualResetEvent doneEvent)
 {
     Network    = network;
     ExportPath = exportPath;
     DoneEvent  = doneEvent;
 }
 public MorphemeConnectExportTask(MCN network, string exepath, ManualResetEvent doneEvent)
 {
     morphemeConnectData = new MorphemeConnectData(network, exepath, doneEvent);
 }
 public void AddTask(MCN network, string exportPath)
 {
     morphemeConnectDataList.Add(new MorphemeConnectData(network, exportPath, null));
 }