本文整理汇总了C#中Catalog.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Catalog.Save方法的具体用法?C# Catalog.Save怎么用?C# Catalog.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog.Save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDefaultCatalog
void CreateDefaultCatalog (IProgressMonitor monitor)
{
IFileScanner[] scanners = TranslationService.GetFileScanners ();
Catalog catalog = new Catalog (this);
List<Project> projects = new List<Project> ();
foreach (Project p in ParentSolution.GetAllProjects ()) {
if (IsIncluded (p))
projects.Add (p);
}
foreach (Project p in projects) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Scanning project {0}...", p.Name));
foreach (ProjectFile file in p.Files) {
if (!File.Exists (file.FilePath))
continue;
if (file.Subtype == Subtype.Code) {
string mimeType = DesktopService.GetMimeTypeForUri (file.FilePath);
foreach (IFileScanner fs in scanners) {
if (fs.CanScan (this, catalog, file.FilePath, mimeType))
fs.UpdateCatalog (this, catalog, monitor, file.FilePath);
}
}
}
if (monitor.IsCancelRequested)
return;
monitor.Step (1);
}
catalog.Save (Path.Combine (this.BaseDirectory, "messages.po"));
}
示例2: RemoveEntry
public void RemoveEntry (string msgstr)
{
foreach (Translation translation in this.Translations) {
string poFileName = translation.PoFile;
Catalog catalog = new Catalog (this);
catalog.Load (new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor (), poFileName);
CatalogEntry entry = catalog.FindItem (msgstr);
if (entry != null) {
catalog.RemoveItem (entry);
catalog.Save (poFileName);
}
}
}
示例3: Initialize
/// <summary>
/// Inicializa el catálogo cargando el archivo default.mat
/// Si no encuentra el archivo, carga los datos 'hardcoded'
/// </summary>
public void Initialize()
{
try
{
materials.Load(System.Windows.Forms.Application.StartupPath + "\\RuntimeData\\default.mat");
if (materials[DefaultConcrete.Name] == null)
materials[DefaultConcrete.Name] = DefaultConcrete;
if (materials[DefaultSteel.Name] == null)
materials[DefaultSteel.Name] = DefaultSteel;
if (materials[DefaultRebar.Name] == null)
materials[DefaultRebar.Name] = DefaultRebar;
}
catch (Exception)
{
// Reconstruir catálogo de materiales
materials = new Catalog<Material>();
// defaultMaterial = new Material(Culture.Get("aluminumName"), false, new AluminumDesignProps(), new IsotropicTypeProps(69637054684.101F, 0.33F, 0.00002358F), 2.714F);
// materials[DefaultMaterial.Name] = DefaultMaterial;
// defaultMaterial = new Material(Culture.Get("coldFormedName"), false, new ColdFormedDesignProps(), new IsotropicTypeProps(2.03395357740716E+11F, 0.3F, 0.0000117F), 7.849F);
// materials[DefaultMaterial.Name] = DefaultMaterial;
/************ CONCRETE *************/
defaultConcrete = new Material("4000Psi", false, new ConcreteDesignProps(27579031.558F, 413685473.37F, 275790315.58F, false, 1.0F), new IsotropicTypeProps(24821128402.26F, 0.2F, 0.0000099F), 2403F);
materials[defaultConcrete.Name] = DefaultConcrete;
materials["3000Psi"] = new Material("3000Psi", false, new ConcreteDesignProps(20684273.67f, 413685473.37F, 275790315.58F, false, 1f), new IsotropicTypeProps(21530000000f, 0.2f, 0.0000099f), 2402.8f);
// materials["4000Psi"] = new Material("4000Psi", false, new ConcreteDesignProps(27579031.56f, 413685473.37F, 275790315.58F, false, 1f), new IsotropicTypeProps(24860000000f, 0.2f, 0.0000099f), 2402.8f);
materials["5000Psi"] = new Material("5000Psi", false, new ConcreteDesignProps(34473789.45f, 413685473.37F, 275790315.58F, false, 1f), new IsotropicTypeProps(27790000000f, 0.2f, 0.0000099f), 2402.8f);
materials["6000Psi"] = new Material("6000Psi", false, new ConcreteDesignProps(41368547.34f, 413685473.37F, 275790315.58F, false, 1f), new IsotropicTypeProps(30440000000f, 0.2f, 0.0000099f), 2402.8f);
//defaultSteel = new Material(Culture.Get("noMaterialName"), true, new NoDesignProps(), new IsotropicTypeProps(24821128402.26F, 0.2F, 0.0000099F), 2401F);
//materials[DefaultSteel.Name] = DefaultSteel;
/************ REBAR *************/
defaultRebar = new Material(Culture.Get("rebarName"), false, new RebarDesignProps(), new UniaxialTypeProps(1.99947978795958E+11F, 0.0000117F), 7849F);
materials[defaultRebar.Name] = defaultRebar;
/************ STEEL *************/
materials["A36"] = new Material("A36", false, new SteelDesignProps(248211284f, 399895958f), new IsotropicTypeProps(1.99947978795958E+11F, 0.3F, 0.0000117F), 7849F);
defaultSteel = materials["A36"];
materials["A50"] = new Material("A50", false, new SteelDesignProps(379211684f, 427474989f), new IsotropicTypeProps(1.999E+11f, 0.3f, 0.0000117f), 7849);
materials["A500GrB42"] = new Material("A500GrB42", false, new SteelDesignProps(289579831.4f, 399895958f), new IsotropicTypeProps(1.999E+11f, 0.3f, 0.0000117f), 7849);
materials["A500GrB46"] = new Material("A500GrB46", false, new SteelDesignProps(317158863f, 399895958f), new IsotropicTypeProps(1.999E+11f, 0.3f, 0.0000117f), 7849);
materials["A53GrB"] = new Material("A53GrB", false, new SteelDesignProps(241316526.1f, 413685473f), new IsotropicTypeProps(1.999E+11f, 0.3f, 0.0000117f), 7849);
materials["A572Gr50"] = new Material("A572Gr50", false, new SteelDesignProps(344737894, 448159263f), new IsotropicTypeProps(1.999E+11f, 0.3f, 0.0000117f), 7849);
materials["A913Gr50"] = new Material("A913Gr50", false, new SteelDesignProps(344737894, 413685473f), new IsotropicTypeProps(1.999E+11f, 0.3f, 0.0000117f), 7849);
materials["A992Fy50"] = new Material("A992Fy50", false, new SteelDesignProps(344737894, 448159263f), new IsotropicTypeProps(1.999E+11f, 0.3f, 0.0000117f), 7849);
materials.Save(System.Windows.Forms.Application.StartupPath + "\\RuntimeData\\default.mat");
//throw e;
}
}