本文整理汇总了C#中ICatalog类的典型用法代码示例。如果您正苦于以下问题:C# ICatalog类的具体用法?C# ICatalog怎么用?C# ICatalog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICatalog类属于命名空间,在下文中一共展示了ICatalog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FormatLink
public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
{
string link;
if (type.Equals("vehicle"))
{
link = String.Format("Vehicle.aspx?c={0}&vid={1}&ssd={2}", catalog.Code, catalog.VehicleId, catalog.Ssd);
}
else
{
t_row row = dataItem as t_row;
if (row == null)
{
throw new ArgumentException(String.Format("Expected type 't_row'. Actual type is '{0}'.",
dataItem.GetType()));
}
link = String.Format("QuickDetails.aspx?c={0}&gid={1}&vid={2}&ssd={3}", catalog.Code,
row.quickgroupid, catalog.VehicleId, catalog.Ssd);
}
if (ItemId > 0)
{
link += string.Format("&ItemId={0}", ItemId);
}
return link;
}
开发者ID:dmziryanov,项目名称:ApecAuto,代码行数:27,代码来源:QuickGroupsExtender.cs
示例2: ExecuteCommand
public void ExecuteCommand(ICatalog catalog, ICommand command, StringBuilder consoleOutput)
{
switch (command.Type)
{
case CommandType.AddBook:
this.AddBook(catalog, command, consoleOutput);
break;
case CommandType.AddMovie:
this.AddMovie(catalog, command, consoleOutput);
break;
case CommandType.AddSong:
this.AddSong(catalog, command, consoleOutput);
break;
case CommandType.AddApplication:
this.AddAplication(catalog, command, consoleOutput);
break;
case CommandType.Update:
this.Update(catalog, command, consoleOutput);
break;
case CommandType.Find:
this.Find(catalog, command, consoleOutput);
break;
default:
{
throw new InvalidCastException("Unknown command!");
}
}
}
开发者ID:vaster,项目名称:Telerik.vasko,代码行数:34,代码来源:CommandExecutor.cs
示例3: FormatLink
public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
{
ListUnitsRow unit = dataItem as ListUnitsRow;
if (unit == null)
{
throw new ArgumentException(String.Format("Expected type 'ListUnitsRow'. Actual type is '{0}'.", renderer.GetType()));
}
string link;
if (type.Equals("filter"))
{
link = String.Format("UnitFilter.aspx?c={0}&vid={1}&uid={2}&cid={3}&ssd={4}&path_id={5}&f={6}",
catalog.Code, catalog.VehicleId, unit.unitid, catalog.CategoryId, unit.ssd,
catalog.PathId, HttpUtility.UrlEncode(unit.filter));
}
else
{
link = String.Format("Unit.aspx?c={0}&vid={1}&uid={2}&cid={3}&ssd={4}&path_id={5}",
catalog.Code, catalog.VehicleId, unit.unitid, catalog.CategoryId, unit.ssd,
catalog.PathId);
}
if (ItemId > 0)
{
link += string.Format("&ItemId={0}", ItemId);
}
return link;
}
开发者ID:dmziryanov,项目名称:ApecAuto,代码行数:30,代码来源:UnitExtender.cs
示例4: FileWatchScanner
//========================================================================================
// Constructor
//========================================================================================
/// <summary>
/// Initialize a new instance of this scaner with the specified iTunes interface.
/// </summary>
/// <param name="itunes"></param>
/// <param name="catalog"></param>
public FileWatchScanner(Controller controller, ICatalog catalog, FileWatchAction action)
: base(Resx.I_ScanFileWatch, controller, catalog)
{
base.description = Resx.ScanFileWatch;
this.action = action;
}
开发者ID:pengyancai,项目名称:cs-util,代码行数:15,代码来源:FileWatchScanner.cs
示例5: ExecuteCommand
public void ExecuteCommand(ICatalog catalog, ICommand cmd, StringBuilder sb)
{
switch (cmd.Type)
{
case CommandType.AddBook:
catalog.Add(new ContentItem(ContentItemType.Book, cmd.Parameters));
sb.AppendLine("Book added");
break;
case CommandType.AddMovie:
catalog.Add(new ContentItem(ContentItemType.Movie, cmd.Parameters));
sb.AppendLine("Movie added");
break;
case CommandType.AddSong:
catalog.Add(new ContentItem(ContentItemType.Song, cmd.Parameters));
sb.AppendLine("Song added");
break;
case CommandType.AddApplication:
catalog.Add(new ContentItem(ContentItemType.Application, cmd.Parameters));
sb.AppendLine("Application added");
break;
case CommandType.Update:
if (cmd.Parameters.Length != 2)
{
throw new FormatException("Format exception");
}
var updatedItems = catalog.UpdateContent(cmd.Parameters[0], cmd.Parameters[1]);
sb.AppendLine(String.Format("{0} items updated", updatedItems));
break;
case CommandType.Find:
{
if (cmd.Parameters.Length != 2)
{
Console.WriteLine("Invalid params!");
throw new Exception("Invalid number of parameters!");
}
int numberOfElementsToList = int.Parse(cmd.Parameters[1]);
IEnumerable<IContent> foundContent = catalog.GetListContent(cmd.Parameters[0], numberOfElementsToList);
if (foundContent.Count() == 0)
{
sb.AppendLine("No items found");
}
else
{
foreach (IContent content in foundContent)
{
sb.AppendLine(content.TextRepresentation);
}
}
}
break;
default:
{
throw new InvalidCastException("Unknown command!");
}
}
}
开发者ID:BobbyBorisov,项目名称:TelerikAcademy,代码行数:60,代码来源:CommandExecutor.cs
示例6: ExecuteCommand
public void ExecuteCommand(ICatalog catalog, ICommand command, StringBuilder output)
{
switch (command.Type)
{
case CommandTypes.AddBook:
AddBookCommand(catalog, command, output);
break;
case CommandTypes.AddMovie:
AddMovieCommand(catalog, command, output);
break;
case CommandTypes.AddSong:
AddSongCommand(catalog, command, output);
break;
case CommandTypes.AddApplication:
AddApplicationCommand(catalog, command, output);
break;
case CommandTypes.Update:
IsValidParameters(command);
UpdateCommand(catalog, command, output);
break;
case CommandTypes.Find:
IsValidParameters(command);
FindCommand(catalog, command, output);
break;
default:
throw new ArgumentException("Unknown command: " + command.Type.ToString());
}
}
开发者ID:nim-ohtar,项目名称:TelerikAkademy,代码行数:28,代码来源:CommandExecutor.cs
示例7: ExecuteCommand
public void ExecuteCommand(ICatalog catalog, ICommand command, StringBuilder output)
{
switch (command.Type)
{
case CommandType.AddBook:
var book = new ContentItem(ContentItemType.Book, command.Parameters);
catalog.Add(book);
output.AppendLine("Book Added");
break;
case CommandType.AddMovie:
var movie = new ContentItem(ContentItemType.Movie, command.Parameters);
catalog.Add(movie);
output.AppendLine("Movie added");
break;
case CommandType.AddSong:
var song = new ContentItem(ContentItemType.Song, command.Parameters);
catalog.Add(song);
output.AppendLine("Song added");
break;
case CommandType.AddApplication:
var application = new ContentItem(ContentItemType.Application, command.Parameters);
catalog.Add(application);
output.AppendLine("Application added");
break;
case CommandType.Update:
ProcessUpdateCommand(catalog, command, output);
break;
case CommandType.Find:
ProcessFindCommand(catalog, command, output);
break;
default:
throw new InvalidOperationException("Unknown command!");
}
}
开发者ID:sabrie,项目名称:TelerikAcademy,代码行数:34,代码来源:CommandExecutor.cs
示例8: ExecuteCommand
public void ExecuteCommand(ICatalog catalog, ICommand command, StringBuilder sb)
{
switch (command.Type)
{
case Commands.AddBook:
catalog.Add(new CatalogContent(ContentTypes.Book, command.Parameters));
sb.AppendLine("Book added");
break;
case Commands.AddMovie:
catalog.Add(new CatalogContent(ContentTypes.Movie, command.Parameters));
sb.AppendLine("Movie added");
break;
case Commands.AddSong:
catalog.Add(new CatalogContent(ContentTypes.Song, command.Parameters));
sb.AppendLine("Song added");
break;
case Commands.AddApplication:
catalog.Add(new CatalogContent(ContentTypes.Application, command.Parameters));
sb.AppendLine("Application added");
break;
case Commands.Update:
UpdateCommand(catalog, command, sb);
break;
case Commands.Find:
FindCommand(command, catalog, sb);
break;
default:
throw new InvalidOperationException("Unknown command!");
}
}
开发者ID:niki-funky,项目名称:Telerik_Academy,代码行数:30,代码来源:CommandExecutor.cs
示例9: ProcessFindCommand
private static void ProcessFindCommand(ICatalog contentCatalog,
ICommand command, StringBuilder output)
{
if (command.Parameters.Length != 2)
{
throw new ArgumentException("Invalid number of parameters!");
}
int numberOfElementsToList = Int32.Parse(command.Parameters[1]);
IEnumerable<IContent> foundContent =
contentCatalog.GetListContent(command.Parameters[0], numberOfElementsToList);
if (foundContent.Count() == 0)
{
output.AppendLine("No items found");
}
else
{
foreach (IContent content in foundContent)
{
output.AppendLine(content.TextRepresentation);
}
}
}
开发者ID:aleks-todorov,项目名称:HomeWorks,代码行数:25,代码来源:CommandExecutor.cs
示例10: EmptyScanner
/// <summary>
/// Initialize a new instance of this scanner.
/// </summary>
/// <param name="itunes"></param>
public EmptyScanner(Controller controller, ICatalog catalog)
: base(Resx.I_ScanEmptyDirectories, controller, catalog)
{
base.description = Resx.ScanEmpty;
this.count = 0;
}
开发者ID:pengyancai,项目名称:cs-util,代码行数:11,代码来源:EmptyScanner.cs
示例11: ExecuteCommand
public void ExecuteCommand(ICatalog contentCatalog, ICommand command, StringBuilder output)
{
switch (command.Type)
{
case CommandType.AddBook:
this.Add(ContentType.Book, command, contentCatalog, output);
break;
case CommandType.AddMovie:
this.Add(ContentType.Movie, command, contentCatalog, output);
break;
case CommandType.AddSong:
this.Add(ContentType.Song, command, contentCatalog, output);
break;
case CommandType.AddApplication:
this.Add(ContentType.Application, command, contentCatalog, output);
break;
case CommandType.Update:
this.Update(command, contentCatalog, output);
break;
case CommandType.Find:
this.Find(command, contentCatalog, output);
break;
default:
throw new ArgumentException("Unknown command!");
}
}
开发者ID:quela,项目名称:myprojects,代码行数:26,代码来源:CommandExecutor.cs
示例12: ExecuteCommand
public void ExecuteCommand(ICatalog catalog, ICommand command, StringBuilder output)
{
switch (command.Type)
{
case CommandType.AddBook:
ProcessAddCommand(catalog, ContentType.Book, command.Parameters, output);
break;
case CommandType.AddMovie:
ProcessAddCommand(catalog, ContentType.Movie, command.Parameters, output);
break;
case CommandType.AddSong:
ProcessAddCommand(catalog, ContentType.Song, command.Parameters, output);
break;
case CommandType.AddApplication:
ProcessAddCommand(catalog, ContentType.Application, command.Parameters, output);
break;
case CommandType.Update:
ProcessUpdateCommand(catalog, command, output);
break;
case CommandType.Find:
ProcessFindCommand(catalog, command, output);
break;
default:
throw new InvalidOperationException("Unknown command!");
}
}
开发者ID:smihaylovit,项目名称:TelerikAcademy,代码行数:32,代码来源:CommandExecutor.cs
示例13: FormatLink
public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
{
string link;
if (type.Equals("quickgroup"))
{
link = String.Format("QuickGroups.aspx?c={0}&vid={1}&ssd={2}", catalog.Code, catalog.VehicleId, catalog.Ssd);
}
else
{
ListCategoriesRow category = dataItem as ListCategoriesRow;
if (category == null)
{
throw new ArgumentException(String.Format("Expected type 'ListCategoriesRow'. Actual type is '{0}'.", renderer.GetType()));
}
link = String.Format("Vehicle.aspx?c={0}&vid={1}&cid={2}&ssd={3}", catalog.Code, catalog.VehicleId,
category.categoryid,
catalog.Ssd);
}
if (ItemId > 0)
{
link += string.Format("&ItemId={0}", ItemId);
}
return link;
}
开发者ID:dmziryanov,项目名称:ApecAuto,代码行数:26,代码来源:CategoryExtender.cs
示例14: MaintenanceScanner
//========================================================================================
// Constructor
//========================================================================================
/// <summary>
/// Initialize a new instance of this scaner with the specified iTunes interface.
/// </summary>
/// <param name="itunes"></param>
/// <param name="catalog"></param>
public MaintenanceScanner(
Controller controller, ICatalog catalog, MaintenanceAction action)
: base(Resx.I_ScanMaintenance, controller, catalog)
{
base.description = Resx.ScanMaintenance;
this.action = action;
}
开发者ID:pengyancai,项目名称:cs-util,代码行数:16,代码来源:MaintenanceScanner.cs
示例15: ScannerBase
/// <summary>
///
/// </summary>
/// <param name="controller"></param>
/// <param name="catalog"></param>
public ScannerBase(string name, Controller controller, ICatalog catalog)
{
this.name = name;
this.controller = controller;
this.catalog = catalog;
this.progressPercentage = 0;
this.completedAction = null;
}
开发者ID:pengyancai,项目名称:cs-util,代码行数:13,代码来源:ScannerBase.cs
示例16: ExecuteCommand
public void ExecuteCommand(ICatalog catalog, ICommand commmand, StringBuilder output)
{
switch (commmand.Type)
{
case CommandType.AddBook:
{
catalog.Add(new Content(ContentType.Book, commmand.Parameters));
output.AppendLine("Book added");
break;
}
case CommandType.AddMovie:
{
catalog.Add(new Content(ContentType.Movie, commmand.Parameters));
output.AppendLine("Movie added");
break;
}
case CommandType.AddSong:
{
catalog.Add(new Content(ContentType.Song, commmand.Parameters));
output.AppendLine("Song added");
break;
}
case CommandType.AddApplication:
{
catalog.Add(new Content(ContentType.Application, commmand.Parameters));
output.AppendLine("Application added");
break;
}
case CommandType.Update:
{
if (commmand.Parameters.Length != 2)
{
throw new FormatException("Invalid parameteres count.");
}
int itemsUpdated = catalog.UpdateContent(commmand.Parameters[0], commmand.Parameters[1]);
string updatedInfo = String.Format("{0} items updated", itemsUpdated);
output.AppendLine(updatedInfo);
break;
}
case CommandType.Find:
{
if (commmand.Parameters.Length != 2)
{
throw new Exception("Invalid number of parameters!");
}
int numberOfElementsToList = int.Parse(commmand.Parameters[1]);
FindContent(catalog, commmand, output, numberOfElementsToList);
break;
}
default:
{
throw new ArgumentException("Unknown command type.");
}
}
}
开发者ID:Rokata,项目名称:TelerikAcademy,代码行数:58,代码来源:CommandExecutor.cs
示例17: PhantomScanner
//========================================================================================
// Constructor
//========================================================================================
/// <summary>
/// Initialize a new instance of this scanner with the specified iTunes interface.
/// </summary>
/// <param name="itunes"></param>
/// <param name="catalog"></param>
public PhantomScanner(Controller controller, ICatalog catalog)
: base(Resx.I_ScanPhantoms, controller, catalog)
{
base.description = Resx.ScanPhantoms;
this.albumFilter = null;
this.artistFilter = null;
this.playlistFilter = PersistentID.Empty;
}
开发者ID:pengyancai,项目名称:cs-util,代码行数:17,代码来源:PhantomScanner.cs
示例18: Update
private void Update(ICatalog catalog, ICommand command, StringBuilder consoleOutput)
{
if (command.Parameters.Length != 2)
{
throw new FormatException("Invalid number of parameters!Mandatory parameters are: Old url and new url. Probably some are missing.");
}
consoleOutput.AppendLine(String.Format("{0} items updated", catalog.UpdateContent(command.Parameters[0], command.Parameters[1])));
}
开发者ID:vaster,项目名称:Telerik.vasko,代码行数:9,代码来源:CommandExecutor.cs
示例19: DbTableConfiguration
/// <summary>
/// Initializes a new instance of the DbTableConfiguration class.
/// </summary>
/// <param name="tableName">Table name.</param>
/// <param name="catalog">Catalog to which the table/view belongs to.</param>
/// <param name="columnConfiguration">Column configuration</param>
/// <param name="primaryKeyColumnIndexes">Primary key column indexes in <b>columnConfiguration</b> array.</param>
/// <param name="parentEntityProperties">Names of parent entity properties in generated <see cref="IEntity"/> class.</param>
/// <param name="extendedProperties">Customized information associated with the table.</param>
public DbTableConfiguration(string tableName, ICatalog catalog, DbColumnConfiguration[] columnConfiguration, int[] primaryKeyColumnIndexes, string[] parentEntityProperties, IPropertyCollection extendedProperties)
{
this.TableName = tableName;
this.Catalog = catalog;
this.ColumnConfiguration = columnConfiguration;
this.PrimaryKeyColumnIndexes = primaryKeyColumnIndexes;
this.ParentEntityProperties = parentEntityProperties;
this.EmptyDataTable = CreateDataTable();
this.ExtendedProperties = extendedProperties;
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:19,代码来源:DbTableConfiguration.cs
示例20: ProcessUpdateCommand
private static void ProcessUpdateCommand(ICatalog catalog, ICommand cmd, StringBuilder output)
{
if (cmd.Parameters.Length != 2)
{
throw new ArgumentException("Invalid number of parameters!");
}
output.AppendLine(String.Format("{0} items updated",
catalog.UpdateContent(cmd.Parameters[0], cmd.Parameters[1])));
}
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:10,代码来源:CommandExecutor.cs
注:本文中的ICatalog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论