Пример #1
0
        private void Rename(RenameViewModel obj)
        {
            if (obj.IsMain)
            {
                //修改的是主XAML,需要改project.json里的main对应的xaml文件,再刷新
                var relativeMainXaml = Common.MakeRelativePath(ProjectPath, obj.Dir + @"\" + obj.DstName);
                updateProjectJsonMain(relativeMainXaml);
            }

            RefreshCommand.Execute(null);
        }
Пример #2
0
        private void Rename(RenameViewModel obj)
        {
            if (obj.IsDirectory)
            {
                if (XamlPath.ContainsIgnoreCase(obj.Path + @"\"))
                {
                    XamlPath = XamlPath.Replace(obj.Path + @"\", obj.NewPath + @"\");
                    UpdateCompositeTitle();
                }
            }
            else
            {
                if (obj.Path.EqualsIgnoreCase(XamlPath))
                {
                    Title    = Path.GetFileNameWithoutExtension(obj.NewPath);
                    XamlPath = obj.NewPath;

                    UpdateCompositeTitle();
                }
            }
        }