Ejemplo n.º 1
0
        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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Private constructor for singleton pattern
 /// </summary>
 private WorkspaceService()
 {
     Entity = new WorkspaceEntity();
 }