示例#1
0
        internal VirtualWorkspace OpenVWDocument(VirtualWorkspace toBeOpened)
        {
            if (toBeOpened.VWCoordinate != null && toBeOpened != this)
            {
                throw new InvalidOperationException("The VW to be opened isn't a valid target.");
            }

            if (toBeOpened == this)
            {
                OpenedVWTrace.Clear();
                return(this);
            }

            if (OpenedVWTrace.Contains(toBeOpened))
            {
                int index = OpenedVWTrace.IndexOf(toBeOpened);
                if (index + 1 < OpenedVWTrace.Count)
                {
                    OpenedVWTrace.RemoveRange(index + 1, OpenedVWTrace.Count - 1 - index);
                }
                return(OpenedVWTrace[index]);
            }
            else
            {
                OpenedVWTrace.Add(toBeOpened);
                return(toBeOpened);
            }
        }
示例#2
0
        public Home(string location)
        {
            Location            = location;
            DocumentGUIDCounter = 0;
            _bLocked            = false;

            _Documents         = new List <Document>();
            _VirtualWorkspaces = new List <VirtualWorkspace>();
            _ForgottenUniverse = new List <Document>();
            _VoidUniverse      = new List <Document>();
            _LinkUniverse      = new List <Document>();

            _ClueManager = new ClueManager();
            _ActiveVW    = new VirtualWorkspace(new Coordinate(0, 0));
            _VirtualWorkspaces.Add(_ActiveVW);
        }
示例#3
0
 internal void SetVW(VirtualWorkspace vw)
 {
     _VW = vw;
 }
示例#4
0
 public const string DefaultWorkspaceSubject = "My Workspace";   // https://stackoverflow.com/questions/55984/what-is-the-difference-between-const-and-readonly
 public VirtualWorkspace(Coordinate?location = null, string name = DefaultWorkspaceSubject, string path = null, string creationdate = null)
     : this(DocumentType.VirtualWorkspace, path,
            (name == DefaultWorkspaceSubject? VirtualWorkspace.GetRandomWorkspaceName() : name),
            creationdate == null ? SystemHelper.CurrentTimeFileNameFriendly : creationdate, location)
 {
 }