本文整理汇总了C#中Project.GetProjectPath方法的典型用法代码示例。如果您正苦于以下问题:C# Project.GetProjectPath方法的具体用法?C# Project.GetProjectPath怎么用?C# Project.GetProjectPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project.GetProjectPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditProject
public static Project EditProject(Project p)
{
var p2 = ShowProjectDialog(p);
if (p2 == null)
{
return null;
}
p2.SetProjectPath(p.GetProjectPath());
bool r = SaveProject(p2);
if (r == false)
{
MessageBox.Show("There was an error saving the project, changes will not be made");
return null;
}
return p2;
}
示例2: AddPlugin
/// <summary>
/// Adds the plugin.
/// </summary>
/// <param name="plugin">The plugin.</param>
/// <param name="project">The project.</param>
/// <param name="folderName">Name of the folder.</param>
/// <param name="extensionName">Name of the extension.</param>
internal void AddPlugin(
Plugin plugin,
Project project,
string folderName,
string extensionName)
{
string projectPath = project.GetProjectPath();
string source = plugin.Source;
string destination = string.Format(@"{0}\Lib\{1}", projectPath, plugin.FileName);
//// at this moment we only want ot do the core as this plugin might not be
//// supported in the ui project.
if (extensionName == "Core")
{
this.AddReference(project, destination, source);
}
else
{
//// now if we are not the core project we need to add the platform specific assemblies
//// and the bootstrap item templates!
string extensionSource = this.GetExtensionSource(folderName, extensionName, source);
string extensionDestination = this.GetExtensionDestination(folderName, extensionName, destination);
if (File.Exists(extensionSource))
{
//// if the plugin is supported add in the core library.
//// only do if destination file doesnt exist
if (File.Exists(destination) == false)
{
this.AddReference(project, destination, source);
}
//// only do if extensionDestination file doesnt exist
if (File.Exists(extensionDestination) == false)
{
this.AddReference(project, extensionDestination, extensionSource);
this.BuildSourceFile(project, extensionSource, extensionDestination, plugin.FriendlyName);
}
}
}
}
示例3: LoadTimesheet
public static List<Session> LoadTimesheet(Project p)
{
var file = FileExtras.LoadFile(GetTimesheetPath(p.GetProjectPath()));
if (String.IsNullOrEmpty(file))
return null;
var sessions = StringExtras.SplitString(file, "\b");
var ret = new List<Session>();
foreach (var s in sessions)
{
ret.Add((Session)Reflection.DeserialiseObject(typeof(Session), s));
}
return ret;
}
示例4: SaveTimesheet
public static void SaveTimesheet(Project p, List<Session> sessions)
{
var tp = GetTimesheetPath(p.GetProjectPath());
if (File.Exists(tp))
{
File.Delete(tp);
}
String ts = "";
foreach (var s in sessions)
{
ts += Reflection.SerialiseObject(s) + "\b";
}
FileExtras.SaveToFile(tp, ts);
}
示例5: SaveProject
public static bool SaveProject(Project p)
{
return Reflection.SerialiseObject(p, GetInfoFilePath(p.GetProjectPath()));
}