本文整理汇总了C#中Catalog类的典型用法代码示例。如果您正苦于以下问题:C# Catalog类的具体用法?C# Catalog怎么用?C# Catalog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Catalog类属于命名空间,在下文中一共展示了Catalog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ArtistsDataSource
public ArtistsDataSource (Catalog catalog)
{
Lookup = new List<Tuple<string, Artist[]>> ();
if (catalog != null)
foreach (var group in catalog.Artists.GroupBy (t => (t.SortKey.First ().ToString ().ToUpper ())))
Lookup.Add (Tuple.Create (group.Key, group.OrderBy (t => (t.SortKey)).ToArray ()));
}
开发者ID:alanmcgovern,项目名称:tunez,代码行数:7,代码来源:ArtistsView.cs
示例2: Add_AddTwoIndenticalBooksAndThreeOtherItems
public void Add_AddTwoIndenticalBooksAndThreeOtherItems()
{
string[] testBookContentParams = new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" };
IContent testBookContent = new Content(ContentType.Book, testBookContentParams);
ICatalog currentCatalog = new Catalog();
currentCatalog.Add(testBookContent);
currentCatalog.Add(testBookContent);
string[] testMovieContentParams = new string[] { "The Secret", "Drew Heriot, Sean Byrne & others (2006)", "832763834", "http://t.co/dNV4d" };
IContent testMovieContent = new Content(ContentType.Book, testMovieContentParams);
currentCatalog.Add(testMovieContent);
string[] testApplicationContentParams = new string[] { "Firefox v.11.0", "Mozilla", "16148072", "http://www.mozilla.org" };
IContent testApplicationContent = new Content(ContentType.Book, testApplicationContentParams);
currentCatalog.Add(testApplicationContent);
string[] testSongContentParams = new string[] { "One", "Metallica", "8771120", "http://goo.gl/dIkth7gs" };
IContent testSongContent = new Content(ContentType.Book, testSongContentParams);
currentCatalog.Add(testSongContent);
IEnumerable<IContent> currentContent = currentCatalog.GetListContent("One", 10);
int numberOfRenurnedResults = currentContent.Count();
Assert.AreEqual(1, numberOfRenurnedResults);
}
开发者ID:quela,项目名称:myprojects,代码行数:25,代码来源:ICatalogTests.cs
示例3: MainForm
public MainForm()
{
InitializeComponent();
catalog = (Catalog)(new XmlSerializer(typeof(Catalog)).Deserialize(new FileStream("Catalog.xml", FileMode.Open)));
searcher = new CatalogSearcher(catalog);
images = new ImageList();
}
开发者ID:itsbth,项目名称:DoIt,代码行数:7,代码来源:MainForm.cs
示例4: ExportDialog
public ExportDialog(Catalog catalog, bool searchOn)
: base(Mono.Posix.Catalog.GetString ("Export"), null, DialogFlags.NoSeparator | DialogFlags.Modal)
{
this.catalog = catalog;
this.templates = new Hashtable ();
this.searchOn = searchOn;
Glade.XML gxml = new Glade.XML (null, "dialogexport.glade", "hbox1", null);
gxml.Autoconnect(this);
cancelButton = (Button)this.AddButton (Gtk.Stock.Cancel, 0);
okButton = (Button)this.AddButton (Gtk.Stock.Ok, 1);
cancelButton.Clicked += OnCancelButtonClicked;
okButton.Clicked += OnOkButtonClicked;
VBox vBox = this.VBox;
vBox.Add ((Box)gxml["hbox1"]);
PopulateComboBox ();
if (!searchOn) {
radioButtonSearch.Sensitive = false;
}
radioButtonActive.Label = String.Format (Mono.Posix.Catalog.GetString ("Export the whole {0} catalog"),catalog.ShortDescription);
this.ShowAll();
}
开发者ID:MonoBrasil,项目名称:historico,代码行数:28,代码来源:ExportDialog.cs
示例5: Can_search_with_filters
public void Can_search_with_filters()
{
Property property = new Property { Id = Guid.NewGuid(), Name = "Property Name", BedroomCount = 3 };
Catalog catalog = new Catalog() { Id = Guid.NewGuid(), Type = "Waterfront", PropertyId = property.Id };
using(var store = NewDocumentStore())
using(var _session = store.OpenSession())
{
_session.Store(property);
_session.Store(catalog);
_session.SaveChanges();
var catalogs = _session.Advanced.DocumentQuery<Catalog>().WhereEquals("Type", "Waterfront").Select(c => c.PropertyId);
var properties = _session.Advanced.DocumentQuery<Property>();
properties.OpenSubclause();
var first = true;
foreach (var guid in catalogs)
{
if (first == false)
properties.OrElse();
properties.WhereEquals("__document_id", guid);
first = false;
}
properties.CloseSubclause();
var refinedProperties = properties.AndAlso().WhereGreaterThanOrEqual("BedroomCount", "2").Select(p => p.Id);
Assert.NotEqual(0, refinedProperties.Count());
}
}
开发者ID:j2jensen,项目名称:ravendb,代码行数:30,代码来源:Samina.cs
示例6: PriceForSelections
private void PriceForSelections(Catalog.Product p, OptionSelectionList selections)
{
this.IsValid = true;
this.VariantId = string.Empty;
this._ModifierAdjustments = 0;
if (selections == null) return;
if (p == null) return;
// Check for Option Price Modifiers
if (!p.HasOptions()) return;
this._ModifierAdjustments = selections.GetPriceAdjustmentForSelections(p.Options);
this.BasePrice += this._ModifierAdjustments;
// Check for Variant Changes
if (!p.HasVariants()) return;
Variant v = p.Variants.FindBySelectionData(selections, p.Options);
if (v == null)
{
this.IsValid = false;
return;
}
// Assign Variant Attributes to this price data
this.VariantId = v.Bvin;
if (v.Sku.Trim().Length > 0) this.Sku = v.Sku;
if (v.Price >= 0) this.BasePrice = v.Price + this._ModifierAdjustments;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:29,代码来源:UserSpecificPrice.cs
示例7: Run
public void Run()
{
Catalog catalog = new Catalog();
foreach(string fileName in Options.InputFiles)
{
Catalog temp = new Catalog();
temp.Load(fileName);
catalog.Append(temp);
}
using (ResourceWriter writer = new ResourceWriter(Options.OutFile))
{
foreach (CatalogEntry entry in catalog)
{
try
{
writer.AddResource(entry.Key, entry.IsTranslated ? entry.GetTranslation(0) : entry.String);
}
catch (Exception e)
{
string message = String.Format("Error adding item {0}", entry.String);
if (!String.IsNullOrEmpty(entry.Context))
message = String.Format("Error adding item {0} in context '{1}'",
entry.String, entry.Context);
throw new Exception(message, e);
}
}
writer.Generate();
}
}
开发者ID:rzaitov,项目名称:GetTextNet,代码行数:30,代码来源:ResourcesGen.cs
示例8: AddAlbumDialog
public AddAlbumDialog(Catalog catalog)
: base(catalog,
"dialogaddalbum.glade",
Mono.Posix.Catalog.GetString ("Add a new Album"),
"albums")
{
}
开发者ID:MonoBrasil,项目名称:historico,代码行数:7,代码来源:AddAlbumDialog.cs
示例9: Button_Click
private void Button_Click(object sender, RoutedEventArgs e)
{
//创建数据库文件
ADOX.Catalog catalog = new Catalog();
catalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\test.mdb;Jet OLEDB:Engine Type=5");
Debug.WriteLine("DataBase created");
//建表
ADODB.Connection cn = new ADODB.Connection();
cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\test.mdb", null, null, -1);
catalog.ActiveConnection = cn;
ADOX.Table table = new ADOX.Table();
table.Name = "FirstTable";
ADOX.Column column = new ADOX.Column();
column.ParentCatalog = catalog;
column.Name = "RecordId";
column.Type = DataTypeEnum.adInteger;
column.DefinedSize = 9;
column.Properties["AutoIncrement"].Value = true;
table.Columns.Append(column, DataTypeEnum.adInteger, 9);
table.Keys.Append("FirstTablePrimaryKey", KeyTypeEnum.adKeyPrimary, column, null, null);
table.Columns.Append("CustomerName", DataTypeEnum.adVarWChar, 50);
table.Columns.Append("Age", DataTypeEnum.adInteger, 9);
table.Columns.Append("Birthday", DataTypeEnum.adDate, 0);
catalog.Tables.Append(table);
cn.Close();
}
开发者ID:Iamnvincible,项目名称:csharppractice,代码行数:30,代码来源:MainWindow.xaml.cs
示例10: Map
public IEnumerable<PFD> Map(List<CropZone> cropZones, List<PFD> isoFields, Dictionary<int, string> keyToIsoId, Catalog setupCatalog)
{
if(cropZones == null)
return null;
int cropZoneIndex = isoFields.Count;
return cropZones.Select(x => Map(x, keyToIsoId, cropZoneIndex++, setupCatalog));
}
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:7,代码来源:CropZoneMapper.cs
示例11: OnCreate
protected override void OnCreate(Bundle savedInstanceState)
{
// When extending the BrightcovePlayer, we must assign the BrightcoveVideoView before
// entering the superclass. This allows for some stock video player lifecycle
// management.
SetContentView(Resource.layout.ima_activity_main);
brightcoveVideoView = FindViewById<BrightcoveVideoView>(Resource.id.brightcove_video_view);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.brightcove.player.mediacontroller.BrightcoveMediaController mediaController = new com.brightcove.player.mediacontroller.BrightcoveMediaController(brightcoveVideoView);
BrightcoveMediaController mediaController = new BrightcoveMediaController(brightcoveVideoView);
// Add "Ad Markers" where the Ads Manager says ads will appear.
mediaController.AddListener(GoogleIMAEventType.ADS_MANAGER_LOADED, new EventListenerAnonymousInnerClassHelper(this, mediaController));
brightcoveVideoView.MediaController = mediaController;
base.onCreate(savedInstanceState);
eventEmitter = brightcoveVideoView.EventEmitter;
// Use a procedural abstraction to setup the Google IMA SDK via the plugin.
setupGoogleIMA();
IDictionary<string, string> options = new Dictionary<string, string>();
IList<string> values = new List<string>(Arrays.asList(VideoFields.DEFAULT_FIELDS));
values.Remove(VideoFields.HLS_URL);
options["video_fields"] = StringUtil.join(values, ",");
BrightcoveSDK.Player.Media.Catalog catalog = new Catalog("ErQk9zUeDVLIp8Dc7aiHKq8hDMgkv5BFU7WGshTc-hpziB3BuYh28A..");
catalog.findVideoByReferenceID("shark", new VideoListenerAnonymousInnerClassHelper(this));
}
开发者ID:huguodong,项目名称:brightcove-sdk-0.1.4.6,代码行数:28,代码来源:MainActivity.cs
示例12: ParsingTest
public void ParsingTest()
{
Catalog cat = new Catalog();
cat.Load("./Data/Test01.po");
Assert.AreEqual(6, cat.Count, "Entries count");
Assert.AreEqual(3, cat.PluralFormsCount, "Plurals entries count");
int nonTranslatedCount = 0;
int ctx = 0;
foreach(CatalogEntry entry in cat)
{
if (!entry.IsTranslated)
nonTranslatedCount++;
if (entry.HasPlural)
{
Assert.AreEqual("{0} ошибка найдена", entry.GetTranslation(0));
Assert.AreEqual("{0} ошибки найдены", entry.GetTranslation(1));
Assert.AreEqual("{0} ошибок найдено", entry.GetTranslation(2));
}
if (entry.HasContext)
ctx++;
}
Assert.AreEqual(1, nonTranslatedCount, "Non translated strings count");
Assert.AreEqual(2, ctx, "Contextes count");
}
开发者ID:rzaitov,项目名称:GetTextNet,代码行数:27,代码来源:CatalogTest.cs
示例13: SendResponse
static async Task SendResponse (Catalog catalog, HttpListenerContext context, CancellationToken token)
{
try {
string request;
if (string.IsNullOrEmpty (context.Request.Url.Query))
request = await DeserializeRequest (context.Request).ConfigureAwait (false);
else {
request = System.Uri.UnescapeDataString (context.Request.Url.Query.Substring (1));
}
long? rangeStart =null;
long? rangeEnd = null;
if (!string.IsNullOrEmpty (context.Request.Headers ["Range"])) {
var part = context.Request.Headers ["Range"].Substring ("bytes=".Length);
rangeStart = long.Parse (part.Split ('-') [0]);
rangeEnd = long.Parse (part.Split ('-') [1]);
if (rangeEnd <= 0)
rangeEnd = null;
}
using (var responseStream = HandleRequest (request, catalog, rangeStart, rangeEnd)) {
context.Response.ContentLength64 = responseStream.Length - responseStream.Position;
context.Response.StatusCode = (int)HttpStatusCode.OK;
await responseStream.CopyToAsync (context.Response.OutputStream, 4096, token).ConfigureAwait (false);
}
} catch {
context.Response.Abort ();
throw;
}
}
开发者ID:alanmcgovern,项目名称:tunez,代码行数:31,代码来源:RequestHandler.cs
示例14: LoadCatalog
public void LoadCatalog()
{
using (FileStream fs = new FileStream("Catalog.xml", FileMode.Open))
{
_catalog = (Catalog)(new XmlSerializer(typeof(Catalog)).Deserialize(fs));
}
}
开发者ID:itsbth,项目名称:DoIt,代码行数:7,代码来源:DoItManager.cs
示例15: Add_DuplicateAndNonDuplicateItems
public void Add_DuplicateAndNonDuplicateItems()
{
ICatalog catalog = new Catalog();
for (int i = 0; i < 10; ++i)
{
catalog.Add(new Content(ContentType.Book, new string[]
{
"TestTitle", "TestAuthor", "432943", @"http://www.testingcatalog.com/"
}));
}
catalog.Add(new Content(ContentType.Application, new string[]
{
"TestTitle", "TestAppAuthor", "111", @"http://www.testingappcatalog.com/"
}));
catalog.Add(new Content(ContentType.Movie, new string[]
{
"TestTitle", "TestMoveAuthor", "22", @"http://www.testingmoviecatalog.com/"
}));
catalog.Add(new Content(ContentType.Music, new string[]
{
"TestTitle", "TestMusicAuthor", "3333", @"http://www.testingmusiccatalog.com/"
}));
IEnumerable<IContent> foundContent = catalog.GetListContent("TestTitle", 100);
int numberOfItemsFound = this.CountContentFound(foundContent);
Assert.AreEqual(13, numberOfItemsFound);
}
开发者ID:androidejl,项目名称:Telerik,代码行数:31,代码来源:ICatalogTests.cs
示例16: CreateCatalogController
public static CatalogController CreateCatalogController (Catalog catalog, PlayQueue<StreamingPlayer> playQueue)
{
var vc = (CatalogController) MainStoryboard.InstantiateViewController ("CatalogController");
vc.Catalog = catalog;
vc.PlayQueue = playQueue;
return vc;
}
开发者ID:alanmcgovern,项目名称:tunez,代码行数:7,代码来源:Storyboard.cs
示例17: GetListContent_CheckSorting
public void GetListContent_CheckSorting()
{
ICatalog catalog = new Catalog();
for (int i = 9; i >= 0; --i)
{
catalog.Add(new Content(ContentType.Book, new string[]
{
"TestTitle", "TestAuthor" + i, "432943" + i, "http://www.testingcatalog.com/"
}));
}
IEnumerable<IContent> foundContent = catalog.GetListContent("TestTitle", 100);
bool contentIsSorted = true;
int currentIndex = 0;
foreach (var item in foundContent)
{
if (!item.Author.EndsWith(currentIndex.ToString()))
{
contentIsSorted = false;
break;
}
currentIndex++;
}
Assert.IsTrue(contentIsSorted);
}
开发者ID:androidejl,项目名称:Telerik,代码行数:27,代码来源:ICatalogTests.cs
示例18: TestAddContent_WithSingleItem
public void TestAddContent_WithSingleItem()
{
Catalog catalog = new Catalog();
Content item = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
catalog.AddContent(item);
Assert.AreEqual(1, catalog.Count);
}
开发者ID:Cecosam,项目名称:Csharp-Projects,代码行数:7,代码来源:TestCatalog.cs
示例19: Catalog
public JsonResult Catalog(string MyChecked)
{
Catalog n = new Catalog();
catalogData nd = new catalogData();
var array = MyChecked.Split(',');
if (MyChecked != "" && MyChecked != null)
{
for (var i = 0; i < array.Length; i++)
{
var Original = nd.Get().ToList().Where(a => a.num.ToString() == array[i]).SingleOrDefault();
if (Original.filePath != "")
{
var DelPath = System.IO.Path.Combine(Server.MapPath("~/upload/catalog/"), Original.filePath);
System.IO.File.Delete(DelPath);
}
//if (Original.jsonimg != "no_img.jpg")
//{
// var jsonstr = JsonConvert.DeserializeObject<List<jsonSer>>(Original.jsonimg);
// var DelJsonPath = Server.MapPath("~/upload/photograhy/");
// foreach (var j in jsonstr)
// {
// var DelJsonPathing = System.IO.Path.Combine(DelJsonPath, j.content);
// System.IO.File.Delete(DelJsonPathing);
// }
//}
n.num = Convert.ToInt32(array[i]);
n.isdel = 1;
n.udate = DateTime.Now;
nd.Delete(n);
}
}
return Json("");
}
开发者ID:boy22200011,项目名称:noporvisproject,代码行数:33,代码来源:DelisCheckController.cs
示例20: btnExecute_Click
protected void btnExecute_Click(object sender, EventArgs e)
{
//Define a workbook to store null value initially
Workbook workbook = null;
string path = MapPath(".");
path = path.Substring(0, path.LastIndexOf("\\"));
Catalog catalog = new Catalog(path);
//Create a workbook based on the custom method of a class
workbook = catalog.CreateCatalog();
if (ddlFileVersion.SelectedItem.Value == "XLS")
{
////Save file and send to client browser using selected format
workbook.Save(HttpContext.Current.Response, "Catalog.xls", ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Excel97To2003));
}
else
{
workbook.Save(HttpContext.Current.Response, "Catalog.xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions(SaveFormat.Xlsx));
}
//end response to avoid unneeded html
HttpContext.Current.Response.End();
}
开发者ID:babar-raza,项目名称:Aspose_Cells_NET,代码行数:26,代码来源:catalog-form.aspx.cs
注:本文中的Catalog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论