public bool Load()
        {
            Tracer.Verbose("WorkspaceService.Load", "starting");
            bool result = false;

            try
            {
                Entity = new WorkspaceDAC().Load();
                if (Entity != null)
                {
                    CheckRecentFileList();
                    result = true;
                }
                else
                {
                    Entity = new WorkspaceEntity();
                }
            }
            catch (Exception error)
            {
                Tracer.Error("WorkspaceService.Load", error);
            }

            Tracer.Verbose("WorkspaceService.Load", "ending");
            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// Save the worspace data into the bin file
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool Save(WorkspaceEntity entity)
        {
            Tracer.Verbose("WorkspaceDAC.Save", "starting");

            bool result = false;

            try
            {
                result = SerializeHelper.Serialize(WorkspaceFile, entity);
            }
            catch (Exception error)
            {
                Tracer.Error("WorkspaceDAC.Save", error);
            }

            Tracer.Verbose("WorkspaceDAC.Save", "ending");
            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// Load the workspace data from the bin file
        /// </summary>
        /// <returns></returns>
        public WorkspaceEntity Load()
        {
            Tracer.Verbose("WorkspaceDAC.Load", "starting");

            WorkspaceEntity entity = null;

            try
            {
                entity = (WorkspaceEntity)SerializeHelper.Deserialize(WorkspaceFile, typeof(WorkspaceEntity));
            }
            catch (Exception error)
            {
                Tracer.Error("WorkspaceDAC.Load", error);
            }

            Tracer.Verbose("WorkspaceDAC.Load", "ending");
            return(entity);
        }
 /// <summary>
 /// Private constructor for singleton pattern
 /// </summary>
 private WorkspaceService()
 {
     Entity = new WorkspaceEntity();
 }