Esempio n. 1
0
 private static bool QuerySavePathNamesUniq(EDOUnitVM unit, string filter, bool askPathName, List <string> usingPathNames)
 {
     while (true)
     {
         if (!QuerySavePathName(unit, STUDYUNIT_FILTER, askPathName))
         {
             return(false);
         }
         if (usingPathNames.Contains(unit.PathName))
         {
             MessageBox.Show(SAMEPATHNAMEERROR);
             unit.PathName = null;
             continue;
         }
         usingPathNames.Add(unit.PathName);
         break;
     }
     return(true);
 }
Esempio n. 2
0
        private static readonly string SAMEPATHNAMEERROR = Resources.UsedFileNameAndInput; //This file name is already used by another study file. Specify a different file name.

        private static bool QuerySavePathName(EDOUnitVM unit, string filter, bool askPathName)
        {
            if (unit == null)
            {
                return(false);
            }
            if (string.IsNullOrEmpty(unit.PathName) || askPathName)
            {
                //display a dialog if the flag to query the path name or null is specified in the path field
                //(In the case of "Save As" it is called with askPathName=true)
                string title = string.Format(Resources.PleaseSave, unit.Title);
                string path  = IOUtils.QuerySavePathName(title, unit.PathName, filter, askPathName); //Please save ...
                if (string.IsNullOrEmpty(path))
                {
                    return(false);
                }
                unit.PathName = path;
            }
            return(true);
        }
Esempio n. 3
0
 public WriteError(string message, EDOUnitVM edoUnit, FormVM form)
 {
     Message = message;
     EDOUnit = edoUnit;
     Form    = form;
 }
Esempio n. 4
0
 public FormVM(EDOUnitVM edoUnit)
     : base(edoUnit)
 {
     state = null;
 }