Exemplo n.º 1
0
        public bool Save(string targetLocation)
        {
            if (!SysUtil.InTheSameDrive(GState.AssetRoot, targetLocation))
            {
                Logging.Instance.Log("将要保存的 {0} 文件与资源路径不在同一个分区,无法使用相对路径。", ConstDefault.LayoutPostfix);
                Logging.Instance.Log("    请将 {0} 文件保存到分区 {1}。", ConstDefault.LayoutPostfix, Path.GetPathRoot(GState.AssetRoot));
                Logging.Instance.Log("    目标路径:{0}", targetLocation);
                Logging.Instance.Log("    资源路径:{1}", GState.AssetRoot);
                return(false);
            }

            string folderPath = Path.GetDirectoryName(targetLocation);

            m_root.Assets.AssetRoot = SysUtil.ToUnixPath(SysUtil.GetRelativePath(GState.AssetRoot, folderPath));

            if (!m_archiveSys.Save(m_root, targetLocation))
            {
                m_root.Assets.AssetRoot = GState.AssetRoot;
                return(false);
            }

            if (m_currentFilePath != targetLocation)
            {
                m_currentFilePath = targetLocation;
            }
            return(true);
        }
Exemplo n.º 2
0
        private void Tile_Clicked(object sender, EventArgs e)
        {
            MetroTileItem ti = sender as MetroTileItem;

            if (ti == null)
            {
                return;
            }

            ti.Checked = true;
            if (m_selectedTile != null)
            {
                m_selectedTile.Checked = false;
            }

            m_selectedTile  = ti;
            m_selectedAsset = SysUtil.GetRelativePath((string)ti.Tag, m_assetRoot);
            SysPost.InvokeMulticast(this, AssetSelected);
        }