本文整理汇总了C#中Monodoc.HelpSource.Save方法的典型用法代码示例。如果您正苦于以下问题:C# HelpSource.Save方法的具体用法?C# HelpSource.Save怎么用?C# HelpSource.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Monodoc.HelpSource
的用法示例。
在下文中一共展示了HelpSource.Save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
} else {
Usage ();
return 1;
}
break;
case "--xhtml":
case "--hb":
if (i < argc){
Provider populator = new XhtmlProvider (args [++i]);
list.Add (populator);
} else {
Usage ();
return 1;
}
break;
case "--man":
if (i < argc){
int countfiles = args.Length - ++i;
string[] xmlfiles = new String[countfiles];
for (int a = 0;a< countfiles;a++) {
xmlfiles[a] = args [i];
i++;
}
Provider populator = new ManProvider (xmlfiles);
list.Add (populator);
} else {
Usage ();
return 1;
}
break;
case "--simple":
if (i < argc){
Provider populator = new SimpleProvider (args [++i]);
list.Add (populator);
} else {
Usage ();
return 1;
}
break;
case "--error":
if (i < argc){
Provider populator = new ErrorProvider (args [++i]);
list.Add (populator);
} else {
Usage ();
return 1;
}
break;
case "--ecmaspec":
if (i < argc){
Provider populator = new EcmaSpecProvider (args [++i]);
list.Add (populator);
} else {
Usage ();
return 1;
}
break;
case "--addins":
if (i < argc){
Provider populator = new AddinsProvider (args [++i]);
list.Add (populator);
} else {
Usage ();
return 1;
}
break;
default:
Usage ();
return 1;
}
}
hs = new HelpSource (output, true);
foreach (Provider p in list){
p.PopulateTree (hs.Tree);
}
if (sort)
hs.Tree.Sort ();
//
// Flushes the EcmaProvider
//
foreach (Provider p in list)
p.CloseTree (hs, hs.Tree);
hs.Save ();
return 0;
}
示例2: Run
public override void Run (IEnumerable<string> args)
{
bool replaceNTypes = false;
var formats = new Dictionary<string, List<string>> ();
string prefix = "tree";
var formatOptions = CreateFormatOptions (this, formats);
var options = new OptionSet () {
formatOptions [0],
{ "o|out=",
"Provides the output file prefix; the files {PREFIX}.zip and " +
"{PREFIX}.tree will be created.\n" +
"If not specified, `tree' is the default PREFIX.",
v => prefix = v },
formatOptions [1],
{"dropns=","The namespace that has been dropped from this version of the assembly.", v => droppedNamespace = v },
{"ntypes","Replace references to native types with their original types.", v => replaceNTypes=true },
};
List<string> extra = Parse (options, args, "assemble",
"[OPTIONS]+ DIRECTORIES",
"Assemble documentation within DIRECTORIES for use within the monodoc browser.");
if (extra == null)
return;
List<Provider> list = new List<Provider> ();
EcmaProvider ecma = null;
bool sort = false;
foreach (string format in formats.Keys) {
switch (format) {
case "ecma":
if (ecma == null) {
ecma = new EcmaProvider ();
list.Add (ecma);
sort = true;
}
ecma.FileSource = new MDocFileSource(droppedNamespace, string.IsNullOrWhiteSpace(droppedNamespace) ? ApiStyle.Unified : ApiStyle.Classic) {
ReplaceNativeTypes = replaceNTypes
};
foreach (string dir in formats [format])
ecma.AddDirectory (dir);
break;
case "xhtml":
case "hb":
list.AddRange (formats [format].Select (d => (Provider) new XhtmlProvider (d)));
break;
case "man":
list.Add (new ManProvider (formats [format].ToArray ()));
break;
case "error":
list.AddRange (formats [format].Select (d => (Provider) new ErrorProvider (d)));
break;
case "ecmaspec":
list.AddRange (formats [format].Select (d => (Provider) new EcmaSpecProvider (d)));
break;
case "addins":
list.AddRange (formats [format].Select (d => (Provider) new AddinsProvider (d)));
break;
}
}
HelpSource hs = new HelpSource (prefix, true);
hs.TraceLevel = TraceLevel;
foreach (Provider p in list) {
p.PopulateTree (hs.Tree);
}
if (sort && hs.Tree != null)
hs.Tree.RootNode.Sort ();
//
// Flushes the EcmaProvider
//
foreach (Provider p in list)
p.CloseTree (hs, hs.Tree);
hs.Save ();
}
示例3: Run
public override void Run (IEnumerable<string> args)
{
var formats = new Dictionary<string, List<string>> ();
string prefix = "tree";
var formatOptions = CreateFormatOptions (this, formats);
var options = new OptionSet () {
formatOptions [0],
{ "o|out=",
"Provides the output file prefix; the files {PREFIX}.zip and " +
"{PREFIX}.tree will be created.\n" +
"If not specified, `tree' is the default PREFIX.",
v => prefix = v },
formatOptions [1],
};
List<string> extra = Parse (options, args, "assemble",
"[OPTIONS]+ DIRECTORIES",
"Assemble documentation within DIRECTORIES for use within the monodoc browser.");
if (extra == null)
return;
List<Provider> list = new List<Provider> ();
EcmaProvider ecma = null;
bool sort = false;
foreach (string format in formats.Keys) {
switch (format) {
case "ecma":
if (ecma == null) {
ecma = new EcmaProvider ();
list.Add (ecma);
sort = true;
}
foreach (string dir in formats [format])
ecma.AddDirectory (dir);
break;
case "xhtml":
case "hb":
list.AddRange (formats [format].Select (d => (Provider) new XhtmlProvider (d)));
break;
case "man":
list.Add (new ManProvider (formats [format].ToArray ()));
break;
case "simple":
list.AddRange (formats [format].Select (d => (Provider) new SimpleProvider (d)));
break;
case "error":
list.AddRange (formats [format].Select (d => (Provider) new ErrorProvider (d)));
break;
case "ecmaspec":
list.AddRange (formats [format].Select (d => (Provider) new EcmaSpecProvider (d)));
break;
case "addins":
list.AddRange (formats [format].Select (d => (Provider) new AddinsProvider (d)));
break;
}
}
HelpSource hs = new HelpSource (prefix, true);
hs.TraceLevel = TraceLevel;
foreach (Provider p in list) {
p.PopulateTree (hs.Tree);
}
if (sort && hs.Tree != null)
hs.Tree.Sort ();
//
// Flushes the EcmaProvider
//
foreach (Provider p in list)
p.CloseTree (hs, hs.Tree);
hs.Save ();
}