Ejemplo n.º 1
0
 public static State Ok(ShortcutItem item, Project project, string title, string msg, Action <State> fix = null)
 {
     return(new State
     {
         Item = item,
         Project = project,
         Color = colorOk,
         Status = "OK",
         Title = title,
         Msg = msg,
         Fix = fix
     });
 }
Ejemplo n.º 2
0
 public static State Error(ShortcutItem item, Project project, string title, string msg, bool isEmailErr = false, Action <State> fix = null, string author = null)
 {
     return(new State
     {
         Project = project,
         Item = item,
         Color = colorErr,
         Status = "Error",
         Msg = msg,
         Title = title,
         IsEmailErr = isEmailErr,
         Fix = fix,
         Author = author ?? item?.Author
     });
 }
Ejemplo n.º 3
0
        private void ShortcutChanged(FileSystemEventArgs e)
        {
            var item = new ShortcutItem(new FileInfo(e.FullPath));

            if (item.XmlFileName != XmlFileName)
            {
                var msg = $"Переименован файл '{XmlFileName}' -> '{item.XmlFileName}'.";
                Events.Add(msg);
                Background = MainVM.eventBackground;
                MainVM.Notify.ShowWarning($"{msg} {Project.Name}.");
                XmlFile     = item.XmlFile;
                XmlFileName = item.XmlFileName;
            }

            if (item.Name != Name)
            {
                var msg = $"Переименован ключ '{Name}' -> '{item.Name}'.";
                Events.Add(msg);
                Background = MainVM.eventBackground;
                MainVM.Notify.ShowWarning($"{msg} {Project.Name}.");
                Name = item.Name;
            }

            if (item.ElementName != ElementName)
            {
                var msg = $"Переименован объект '{ElementName}' -> '{item.ElementName}'.";
                Events.Add(msg);
                Background = MainVM.eventBackground;
                MainVM.Notify.ShowWarning($"{msg} {Project.Name}.");
            }

            if (item.SourceDwg != SourceDwg)
            {
                var msg = $"Переименован источник '{SourceDwg}' -> '{item.SourceDwg}'.";
                Events.Add(msg);
                Background = MainVM.eventBackground;
                MainVM.Notify.ShowWarning($"{msg} {Project.Name}.");
            }
        }