Example #1
0
 public void RemovePage(FSWPage page)
 {
     lock (lock_)
     {
         LastAliveDate = DateTime.Now;
         --NbActivePage;
     }
 }
Example #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();
        }
Example #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);
        }
Example #6
0
 public FSWManager(FSWPage page)
 {
     Page = page;
 }
Example #7
0
        internal override void RemoveConnection(FSWPage page)
        {
            base.RemoveConnection(page);

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

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