Exemple #1
0
        public static ActionLog Load(SourceSettings ss, IWarningLogger uilog)
        {
            ActionLog ld = null;

            if (uilog == null)
            {
                throw new ArgumentNullException();
            }

            string path = ss.PathToStateItem(LogName);

            if (File.Exists(path))
            {
                ld = (ActionLog)SafeFileSerializer.Load(path, uilog);
            }

            if (ld == null)
            {
                // Didn't exist or failed to recover
                ld = new ActionLog();
            }

            ld.uilog = uilog;
            return(ld);
        }
Exemple #2
0
        IGraphState GetGraph()
        {
            string gfile = ss.PathToStateItem(Graph);

            try {
                if (!File.Exists(gfile))
                {
                    RecompileNoGraph(gfile);
                }
                else
                {
                    IGraphState gs = LoadSavedGraph(gfile, true);

                    if (gs != null)
                    {
                        return(gs);
                    }
                }
            } catch (Exception e) {
                log.Error(9999, "Exception trying to recover compiled graph", e.Message);
            }

            GraphBuilder gb = GraphCompiler.Compile(ss, log);

            if (gb == null)
            {
                File.Delete(gfile);
                return(null);
            }

            BinaryGraphSerializer.Write(gb, gfile);

            return(LoadSavedGraph(gfile, false));
        }
Exemple #3
0
	public bool Save (SourceSettings ss)
	{
	    return SafeFileSerializer.Save (ss.PathToStateItem (LogName), this, uilog);
	}
Exemple #4
0
	public static ActionLog Load (SourceSettings ss, IWarningLogger uilog)
	{
	    ActionLog ld = null;

	    if (uilog == null)
		throw new ArgumentNullException ();

	    string path = ss.PathToStateItem (LogName);

	    if (File.Exists (path))
		ld = (ActionLog) SafeFileSerializer.Load (path, uilog);

	    if (ld == null)
		// Didn't exist or failed to recover
		ld = new ActionLog ();

	    ld.uilog = uilog;
	    return ld;
	}
Exemple #5
0
 public bool Save(SourceSettings ss)
 {
     return(SafeFileSerializer.Save(ss.PathToStateItem(LogName), this, uilog));
 }