コード例 #1
0
        public override void AfterLabelEdit(string newName)
        {
            if (newName == null)
            {
                return;
            }
            if (!FileService.CheckFileName(newName))
            {
                return;
            }

            string newFileName = Path.Combine(Path.GetDirectoryName(this.FileName), newName);

            if (!FileService.RenameFile(this.FileName, newFileName, false))
            {
                return;
            }
            solution.Save();
        }
コード例 #2
0
 public override void AfterLabelEdit(string newName)
 {
     try {
         if (solution.Name == newName)
         {
             return;
         }
         if (!FileService.CheckFileName(newName))
         {
             return;
         }
         string newFileName = Path.Combine(solution.Directory, newName + ".sln");
         if (!FileService.RenameFile(solution.FileName, newFileName, false))
         {
             return;
         }
         solution.FileName = newFileName;
         solution.Name     = newName;
     } finally {
         UpdateText();
     }
 }
コード例 #3
0
ファイル: FileScout.cs プロジェクト: kleinux/SharpDevelop
        protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            base.OnAfterLabelEdit(e);

            if (e.Label == null || !FileService.CheckFileName(e.Label))
            {
                e.CancelEdit = true;
                return;
            }

            string oldFileName = ((FileListItem)Items[e.Item]).FullName;
            string newFileName = Path.Combine(Path.GetDirectoryName(oldFileName), e.Label);

            if (FileService.RenameFile(oldFileName, newFileName, false))
            {
                ((FileListItem)Items[e.Item]).FullName = newFileName;
            }
            else
            {
                e.CancelEdit = true;
            }
        }