示例#1
0
 public void RemovePage(FSWPage page)
 {
     lock (lock_)
     {
         LastAliveDate = DateTime.Now;
         --NbActivePage;
     }
 }
示例#2
0
 public void RegisterNewPage(FSWPage page)
 {
     lock (lock_)
     {
         LastAliveDate = DateTime.Now;
         ++NbActivePage;
     }
 }
        internal Queue <Property>?PendingChangedProperties; // only used when properties are changed before the control is added to a page

        public ControlBase(FSWPage?page = null)
        {
            Page = page;

            IsInitializing = true;
            IsRemoved      = false;
            Children_.CollectionChanged += Children_CollectionChanged;
            Extensions = new ControlExtensionsCollection(this);

            InternalInitialize(Page).Wait();
        }
示例#4
0
 public static void RegisterFSWPage(int id, FSWPage page)
 {
     lock (PageAwaitingConnections)
     {
         if (PageAwaitingConnections.ContainsKey(id))
         {
             throw new Exception("Id already exist");
         }
         PageAwaitingConnections.Add(id, page);
     }
 }
        public static (int id, string auth) RegisterFSWPage(FSWPage page, string FSWSessionId, string FSWSessionAuth, FSWComponentBase mainComponent, out string newFSWSessionId, out string newFSWSessionAuth)
        {
            Session session = null;

            // try to get an existing session

            if (!string.IsNullOrEmpty(FSWSessionId))
            {
                session = Session.GetSession(FSWSessionId, FSWSessionAuth);
            }

            // if new session OR the existing one doesn't exist anymore
            if (session == null)
            {
                session           = Session.GenerateNewSession();
                newFSWSessionId   = session.Id;
                newFSWSessionAuth = session.Auth;
            }
            else
            {
                newFSWSessionId   = null;
                newFSWSessionAuth = null;
            }

            int pageId;

            lock (TempIdLock)
                pageId = ++LatestTempID;

            page.Session       = session;
            page.PageAuth      = Guid.NewGuid().ToString();
            page.IsRegistered  = true;
            page.MainComponent = mainComponent;

            CommunicationHub.RegisterFSWPage(pageId, page);
            return(id : pageId, auth : page.PageAuth);
        }
示例#6
0
 public FSWManager(FSWPage page)
 {
     Page = page;
 }
示例#7
0
        internal override void RemoveConnection(FSWPage page)
        {
            base.RemoveConnection(page);

            OnConnectionClosed?.Invoke((T)page);
        }
示例#8
0
        internal override void AddNewConnection(FSWPage page)
        {
            base.AddNewConnection(page);

            OnNewConnection?.Invoke((T)page);
        }
示例#9
0
 internal virtual void RemoveConnection(FSWPage page)
 {
     lock (_lock)
         Pages.Remove(page);
 }
示例#10
0
 internal virtual void AddNewConnection(FSWPage page)
 {
     lock (_lock)
         Pages.AddLast(page);
 }
示例#11
0
 public static Task SendError(FSWPage page, Exception exception)
 {
     return(SendAsync_ID(page.ID, "error", exception.ToString()));
 }