当前位置: 首页>>代码示例>>C#>>正文


C# FilePath类代码示例

本文整理汇总了C#中FilePath的典型用法代码示例。如果您正苦于以下问题:C# FilePath类的具体用法?C# FilePath怎么用?C# FilePath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FilePath类属于命名空间,在下文中一共展示了FilePath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetObjectReaderForFile

		WorkspaceObjectReader GetObjectReaderForFile (FilePath file, Type type)
		{
			foreach (var r in GetObjectReaders ())
				if (r.CanRead (file, type))
					return r;
			return null;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:7,代码来源:ProjectService.cs

示例2: RunDialog

		bool RunDialog (OpenFileDialogData data)
		{			
			Application.EnableVisualStyles ();
			
			FileDialog fileDlg = null;
			if (data.Action == Gtk.FileChooserAction.Open)
				fileDlg = new OpenFileDialog ();
			else
				fileDlg = new SaveFileDialog ();
			
			var dlg = new CustomOpenFileDialog (fileDlg, data);
				
			SelectFileDialogHandler.SetCommonFormProperties (data, dlg.FileDialog);
			
			using (dlg) {
				rootForm = new WinFormsRoot ();
				if (dlg.ShowDialog (rootForm) == DialogResult.Cancel) {
					return false;
				}
	
				FilePath[] paths = new FilePath [fileDlg.FileNames.Length];
				for (int n = 0; n < fileDlg.FileNames.Length; n++)	
					paths [n] = fileDlg.FileNames [n];
				data.SelectedFiles = paths;
				
				if (dlg.SelectedEncodingId != null)
					data.Encoding = dlg.SelectedEncodingId > 0 ? Encoding.GetEncoding (dlg.SelectedEncodingId) : null;
				if (dlg.SelectedViewer != null)
					data.SelectedViewer = dlg.SelectedViewer;
				
				data.CloseCurrentWorkspace = dlg.CloseCurrentWorkspace;
			}
			
			return true;
		}
开发者ID:IBBoard,项目名称:monodevelop,代码行数:35,代码来源:OpenFileDialogHandler.cs

示例3: Setup

		public override void Setup ()
		{
			// Generate directories and a svn util.
			rootUrl = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
			rootCheckout = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
			Directory.CreateDirectory (rootUrl.FullPath + "repo.git");
			repoLocation = "file:///" + rootUrl.FullPath + "repo.git";

			// Initialize the bare repo.
			InitCommand ci = new InitCommand ();
			ci.SetDirectory (new Sharpen.FilePath (rootUrl.FullPath + "repo.git"));
			ci.SetBare (true);
			ci.Call ();
			FileRepository bare = new FileRepository (new Sharpen.FilePath (rootUrl.FullPath + "repo.git"));
			string branch = Constants.R_HEADS + "master";

			RefUpdate head = bare.UpdateRef (Constants.HEAD);
			head.DisableRefLog ();
			head.Link (branch);

			// Check out the repository.
			Checkout (rootCheckout, repoLocation);
			repo = GetRepo (rootCheckout, repoLocation);
			DOT_DIR = ".git";
		}
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:25,代码来源:BaseGitRepositoryTests.cs

示例4: GetNextForPath

		FileSystemExtension GetNextForPath (FilePath file, bool isDirectory)
		{
			FileSystemExtension nx = next;
			while (nx != null && !nx.CanHandlePath (file, isDirectory))
				nx = nx.next;
			return nx;
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:7,代码来源:FileSystemExtension.cs

示例5: Package

		public static IAsyncOperation Package (MonoMacProject project, ConfigurationSelector configSel,
			MonoMacPackagingSettings settings, FilePath target)
		{
			IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor (
				GettextCatalog.GetString ("Packaging Output"),
				MonoDevelop.Ide.Gui.Stock.RunProgramIcon, true, true);
			
			 var t = new System.Threading.Thread (() => {
				try {
					using (mon) {
						BuildPackage (mon, project, configSel, settings, target);
					}	
				} catch (Exception ex) {
					mon.ReportError ("Unhandled error in packaging", null);
					LoggingService.LogError ("Unhandled exception in packaging", ex);
				} finally {
					mon.Dispose ();
				}
			}) {
				IsBackground = true,
				Name = "Mac Packaging",
			};
			t.Start ();
			
			return mon.AsyncOperation;
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:26,代码来源:MonoMacPackaging.cs

示例6: Run

		protected override void Run ()
		{
			var doc = IdeApp.Workbench.ActiveDocument;
			var currentLocation = doc.Editor.Caret.Location;

			var controller = doc.ParsedDocument.GetTopLevelTypeDefinition (currentLocation);
			string controllerName = controller.Name;
			int pos = controllerName.LastIndexOf ("Controller", StringComparison.Ordinal);
			if (pos > 0)
				controllerName = controllerName.Remove (pos);

			var baseDirectory = doc.FileName.ParentDirectory.ParentDirectory;

			string actionName = doc.ParsedDocument.GetMember (currentLocation).Name;
			var viewFoldersPaths = new FilePath[] {
				baseDirectory.Combine ("Views", controllerName),
				baseDirectory.Combine ("Views", "Shared")
			};
			var viewExtensions = new string[] { ".aspx", ".cshtml" };

			foreach (var folder in viewFoldersPaths) {
				foreach (var ext in viewExtensions) {
					var possibleFile = folder.Combine (actionName + ext);
					if (File.Exists (possibleFile)) {
						IdeApp.Workbench.OpenDocument (possibleFile);
						return;
					}
				}
			}

			MessageService.ShowError ("Matching view cannot be found.");
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:32,代码来源:CommandHandlers.cs

示例7: GetPathUrl

		public override string GetPathUrl (FilePath path)
		{
			lock (client) {
				Uri u = client.GetUriFromWorkingCopy (path);
				return u != null ? u.ToString () : null;
			}
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:7,代码来源:SvnSharpClient.cs

示例8: Run

        public bool Run(SelectFileDialogData data)
        {
            CommonDialog dlg = null;
            if (data.Action == Gtk.FileChooserAction.Open)
                dlg = new OpenFileDialog();
            else if (data.Action == Gtk.FileChooserAction.Save)
                dlg = new SaveFileDialog();
			else if (data.Action == Gtk.FileChooserAction.SelectFolder)
				dlg = new FolderBrowserDialog ();
			
			if (dlg is FileDialog)
				SetCommonFormProperties (data, dlg as FileDialog);
			else
				SetFolderBrowserProperties (data, dlg as FolderBrowserDialog);
			

			using (dlg) {
                WinFormsRoot root = new WinFormsRoot();
                if (dlg.ShowDialog(root) == DialogResult.Cancel)
                    return false;
				
				if (dlg is FileDialog) {
					var fileDlg = dlg as OpenFileDialog;
					FilePath[] paths = new FilePath [fileDlg.FileNames.Length];
					for (int n=0; n < fileDlg.FileNames.Length; n++)
						paths [n] = fileDlg.FileNames [n];
                    data.SelectedFiles = paths;    
				} else {
					var folderDlg = dlg as FolderBrowserDialog;
					data.SelectedFiles = new [] { new FilePath (folderDlg.SelectedPath) };
				}

				return true;
			}
        }
开发者ID:Poiros,项目名称:monodevelop,代码行数:35,代码来源:SelectFileDialogHandler.cs

示例9: AvdWatcher

		//TODO: handle errors
		public AvdWatcher ()
		{
			VirtualDevices = new AndroidVirtualDevice[0];
			
			FilePath home = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
			if (PropertyService.IsWindows) {
				home = home.ParentDirectory;
			}
			avdDir = home.Combine (".android", "avd");
			if (!Directory.Exists (avdDir))
				Directory.CreateDirectory (avdDir);
			
			var avds = Directory.GetFiles (avdDir, "*.ini");
			UpdateAvds (avds, null);
			
			//FSW on mac is unreliable
			if (PropertyService.IsMac) {
				modTimes = new Dictionary<string, DateTime> ();
				foreach (var f in avds)
					modTimes[f] = File.GetLastWriteTimeUtc (f);
				timeoutId = GLib.Timeout.Add (750, HandleTimeout);
			} else {
				CreateFsw ();
			}
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:26,代码来源:AvdWatcher.cs

示例10: Setup

		public override void Setup ()
		{
			RemotePath = new FilePath (FileService.CreateTempDirectory ());
			RemoteUrl = "svn://localhost:3690/repo";
			SvnServe = new Process ();
			base.Setup ();
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:7,代码来源:RepositoryTests.cs

示例11: Run

        public bool Run(ConfigNode cfg)
        {
            fLastException = null;

             Console.WriteLine("Starting CreateHDFFromASC...");

             fWorkingDir = cfg["working.dir", AppDomain.CurrentDomain.BaseDirectory].AsFilePath();

             try
             {
            if (cfg["from.asc.to.xyz", false].AsBool())
               ConvertToXYZ(cfg);

            if (cfg["from.xyz.to.mgd", false].AsBool())
               ConvertToMGD(cfg);

            if (cfg["from.mgd.to.hdf", false].AsBool())
               ConvertToHDF(cfg);

            if (cfg["glue.hdfs", false].AsBool())
               GlueHDFs(cfg);

            Console.WriteLine("CreateHDFFromASC finished successfully...");
            return true;
             }
             catch (Exception ex)
             {
            fLastException = ex;
            return false;
             }
        }
开发者ID:JauchOnGitHub,项目名称:csharptoolbox,代码行数:31,代码来源:create.hdf.from.asc.cs

示例12: androidPackageTest

        void androidPackageTest (bool signed)
        {                        
            var projectFile = context.WorkingDirectory
                .Combine ("TestProjects/HelloWorldAndroid/HelloWorldAndroid/")
                .CombineWithFilePath ("HelloWorldAndroid.csproj");

            projectFile = new FilePath ("./TestProjects/HelloWorldAndroid/HelloWorldAndroid/HelloWorldAndroid.csproj");

            FilePath apkFile = null;

            try {
                apkFile = context.CakeContext.AndroidPackage(
                    projectFile,
                    signed,
                    c => {
                        c.Verbosity = Verbosity.Diagnostic;
                        c.Configuration = "Release";
                    });
            } catch (Exception ex) {
                Console.WriteLine(ex);
                context.DumpLogs();
                Assert.Fail(context.GetLogs());
            }
            
            Assert.IsNotNull (apkFile);
            Assert.IsNotNull (apkFile.FullPath);
            Assert.IsNotEmpty (apkFile.FullPath);
            Assert.IsTrue (System.IO.File.Exists (apkFile.FullPath));
        }
开发者ID:Redth,项目名称:Cake.Xamarin,代码行数:29,代码来源:AndroidTests.cs

示例13: CanExecute

 public override bool CanExecute(FilePath path)
 {
     UnixFileInfo fi = new UnixFileInfo (path);
     if (!fi.Exists)
         return false;
     return 0 != (fi.FileAccessPermissions & (FileAccessPermissions.UserExecute | FileAccessPermissions.GroupExecute | FileAccessPermissions.OtherExecute));
 }
开发者ID:stinos,项目名称:ngit,代码行数:7,代码来源:UnixFileHelper.cs

示例14: FindReferences

		public override IEnumerable<MemberReference> FindReferences (ProjectDom dom, FilePath fileName, IEnumerable<INode> searchedMembers)
		{
			var editor = TextFileProvider.Instance.GetTextEditorData (fileName);
			AspNetAppProject project = dom.Project as AspNetAppProject;
			if (project == null)
				yield break;
			
			var unit = AspNetParserService.GetCompileUnit (project, fileName, true);
			if (unit == null)
				yield break;
			var refman = new DocumentReferenceManager (project);
			
			var parsedAspDocument = (AspNetParsedDocument)new AspNetParser ().Parse (dom, fileName, editor.Text);
			refman.Doc = parsedAspDocument;
			
			var usings = refman.GetUsings ();
			var documentInfo = new DocumentInfo (dom, unit, usings, refman.GetDoms ());
			
			var builder = new AspLanguageBuilder ();
			
			
			var buildDocument = new Mono.TextEditor.Document ();
			var offsetInfos = new List<LocalDocumentInfo.OffsetInfo> ();
			buildDocument.Text = builder.BuildDocumentString (documentInfo, editor, offsetInfos, true);
			var parsedDocument = AspLanguageBuilder.Parse (dom, fileName, buildDocument.Text);
			foreach (var member in searchedMembers) {
				foreach (var reference in SearchMember (member, dom, fileName, editor, buildDocument, offsetInfos, parsedDocument)) {
					yield return reference;
				}
			}
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:31,代码来源:ASPNetReferenceFinder.cs

示例15: GetRepositoryReference

		public override Repository GetRepositoryReference(FilePath path, string id)
		{
			if (!IsVersioned(path))
				return null;

			return new GitRepository(this, FindRepositoryPath(path));
		}
开发者ID:yvanjanssens,项目名称:monodevelop-git,代码行数:7,代码来源:GitVersionControl.cs


注:本文中的FilePath类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。