本文整理汇总了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;
}
示例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);
}
示例3: WpfViewContent
public WpfViewContent(OpenedFile file) : base(file)
{
BasicMetadata.Register();
this.TabPageText = "${res:FormsDesigner.DesignTabPages.DesignTabPage}";
this.IsActiveViewContentChanged += OnIsActiveViewContentChanged;
}
示例4: ResourceEditWrapper
public ResourceEditWrapper(OpenedFile file)
{
this.TabPageText = "Resource editor";
base.UserControl = resourceEditor;
resourceEditor.ResourceList.Changed += new EventHandler(SetDirty);
this.Files.Add(file);
}
示例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);
}
示例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);
}
示例7: TagListViewContent
public TagListViewContent(OpenedFile file)
{
Files.Add(file);
OnFileNameChanged(file);
file.ForceInitializeView(this);
TabPageText = "Design";
}
示例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.");
}
示例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;
}
示例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;
}
示例11: AssertAreEqual
void AssertAreEqual(OpenedFile expectedOpenedFile, OpenedFile actualOpenedFile)
{
string fileName = actualOpenedFile.FileName.ToString();
string expectedFileName = expectedOpenedFile.FileName.ToString();
Assert.AreEqual(expectedFileName, fileName);
}
示例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);
}
示例13: AppConfigViewContent
public AppConfigViewContent(OpenedFile file)
{
TabPageText = "Design";
Files.Add(file);
OnFileNameChanged(file);
file.ForceInitializeView(this);
}
示例14: CreateContentForFile
public IViewContent CreateContentForFile(OpenedFile file)
{
try {
return new EDMDesignerViewContent(file);
} catch (WizardCancelledException) {
return null;
}
}
示例15: SetupDesigner
public static ReportDesignerView SetupDesigner (OpenedFile file)
{
if (file == null) {
throw new ArgumentNullException("file");
}
IDesignerGenerator generator = new ReportDesignerGenerator();
return new ReportDesignerView(file, generator);
}