本文整理汇总了C#中Library类的典型用法代码示例。如果您正苦于以下问题:C# Library类的具体用法?C# Library怎么用?C# Library使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Library类属于命名空间,在下文中一共展示了Library类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoteVolume
public RemoteVolume(Library.Interface.IFileEntry file, string hash = null)
{
this.Name = file.Name;
this.Size = file.Size;
this.Hash = hash;
this.File = file;
}
示例2: OnAfter_AddClassProperties
/// <summary>
/// Called when [after_ add class properties].
/// </summary>
/// <param name="assemblyCode">The assembly code.</param>
/// <param name="process">The process.</param>
/// <param name="isInfoProperty">if set to <c>true</c> [is information property].</param>
/// <param name="resolveRefTypes">if set to <c>true</c> [resolve reference types].</param>
/// <param name="skipId">if set to <c>true</c> [skip identifier].</param>
public override void OnAfter_AddClassProperties(StringBuilder assemblyCode, Library.Process.Publisher.Definitions.IProcessDefinition process, bool isInfoProperty, bool resolveRefTypes, bool skipId = false)
{
base.OnAfter_AddClassProperties(assemblyCode, process, isInfoProperty, resolveRefTypes, skipId);
if (!isInfoProperty) return;
foreach (var crf in process.RootTable.FieldList.Where(f => f.ColumnType == ColumnTypes.Reference && !f.IsHidden && f.IncludeInList))
{
assemblyCode.AppendFormat(@"
private {1}Info _{0}Member;
public {1}Info {0}Member
{{
get
{{
if (_{0}Member == null && {0}Id > 0)
{{
var items = {1}List.Get{1}PageList(string.Empty, {0}Id, 1, null, null);
if (items.Count > 0)
{{
_{0}Member = items[0];
}}
}}
return _{0}Member;
}}
}}
"
, crf.ColumnName, crf.ReferencedProcessName);
}
}
示例3: LoadPlaylists
/// <summary>
/// Loads all the play-lists in the play-list folder
/// </summary>
public static void LoadPlaylists(Library libary)
{
//var playlistFiles = FileSystemHelper.SearchFiles(PlaylistFolder, "*.m3u", false);
//Playlists = playlistFiles.Select(playlistFile => LoadPlaylist(playlistFile, libary)).ToList();
Playlists = new List<Playlist>();
}
示例4: BulkThumbnailGenerator
public BulkThumbnailGenerator(Library library, SizedThumbnailGenerator thumbnailGenerator)
{
_library = library;
_thumbnailGenerator = thumbnailGenerator;
ThumbnailGenerated += (_, __) => { };
}
示例5: Charts
public Charts()
{
this.InitializeComponent();
library = new Library();
this.Loaded += MainPage_Loaded;
rtrackact = new RootObjectTrackAct();
}
示例6: Start
new void Start()
{
base.Start();
library = GameObject.FindObjectOfType<Library>();
button = GetComponent<Button>();
button.onClick.AddListener(delegate { UseButton(); });
}
示例7: Parse
public IList<String> Parse(string input, bool showOutput)
{
Context.Parser = this;
Context.Object = null;
Context.IndirectObject = null;
parserResults = new List<string>();
Library L = new Library();
bool wasLit = L.IsLit();
var userInput = new UserInput();
var inputResult = userInput.Parse(input);
isAll = inputResult.IsAll;
if (inputResult.HasError)
{
parserResults.Add(inputResult.Error);
}
else
{
HandleInputResult(inputResult);
}
if (!wasLit && L.IsLit())
L.Look(true);
return GetResults(showOutput);
}
示例8: ToInfoMessage
public static string ToInfoMessage(Library.Net.Amoeba.Seed seed)
{
if (seed == null) throw new ArgumentNullException("seed");
try
{
var keywords = seed.Keywords.Where(n => !string.IsNullOrWhiteSpace(n)).ToList();
StringBuilder builder = new StringBuilder();
if (!string.IsNullOrWhiteSpace(seed.Name)) builder.AppendLine(string.Format("{0}: {1}", LanguagesManager.Instance.Seed_Name, seed.Name));
if (seed.Certificate != null) builder.AppendLine(string.Format("{0}: {1}", LanguagesManager.Instance.Seed_Signature, seed.Certificate.ToString()));
builder.AppendLine(string.Format("{0}: {1:#,0}", LanguagesManager.Instance.Seed_Length, seed.Length));
if (keywords.Count != 0) builder.AppendLine(string.Format("{0}: {1}", LanguagesManager.Instance.Seed_Keywords, String.Join(", ", keywords)));
builder.AppendLine(string.Format("{0}: {1} UTC", LanguagesManager.Instance.Seed_CreationTime, seed.CreationTime.ToUniversalTime().ToString(LanguagesManager.Instance.DateTime_StringFormat, System.Globalization.DateTimeFormatInfo.InvariantInfo)));
if (!string.IsNullOrWhiteSpace(seed.Comment)) builder.AppendLine(string.Format("{0}: {1}", LanguagesManager.Instance.Seed_Comment, seed.Comment));
if (builder.Length != 0) return builder.ToString().Remove(builder.Length - 2);
else return null;
}
catch (Exception e)
{
throw new ArgumentException("ArgumentException", e);
}
}
示例9: Project
public Project()
{
Uid = Guid.NewGuid();
_services = new ServiceContainer();
Name = "Project";
_levels = new NamedResourceCollection<Level>();
_levels.Modified += (s, e) => OnModified(EventArgs.Empty);
_libraryManager = new LibraryManager();
_libraryManager.Libraries.Modified += (s, e) => OnModified(EventArgs.Empty);
Library defaultLibrary = new Library();
_libraryManager.Libraries.Add(defaultLibrary);
Extra = new List<XmlElement>();
_texturePool = new MetaTexturePool();
_texturePool.AddPool(defaultLibrary.Uid, defaultLibrary.TexturePool);
_tilePools = new MetaTilePoolManager(_texturePool);
_tilePools.AddManager(defaultLibrary.Uid, defaultLibrary.TilePoolManager);
_objectPools = new MetaObjectPoolManager(_texturePool);
_objectPools.AddManager(defaultLibrary.Uid, defaultLibrary.ObjectPoolManager);
_tileBrushes = new MetaTileBrushManager();
_tileBrushes.AddManager(defaultLibrary.Uid, defaultLibrary.TileBrushManager);
SetDefaultLibrary(defaultLibrary);
_services.AddService(typeof(TilePoolManager), _tilePools);
ResetModified();
}
示例10: Start
/// <summary>
/// Starts the applications logic. Loads libraries, ect.
/// </summary>
public void Start()
{
//Load the app settings
_settings = new Settings();
_settings.Load();
try
{
FileInfo dataFile = new FileInfo(_settings.LibraryDatabaseFilePath);
if(!dataFile.Directory.Exists )
{
dataFile.Directory.Create();
}
}
catch(Exception e)
{
//Well this puts us in a pickle
// System.Windows.Forms.MessageBox.Show("Unable to start αPlay! Could not find nor create αPlay directory.\r\nError: " + e.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
//Load main library
Library mainLib = new Library(_settings.LibraryDatabaseFilePath);
_libraries.Add(mainLib);
//Start UI thread
// _uiThread = new Thread(new ThreadStart(delegate {Application.Run(new MainWindow(this));}));
//_uiThread.SetApartmentState(ApartmentState.STA);
//_uiThread.IsBackground = false;
//_uiThread.Start();
}
示例11: Main
static void Main(string[] args)
{
Database.SetInitializer(new LibraryInitializer());
//var person = new Author
//{
// AuthorId = 2,
// Email = "[email protected]",
// Name = "Helen",
// BirthDate = DateTime.Now,
//};
//var collection = new BooksCollection
//{
// Name = "New collection",
// BooksCollectionId = 1,
// CollectorId = 2
//};
//var book = new Book
//{
// BookId = 1,
// Name = "First book",
// AuthorId = 2,
// BookCollectionId = 1,
//};
using (var db = new Library())
{
// db.Collections.Add(collection);
// db.Authors.Add(person);
// db.Books.Add(book);
db.SaveChanges();
// //var author = db.Books.First().Author; author is NULL!!!!
// //Console.Write(string.Format("Firat book author name is {0}, email is {1}", author.Name, author.Email));
}
Console.Write("Author saved !");
Console.ReadLine();
}
示例12: Save
public static void Save(Library sourceLib, string Path)
{
try
{
string[] chn = new string[Library.CurrentLength()];
string[] eng = new string[Library.CurrentLength()];
string[] frequencyString = new string[Library.CurrentLength()];
for (int i = 0; i < Library.CurrentLength(); i++)
{
//if (sourceLib.GetEntry(i) == null)
//{
//chn[i] = "";
//eng[i] = "";
//frequencyString[i] = "0";
//}//prevent empty entry : string ""
//else
//{
chn[i] = sourceLib.GetEntry(i).GetChinese();
eng[i] = sourceLib.GetEntry(i).GetEnglish();
frequencyString[i] = sourceLib.GetEntry(i).GetFrequency().ToString();
//}
}
System.IO.File.WriteAllLines(frequencyPath, frequencyString);
System.IO.File.WriteAllLines(engPath, eng);
System.IO.File.WriteAllLines(chnPath, chn);
}
catch { DeleteLibrary(); }
}
示例13: testConstructedGenericClass
public void testConstructedGenericClass() {
var typeSystem = new Library(new String[] { bin });
var typeInfo = typeSystem.getType("stab/bytecode/test/classes/GenericClass");
var args = new ArrayList<TypeInfo>();
args.add(typeSystem.getType("java/lang/String"));
doTest("ConstructedGenericClass", typeSystem.getGenericType(typeInfo, args));
}
示例14: testObjectMethods
public void testObjectMethods() {
var typeSystem = new Library(new String[] {});
var typeInfo = typeSystem.getType("java/lang/Object");
var names = Query.asIterable(new String[] {
"<init>", "equals", "getClass", "hashCode", "notify", "notifyAll", "toString", "wait", "wait", "wait" });
Assert.assertTrue(typeInfo.Methods.where(p => p.IsPublic).select(p => p.Name).orderBy(p => p).sequenceEqual(names));
}
示例15: Main
static void Main(string[] args)
{
Book firstBook = new Book("C#", "Svetlin Nakov");
Book secondBook = new Book("Java", "Svetlin Nakov");
Book thirdBook = new Book(".NET", "Svetlin Nakov");
Book fourthBook = new Book("Ice and fire", "George Martin");
Library telerikLib = new Library("Telerik Library");
telerikLib.Add(firstBook);
telerikLib.Add(secondBook);
telerikLib.Add(thirdBook);
telerikLib.Add(fourthBook);
Console.WriteLine("Display library :");
telerikLib.DisplayAll();
int startIndx = 0;
int indxFound;
while (telerikLib.IndexOf("Svetlin Nakov", startIndx, SearchOption.Author) != -1)
{
indxFound = telerikLib.IndexOf("Svetlin Nakov", startIndx, SearchOption.Author);
telerikLib.DeleteAt(indxFound);
}
Console.WriteLine("\nAfter deleting :");
telerikLib.DisplayAll();
}