Esempio n. 1
0
        public void BrowserFileCode(object tagobject)                   //打开文件查看代码
        {
            Module.M_DomBase basedom = (tagobject as Module.M_DomBase); //获取对象的基类,用统一的方法获取其他实例的方法
            if (basedom == null)
            {
                return;
            }

            FileStream filestream = File.OpenRead(basedom.GetDomFilePath());

            byte[] codebyte = new byte[filestream.Length];

            filestream.Read(codebyte, 0, codebyte.Length);

            StringBuilder codebuilder = new StringBuilder();

            codebuilder.Append(Encoding.UTF8.GetString(codebyte));

            FrmCodePage code = new FrmCodePage(filestream.Name, codebuilder.ToString());

            filestream.Close();
            filestream.Dispose();

            BrowserFileCodeFrmEvent(code);
        }
Esempio n. 2
0
 public void OpenFileDir(object nodeobject)
 {
     Module.M_DomBase basedom = (nodeobject as Module.M_DomBase);
     if (basedom == null)
     {
         return;
     }
     System.Diagnostics.Process.Start(Path.GetDirectoryName(basedom.FilePath));
 }