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


C# SharpDevelop.OpenedFile类代码示例

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


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

示例1: Create

		public static MyTypeFinder Create(OpenedFile file)
		{
			MyTypeFinder f = new MyTypeFinder();
			f.file = file;
			f.ImportFrom(CreateWpfTypeFinder());
			return f;
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:MyTypeFinder.cs

示例2: Load

		public override void Load(OpenedFile file, Stream stream)
		{
			XmlDocument doc = new XmlDocument();
			doc.Load(stream);
			projectContent = ParserService.GetProjectContent(ProjectService.CurrentProject);
			canvas.LoadFromXml(doc, projectContent);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:ClassDiagramViewContent.cs

示例3: WpfViewContent

		public WpfViewContent(OpenedFile file) : base(file)
		{
			BasicMetadata.Register();
			
			this.TabPageText = "${res:FormsDesigner.DesignTabPages.DesignTabPage}";
			this.IsActiveViewContentChanged += OnIsActiveViewContentChanged;
		}
开发者ID:pluraldj,项目名称:SharpDevelop,代码行数:7,代码来源:WpfViewContent.cs

示例4: ResourceEditWrapper

		public ResourceEditWrapper(OpenedFile file)
		{
			this.TabPageText = "Resource editor";
			base.UserControl = resourceEditor;
			resourceEditor.ResourceList.Changed += new EventHandler(SetDirty);
			this.Files.Add(file);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:DisplayDefinition.cs

示例5: CreateContentForFile

		public IViewContent CreateContentForFile(OpenedFile file)
		{
			var codons = DisplayBindingService.GetCodonsPerFileName(file.FileName);
			DisplayBindingDescriptor bestMatch = null;
			double max = double.NegativeInfinity;
			const int BUFFER_LENGTH = 4 * 1024;
			
			using (var stream = file.OpenRead()) {
				string mime = "text/plain";
				if (stream.Length > 0) {
					stream.Position = 0;
					mime = MimeTypeDetection.FindMimeType(new BinaryReader(stream).ReadBytes(BUFFER_LENGTH));
				}
				foreach (var codon in codons) {
					stream.Position = 0;
					double value = codon.Binding.AutoDetectFileContent(file.FileName, stream, mime);
					if (value > max) {
						max = value;
						bestMatch = codon;
					}
				}
			}
			
			if (bestMatch == null)
				throw new InvalidOperationException();
			
			return bestMatch.Binding.CreateContentForFile(file);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:28,代码来源:AutoDetectDisplayBinding.cs

示例6: LoadInternal

		protected override void LoadInternal(OpenedFile file, Stream stream)
		{
			if (file == this.PrimaryFile) {
				// The FormsDesignerViewContent normally operates independently of any
				// text editor. The following statements connect the forms designer
				// directly to the underlying XML text editor so that the caret positioning
				// and text selection operations done by the WiX designer actually
				// become visible in the text editor.
				if (!this.SourceCodeStorage.ContainsFile(file)) {
					TextEditorControl editor = ((ITextEditorControlProvider)this.PrimaryViewContent).TextEditorControl;
					this.SourceCodeStorage.AddFile(file, editor.Document, editor.Encoding ?? ParserService.DefaultFileEncoding, true);
				}
				
				try {
					if (!ignoreDialogIdSelectedInTextEditor) {
						string dialogId = GetDialogIdSelectedInTextEditor();
						if (dialogId == null) {
							dialogId = GetFirstDialogIdInTextEditor();
							JumpToDialogElement(dialogId);
						}
						DialogId = dialogId;
					}
					wixProject = GetProject();
				} catch (XmlException ex) {
					// Let the Wix designer loader try to load the XML and generate
					// an error message.
					DialogId = "InvalidXML";
					AddToErrorList(ex);
				}
			}
			base.LoadInternal(file, stream);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:32,代码来源:WixDialogDesigner.cs

示例7: TagListViewContent

		public TagListViewContent(OpenedFile file)
		{
			Files.Add(file);
			OnFileNameChanged(file);
			file.ForceInitializeView(this);
			TabPageText = "Design";
		}
开发者ID:garryforreg,项目名称:iview-scada,代码行数:7,代码来源:TagListViewContent.cs

示例8: GetSourceFiles

		public IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile)
		{
			// get new initialize components
			ParseInformation info = ParserService.ParseFile(this.viewContent.PrimaryFileName, this.viewContent.PrimaryFileContent);
			ICompilationUnit cu = info.CompilationUnit;
			foreach (IClass c in cu.Classes) {
				if (FormsDesignerSecondaryDisplayBinding.BaseClassIsFormOrControl(c)) {
					this.currentClassPart = c;
					this.initializeComponents = FormsDesignerSecondaryDisplayBinding.GetInitializeComponents(c);
					if (this.initializeComponents != null) {
						string designerFileName = this.initializeComponents.DeclaringType.CompilationUnit.FileName;
						if (designerFileName != null) {
							
							designerCodeFile = FileService.GetOrCreateOpenedFile(designerFileName);
							
							CompoundClass compound = c.GetCompoundClass() as CompoundClass;
							if (compound == null) {
								return new [] {designerCodeFile};
							} else {
								return compound.Parts
									.Select(cl => FileService.GetOrCreateOpenedFile(cl.CompilationUnit.FileName))
									.Distinct();
							}
							
						}
					}
				}
			}
			
			throw new FormsDesignerLoadException("Could not find InitializeComponent method in any part of the open class.");
		}
开发者ID:TiberiuGal,项目名称:SharpDevelop,代码行数:31,代码来源:AbstractDesignerGenerator.cs

示例9: Create

		public static MyTypeFinder Create(OpenedFile file)
		{
			MyTypeFinder f = new MyTypeFinder();
			f.file = file;
			f.ImportFrom(CreateWpfTypeFinder());
			
			var pc = MyTypeFinder.GetProjectContent(file);
			foreach (var referencedProjectContent in pc.ThreadSafeGetReferencedContents()) {
				string fileName = null;
				try{
					if (referencedProjectContent is ParseProjectContent)
					{
						var prj = ((ParseProjectContent)referencedProjectContent).Project as AbstractProject;
						if (prj != null)
							fileName = prj.OutputAssemblyFullPath;
					}
					else if (referencedProjectContent is ReflectionProjectContent)
					{
						fileName = ((ReflectionProjectContent) referencedProjectContent).AssemblyLocation;
					}
					var assembly = Assembly.LoadFrom(fileName);
					f.RegisterAssembly(assembly);
				}
				catch (Exception ex) {
					ICSharpCode.Core.LoggingService.Warn("Error loading Assembly : "+ (fileName ?? ""), ex);
				}
			}
			return f;
		}
开发者ID:netide,项目名称:SharpDevelop,代码行数:29,代码来源:MyTypeFinder.cs

示例10: Save

		public override void Save(OpenedFile file, Stream stream)
		{
			AnalyticsMonitorService.TrackFeature(typeof(HexEditView), "Save");
			this.hexEditContainer.SaveFile(file, stream);
			this.TitleName = Path.GetFileName(file.FileName);
			this.TabPageText = this.TitleName;
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:7,代码来源:HexEditView.cs

示例11: AssertAreEqual

		void AssertAreEqual(OpenedFile expectedOpenedFile, OpenedFile actualOpenedFile)
		{	
			string fileName = actualOpenedFile.FileName.ToString();
			string expectedFileName = expectedOpenedFile.FileName.ToString();
			
			Assert.AreEqual(expectedFileName, fileName);
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:ScriptingDesignerGeneratorTests.cs

示例12: Load

		public override void Load(OpenedFile file, Stream stream)
		{
			_file = file;
			TitleName = Path.GetFileName(file.FileName);
			
			_control.Load(stream);
			_control.DataChanged += new EventHandler(DataChanged);
		}
开发者ID:garryforreg,项目名称:iview-scada,代码行数:8,代码来源:DataSourceViewContent.cs

示例13: AppConfigViewContent

		public AppConfigViewContent(OpenedFile file)
		{
			TabPageText = "Design";

			Files.Add(file);
			OnFileNameChanged(file);
			file.ForceInitializeView(this);
		}
开发者ID:garryforreg,项目名称:iview-scada,代码行数:8,代码来源:AppConfigViewContent.cs

示例14: CreateContentForFile

		public IViewContent CreateContentForFile(OpenedFile file)
		{
			try {
				return new EDMDesignerViewContent(file);
			} catch (WizardCancelledException) {
				return null;
			}
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:8,代码来源:EDMDesignerDisplayBinding.cs

示例15: SetupDesigner

		public static ReportDesignerView SetupDesigner (OpenedFile file)
		{
			if (file == null) {
				throw new ArgumentNullException("file");
			}
			IDesignerGenerator generator = new ReportDesignerGenerator();
			return new ReportDesignerView(file, generator);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:ViewCommands.cs


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