• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FilePath类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetRepositoryReference

		public override Repository GetRepositoryReference (FilePath path, string id)
		{
			GitRepository repo;
			if (!repositories.TryGetValue (path.CanonicalPath, out repo) || repo.Disposed)
				repositories [path.CanonicalPath] = repo = new GitRepository (this, path, null);
			return repo;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:GitVersionControl.cs


示例17: IncludeNewFilesDialog

		public IncludeNewFilesDialog (string title, FilePath baseDirectory)
		{
			this.Build ();
			this.Title = title;
			this.baseDirectory = baseDirectory;
			
			treeviewFiles.Model = store;
			
			treeviewFiles.HeadersVisible = false; // Headers are untranslated because they're hidden as default
			
			TreeViewColumn textColumn = new TreeViewColumn ();
			
			CellRendererToggle toggleRender = new CellRendererToggle ();
			toggleRender.Toggled += ToggleRenderToggled;
			textColumn.PackStart (toggleRender, false);
			textColumn.AddAttribute (toggleRender, "active", Columns.IsToggled);
			
			textColumn.Title = "Name";
			var pixbufRenderer = new CellRendererImage ();
			textColumn.PackStart (pixbufRenderer, false);
			textColumn.AddAttribute (pixbufRenderer, "image", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-open", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-closed", Columns.IconClosed);
			
			CellRendererText textRenderer = new CellRendererText ();
			textColumn.PackStart (textRenderer, false);
			textColumn.AddAttribute (textRenderer, "text", Columns.Text);
			treeviewFiles.AppendColumn (textColumn);
			buttonExcludeAll.Clicked += ButtonExcludeAllClicked;
			buttonIncludeAll.Clicked += ButtonIncludeAllClicked;
			buttonOk.Clicked += ButtonOkClicked;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:32,代码来源:IncludeNewFilesDialog.cs


示例18: ShouldOpenInXcode

		public bool ShouldOpenInXcode (FilePath fileName)
		{
			if (!HasInterfaceDefinitionExtension (fileName))
				return false;
			var file = dnp.Files.GetFile (fileName);
			return file != null && (file.BuildAction == BuildAction.InterfaceDefinition);
		}
开发者ID:aleksandersumowski,项目名称:monodevelop,代码行数:7,代码来源:XcodeProjectTracker.cs


示例19: Show

		/// <summary>
		/// Retrieve and display annotations for a given VersionControlItem
		/// </summary>
		/// <param name="repo">
		/// A <see cref="Repository"/> to which file belongs
		/// </param>
		/// <param name="file">
		/// A <see cref="FilePath"/>: The file to annotate
		/// </param>
		/// <param name="test">
		/// A <see cref="System.Boolean"/>: Whether this is a test run
		/// </param>
		/// <returns>
		/// A <see cref="System.Boolean"/>: Whether annotations are supported
		/// </returns>
		public static bool Show (Repository repo, FilePath file, bool test)
		{
			if (test){ 
				if (null != repo && repo.CanGetAnnotations (file)) {
					foreach (Ide.Gui.Document guidoc in IdeApp.Workbench.Documents) {
						if (guidoc.FileName.Equals (file)) {
							SourceEditorView seview  = guidoc.ActiveView as SourceEditorView;
							if (null != seview && 
							    seview.TextEditor.HasMargin (typeof (AnnotationMargin)) && 
							    seview.TextEditor.GetMargin (typeof (AnnotationMargin)).IsVisible) { 
								return false;
							}
						}
					}
					return true;
				}
				return false;
			}
			
			MonoDevelop.Ide.Gui.Document doc = IdeApp.Workbench.OpenDocument (file, true);
			SourceEditorView view = doc.ActiveView as SourceEditorView;
			if (view != null) {
				if (view.TextEditor.HasMargin (typeof (AnnotationMargin))) { 
					view.TextEditor.GetMargin (typeof (AnnotationMargin)).IsVisible = true;
				} else {
					view.TextEditor.InsertMargin (0, new AnnotationMargin (repo, view.TextEditor, doc));
				}
				view.TextEditor.QueueDraw ();
			}
			
			return true;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:47,代码来源:AnnotateView.cs


示例20: ContainsFile

		public bool ContainsFile (FilePath fileName)
		{
			for (int n=0; n<items.Count; n++)
				if (items [n].LocalPath == fileName)
					return true;
			return false;
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:7,代码来源:ChangeSet.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FilePermissions类代码示例发布时间:2022-05-24
下一篇:
C# FileOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap