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

C# PhactoryHost类代码示例

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

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



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

示例1: View

        public View(PhactoryHost.Database.Resource resource)
        {
            InitializeComponent();

            Resource = resource;
            modified = false;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:7,代码来源:View.cs


示例2: RefreshOutput

        public void RefreshOutput(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return;
            }

            if (!fileInfo.Exists)
            {
                return;
            }

            if (!IsResourceSupported(resource))
            {
                return;
            }

            var tempDocument = Host.XMLRead<Document.Document>(Host.GetFileInfo(resource).FullName);
            var outputFilenames = new List<string>();

            foreach (Document.Item item in tempDocument.Items)
            {
                var resItem = Host.GetResource(item.ResourceID);
                var resFileInfo = Host.GetFileInfo( resItem );
                var outputFilename = resFileInfo.Name;

                string outputFilenameBin = outputFilename + ".bin";
                outputFilenames.Add(outputFilenameBin);
            }

            Host.RefreshOutput(resource, outputFilenames);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:33,代码来源:Output.cs


示例3: View

        public View(PhactoryHost.Database.Resource resource)
        {
            InitializeComponent();

            Resource = resource;
            modified = false;

            lvFiles.Clear();
            lvFiles.Columns.Add("Filename", 172);
            lvFiles.Columns.Add("WidthCPC", 64);
            lvFiles.Columns.Add("Width", 30);
            lvFiles.Columns.Add("Height", 30);

            lvPalette.Clear();
            lvPalette.Columns.Add("Pen", 100);
            lvPalette.Columns.Add("Color", 100);
            lvPalette.Columns.Add("Gate Array", 100);

            cbMode.Items.Clear();
            cbMode.Items.Add("MODE0");
            cbMode.Items.Add("MODE1");
            cbMode.Items.Add("MODE2");

            RefreshProperties();
        }
开发者ID:rgiot,项目名称:phactory,代码行数:25,代码来源:View.cs


示例4: RefreshOutput

        public void RefreshOutput(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return;
            }

            if (!fileInfo.Exists)
            {
                return;
            }

            if (!IsResourceSupported(resource))
            {
                return;
            }

            Document.Document document = Host.XMLRead<Document.Document>(Host.GetFileInfo(resource).FullName);
            if (document is Document.Document)
            {
                List<string> outputFilenames = new List<string>();

                string outputFilename = fileInfo.Name + ".bin";
                outputFilenames.Add( outputFilename );

                Host.RefreshOutput(resource, outputFilenames);
            }
        }
开发者ID:rgiot,项目名称:phactory,代码行数:29,代码来源:Output.cs


示例5: GetBrokenResourceIDs

        public List<int> GetBrokenResourceIDs(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return null;
            }

            if (!fileInfo.Exists)
            {
                return null;
            }

            List<int> brokenResourceIDs = new List<int>();

            Document.Document document = Host.XMLRead<Document.Document>(Host.GetFileInfo(resource).FullName);
            if (document != null)
            {
                foreach (Document.Item item in document.Items)
                {
                    if (Host.GetResource(item.ResourceID) == null)
                    {
                        brokenResourceIDs.Add(item.ResourceID);
                    }
                }
            }

            return brokenResourceIDs;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:29,代码来源:Dependencies.cs


示例6: UpdateDependencies

        public void UpdateDependencies(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return;
            }

            if (!fileInfo.Exists)
            {
                return;
            }

            if (!IsResourceSupported(resource))
            {
                return;
            }

            List<PhactoryHost.Database.Resource> dependentResources = new List<PhactoryHost.Database.Resource>();

            Document.Document document = Host.XMLRead<Document.Document>(Host.GetFileInfo(resource).FullName);
            if (document is Document.Document)
            {
                foreach (Document.Item item in document.Items)
                {
                    PhactoryHost.Database.Resource depResource = Host.GetResource(item.ResourceID);
                    if ( (depResource!=null) && (resource.Id != depResource.Id) )
                    {
                        dependentResources.Add(depResource);
                    }
                }
            }

            Host.RefreshDependencies(resource, dependentResources);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:35,代码来源:Dependencies.cs


示例7: Run

        public bool Run(PhactoryHost.Database.Resource resource)
        {
            PhactoryHost.Database.Resource parentResource = Host.GetResource(resource.IdDependencies[0]);

            Document.Document document = Host.XMLRead<Document.Document>(Host.GetFileInfo(parentResource).FullName);

            string fileToExecute = "";
            foreach (Document.Item item in document.Items)
            {
                if (item.ExecAdress != 0)
                {
                    fileToExecute = item.AmsdosFilename;
                }
            }

            string DSKFilename = Host.GetFileInfo(resource).FullName;
            DSKFilename = DSKFilename.Replace(".cpcdsk", ".dsk");

            FileInfo DSKFileInfo = new FileInfo(DSKFilename);

            string WinAPEFullPath = Host.GetPluginsPath() + "WinAPE.exe";

            string arguments = "\"" + DSKFileInfo.FullName + "\" /A";

            if (Host.IsVerboseOutput())
            {
                Host.Log(WinAPEFullPath + " " + arguments);
            }

            return Host.StartAndWaitAfterProcess(WinAPEFullPath, arguments, DSKFileInfo.DirectoryName);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:31,代码来源:Runner.cs


示例8: CheckIfResourceCanBeRemoved

        public static bool CheckIfResourceCanBeRemoved(PhactoryHost.Database.Resource resource)
        {
            if (resource.IsOutputResource)
            {
                string errorMessage = "Can not remove '" + resource.DisplayName + "' because it's an output resource";

                App.Controller.Log.Append(errorMessage);
                App.Controller.View.ShowErrorMessage("Can't remove resource", errorMessage);

                return false;
            }

            List<PhactoryHost.Database.Resource> resourceDependencies = GetDependentResources(resource);
            if (resourceDependencies.Count != 0)
            {
                string errorMessage = "Can not remove '" + resource.DisplayName + "' because it's referenced by :\n";
                errorMessage += "\n";
                foreach (PhactoryHost.Database.Resource res in resourceDependencies)
                {
                    errorMessage += "'" + res.DisplayName + "'\n";
                }

                App.Controller.Log.Append(errorMessage);
                App.Controller.View.ShowErrorMessage("Can't remove resource", errorMessage);

                return false;
            }

            return true;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:30,代码来源:DBHelper.cs


示例9: RefreshOutput

        public void RefreshOutput(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return;
            }

            if (!fileInfo.Exists)
            {
                return;
            }

            if (!IsResourceSupported(resource))
            {
                return;
            }

            if ( (fileInfo.Extension.ToLower() != ".c") && (fileInfo.Extension.ToLower() != ".asm"))
            {
                // only compiles .ASM and .C files (ignore .H)
                return;
            }

            List<string> outputFilenames = new List<string>();

            if (fileInfo.Extension.ToLower() == ".c")
            {
                // check that .c file is not an include from an other .c file
                // (in that case, skip compile)
                foreach (PhactoryHost.Database.Resource resourceDependency in Host.GetDependencyResources(resource))
                {
                    FileInfo parentFileInfo = Host.GetFileInfo(resourceDependency);
                    if (parentFileInfo.Extension.ToLower() == ".c")
                    {
                        return;
                    }
                }

                string outputFilename = fileInfo.Name;
                outputFilename = outputFilename.Replace(".c", ".asm");
                outputFilename = outputFilename.Replace(".C", ".ASM");

                outputFilenames.Add(outputFilename);
            }

            if (fileInfo.Extension.ToLower() == ".asm")
            {
                string outputFilename = fileInfo.Name;
                outputFilename = outputFilename.Replace(".asm", ".bin");
                outputFilename = outputFilename.Replace(".ASM", ".BIN");

                outputFilenames.Add(outputFilename);
            }

            Host.RefreshOutput(resource, outputFilenames);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:57,代码来源:Output.cs


示例10: Compile

        public bool Compile(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return false;
            }

            if (!IsResourceSupported(resource))
            {
                return false;
            }

            List<String> resourceFilenames = new List<String>();
            List<String> paddingFilenames = new List<String>();
            List<int> address = new List<int>();

            Document.Document document = Host.XMLRead<Document.Document>(Host.GetFileInfo(resource).FullName);
            if ( document == null )
            {
                return false;
            }

            document.Expand();

            foreach (Document.File file in document.Files)
            {
                PhactoryHost.Database.Resource iResource = Host.GetResource( file.ResourceID );
                if (iResource == null)
                {
                    Host.Log("Unknown resource identifier : " + file.ResourceID);
                    return false;
                }

                FileInfo iFileInfo = Host.GetFileInfo( iResource );

                resourceFilenames.Add(iFileInfo.FullName);
                paddingFilenames.Add(file.Pad256 ? "true" : "false");
                address.Add((file.SetAddress==false)?0:file.Address);
            }

            var compiler = new Phactory.Modules.BigFile.Compiler.BigFileCompiler();

            string resourceRelativePathNoExt = resource.RelativePath;
            resourceRelativePathNoExt = resourceRelativePathNoExt.Replace(".cpcbigfile", "");

            App.Controller.View.AppDoEvents();

            string baseFilename = Host.MakeFullPath(resourceRelativePathNoExt);
            string headerFilename = Host.MakeFullPath(resourceRelativePathNoExt + ".H");
            if (!compiler.Compile(baseFilename, headerFilename, resourceFilenames, paddingFilenames, address, document.TruncateFiles, document.FilesInBank, document.BaseAddress))
            {
                return false;
            }

            return true;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:57,代码来源:Compiler.cs


示例11: CloseResource

        public bool CloseResource(PhactoryHost.Database.Resource resource)
        {
            if (viewBinding.ContainsKey(resource))
            {
                viewBinding.Remove(resource);
            }

            return true;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:9,代码来源:Editor.cs


示例12: View

        public View(PhactoryHost.Database.Resource resource)
        {
            InitializeComponent();

            Resource = resource;
            modified = false;

            this.textEditorControl.ActiveTextAreaControl.TextArea.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextEditor_KeyDown);
            this.textEditorControl.TextChanged += new EventHandler(TextEditor_TextChanged);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:10,代码来源:View.cs


示例13: View

        public View(PhactoryHost.Database.Resource resource)
        {
            InitializeComponent();

            Resource = resource;
            modified = false;

            lvFiles.Clear();
            lvFiles.Columns.Add("Filename", 200);
            lvFiles.Columns.Add("Size", 100);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:11,代码来源:View.cs


示例14: GetLocalSourceDependencies

        private void GetLocalSourceDependencies(PhactoryHost.Database.Resource resource, List<PhactoryHost.Database.Resource> dependentResources, string patternSearch)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return;
            }
            if (!fileInfo.Exists)
            {
                return;
            }

            string fileContent = File.ReadAllText(fileInfo.FullName);

            int startIndex = 0;
            while (startIndex != -1)
            {
                int newStartIndex = fileContent.IndexOf(patternSearch, startIndex, StringComparison.OrdinalIgnoreCase);

                startIndex = newStartIndex;

                if (startIndex != -1)
                {
                    int indexEndLine = fileContent.IndexOf("\n", startIndex);
                    int indexFirstQuote = fileContent.IndexOf("\"", startIndex + patternSearch.Length);
                    int indexSecondQuote = fileContent.IndexOf("\"", indexFirstQuote + 1);

                    if ((indexEndLine == -1) || (indexFirstQuote == -1) || (indexSecondQuote == -1))
                    {
                        startIndex = -1;
                    }
                    else
                    {
                        string path = fileContent.Substring(indexFirstQuote + 1, indexSecondQuote - indexFirstQuote - 1);

                        FileInfo fileInfoDependency = new FileInfo(path);
                        if (!fileInfoDependency.Exists)
                        {
                            fileInfoDependency = new FileInfo(fileInfo.DirectoryName + "\\" + path);
                        }

                        PhactoryHost.Database.Resource depResource = Host.GuessResource(fileInfoDependency);
                        if ((depResource != null) && (resource != depResource))
                        {
                            dependentResources.Add(depResource);
                        }

                        startIndex = indexEndLine;
                    }
                }
            }
        }
开发者ID:rgiot,项目名称:phactory,代码行数:52,代码来源:Dependencies.cs


示例15: View

        public View(PhactoryHost.Host host)
            : this()
        {
            _host = host;

            Mode0LeftPixel.Text = "0";
            Mode0RightPixel.Text = "0";

            Mode1Pixel0.Text = "0";
            Mode1Pixel1.Text = "0";
            Mode1Pixel2.Text = "0";
            Mode1Pixel3.Text = "0";
        }
开发者ID:rgiot,项目名称:phactory,代码行数:13,代码来源:View.cs


示例16: View

        public View(PhactoryHost.Database.Resource resource)
        {
            InitializeComponent();

            Resource = resource;
            modified = false;

            lvFiles.Clear();
            lvFiles.Columns.Add("Filename", 200);
            lvFiles.Columns.Add("Address", 50);
            lvFiles.Columns.Add("Length", 50);
            lvFiles.Columns.Add("Length (Hex)", 80);
            lvFiles.Columns.Add("Is External From", 200);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:14,代码来源:View.cs


示例17: UpdateDependencies

        public void UpdateDependencies(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return;
            }

            if (!IsResourceSupported(resource))
            {
                return;
            }

            GetDependenciesRecursive(resource);
        }
开发者ID:rgiot,项目名称:phactory,代码行数:15,代码来源:Dependencies.cs


示例18: Compile

        public bool Compile(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return false;
            }

            if (!IsResourceSupported(resource))
            {
                return false;
            }

            var compiler = new Phactory.Modules.Cloud.Compiler.CloudCompiler();

            Document.Document tempDocument = Host.XMLRead<Document.Document>(Host.GetFileInfo(resource).FullName);
            if (!tempDocument.CompileInternal())
            {
                return false;
            }

            foreach (Document.Item item in tempDocument.Items)
            {
                PhactoryHost.Database.Resource resItem = Host.GetResource(item.ResourceID);
                if (resItem == null)
                {
                    Host.Log("Unknown resource identifier : " + item.ResourceID);
                    return false;
                }

                FileInfo resFileInfo = Host.GetFileInfo(resItem);
                string outputFilename = resFileInfo.FullName;

                if (Host.IsVerboseOutput())
                {
                    Host.Log(outputFilename);
                }

                string outputFilenameBin = outputFilename + ".bin";

                if (!compiler.WriteCloudBitmap(outputFilenameBin, item.CloudMaskData, item.CloudMaskWidth, item.CloudMaskHeight ))
                {
                    return false;
                }
            }

            return true;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:48,代码来源:Compiler.cs


示例19: GetBrokenResourceIDs

        public List<int> GetBrokenResourceIDs(PhactoryHost.Database.Resource resource)
        {
            FileInfo fileInfo = Host.GetFileInfo(resource);
            if (fileInfo == null)
            {
                return null;
            }

            if (!fileInfo.Exists)
            {
                return null;
            }

            List<int> brokenResourceIDs = new List<int>();
            return brokenResourceIDs;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:16,代码来源:Dependencies.cs


示例20: GetDependentResources

        // return the list of resources using a specified resource (or its output)
        public static List<PhactoryHost.Database.Resource> GetDependentResources(PhactoryHost.Database.Resource resource)
        {
            List<PhactoryHost.Database.Resource> outDependentResources = new List<PhactoryHost.Database.Resource>();

            if (resource != null)
            {
                foreach (int outputResourceId in resource.IdOutputs)
                {
                    PhactoryHost.Database.Resource iOutputResource = App.Controller.Entities.GetResource(outputResourceId);

                    GetDependentResources(outDependentResources, iOutputResource);
                }
                GetDependentResources(outDependentResources, resource);
            }

            return outDependentResources;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:18,代码来源:DBHelper.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Phase类代码示例发布时间:2022-05-24
下一篇:
C# PgHdr类代码示例发布时间: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