本文整理汇总了C#中IImporter类的典型用法代码示例。如果您正苦于以下问题:C# IImporter类的具体用法?C# IImporter怎么用?C# IImporter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IImporter类属于命名空间,在下文中一共展示了IImporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public void Add(IImporter importer)
{
if (importer == null)
throw new ArgumentNullException("importer");
base.Add(importer);
}
示例2: Parser
public Parser(int optimization, IStylizer stylizer, IImporter importer, bool debug = false)
{
Stylizer = stylizer;
Importer = importer;
Debug = debug;
Tokenizer = new Tokenizer(optimization);
}
示例3: Url
public Url(Node value, IImporter importer)
{
Importer = importer;
ImportPaths = importer.GetCurrentPathsClone();
Value = value;
}
示例4: Put
public void Put(IImporter importer)
{
if (importer == null)
throw new ArgumentNullException("importer");
Remove(importer.OutputType);
Add(importer);
}
示例5: Initialize
public void Initialize(
IVhptUserControlFactory vhptUserControlFactory,
IEnumerable<VhptIdentification> vhpts,
IImporter importer)
{
this.InitializeJokeImport(importer);
this.InitializeVhpts(vhpts, vhptUserControlFactory);
}
示例6: ImportContent
public object ImportContent(Stream stream, string fileExt, IImporter importer = null)
{
if (importer == null)
{
importer = GetDefaultImporter(fileExt);
}
return importer.Import(stream);
}
示例7: Plugin
public Plugin(IXmlReader xmlReader, IImporter importer, IExporter exporter)
{
_xmlReader = xmlReader;
_importer = importer;
_exporter = exporter;
Name = "ISO Plugin";
Version = "0.1.1";
Owner = "AgGateway & Contributors";
}
示例8: GetImportAction
private ImportAction GetImportAction(IImporter importer)
{
if (!_importAction.HasValue)
{
_importAction = importer.Import(this);
}
return _importAction.Value;
}
示例9: Import
private Import(string path, IImporter importer, Value features)
{
if (path == null)
throw new ParserException("Imports do not allow expressions");
Importer = importer;
Path = path;
Features = features;
ImportAction = Importer.Import(this); // it is assumed to be css if it cannot be found as less
}
示例10: Url
public Url(Node value, IImporter importer)
{
if (value is TextNode)
{
var textValue = value as TextNode;
if (!Regex.IsMatch(textValue.Value, @"^(([a-zA-Z]+:)|(\/))") && importer.Paths.Any())
{
textValue.Value = importer.Paths.Concat(new[] { textValue.Value }).AggregatePaths(importer.CurrentDirectory);
}
}
Value = value;
}
示例11: Url
public Url(Node value, IImporter importer)
{
if (value is TextNode)
{
var textValue = value as TextNode;
if (!Regex.IsMatch(textValue.Value, @"^(([a-zA-Z]+:)|(\/))"))
{
textValue.Value = importer.AlterUrl(textValue.Value);
}
}
Value = value;
}
示例12: Import
private Import(string path, IImporter importer)
{
Importer = importer;
Path = path;
if (path.EndsWith(".css"))
{
Css = true;
} else
{
Css = !Importer.Import(this); // it is assumed to be css if it cannot be found as less
if (Css && path.EndsWith(".less"))
{
throw new ParsingException("Cannot find less file", Index);
}
}
}
示例13: Import
private Import(string path, IImporter importer, Value features)
{
Importer = importer;
Path = path;
Features = features;
if (path.EndsWith(".css"))
{
Css = true;
} else
{
Css = !Importer.Import(this); // it is assumed to be css if it cannot be found as less
if (Css && path.EndsWith(".less"))
{
throw new FileNotFoundException("You are importing a file ending in .less that cannot be found.", path);
}
}
}
示例14: select_SelectedIndexChanged
void select_SelectedIndexChanged(object sender, EventArgs e) {
ImporterItem item = (select.SelectedItem as ImporterItem);
if (item != null) {
if (importer != null) {
UnwireImporterEvents();
importer.Dispose();
}
IImporterUI<IBilingualDictionary> newUI = null;
if (item.Type.GetInterfaces().Contains(typeof(IDictionarySectionImporter))) {
var si = (IDictionarySectionImporter)item.Type.GetConstructor(new Type[] { }).Invoke(new object[] { });
var dsi = new DualSectionImporter();
newUI = new Controls.DictionarySectionUI(dsi, si);
importer = dsi;
} else if(item.Type.IsSubclassOf(typeof(IBilingualDictionary))) {
importer = (IImporter<IBilingualDictionary>)item.Type.GetConstructor(new Type[] { }).Invoke(new object[] { });
foreach (Type t in importer.GetType().Assembly.GetTypes()) {
var attr = Attribute.GetCustomAttribute(t, typeof(ImporterUIAttribute)) as ImporterUIAttribute;
if (attr != null) {
newUI = (IImporterUI<IBilingualDictionary>)Activator.CreateInstance(t, importer);
break;
}
}
}
WireImporterEvents();
if (newUI == null) {
CurrentUI = new Controls.ErrorUI("No UI for " + item.Name, "");
UnwireImporterEvents();
importer.Dispose();
importer = null;
return;
}
newUI.Finished += this.ImporterUIFinished;
CurrentUI = (Control)newUI;
}
}
示例15: Parser
public Parser(int optimization, IStylizer stylizer, IImporter importer)
: this(optimization, stylizer, importer, defaultDebug)
{
}