public async Task <AppLink> DeleteAsync(AppLink appLink)
        {
            context.AppLink.Remove(appLink);
            await context.SaveChangesAsync();

            return(appLink);
        }
        public async Task <AppLink> UpdateAsync(AppLink appLink)
        {
            context.Update(appLink);
            await context.SaveChangesAsync();

            return(appLink);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        public void Initialize()
        {
            WriteTrace("Initialize");
            IsInitialized = false;
            m_serverurl   = ConfigHandler.Engine != null? ConfigHandler.Engine.TcpUrl:string.Empty;
            WriteTrace("Initialize m_serverurl->" + m_serverurl);
            if (File.Exists(ConfigHandler.AppSettings.Settings["scorebugscenepath"].Value))
            {
                m_scorebugscenepath = ConfigHandler.AppSettings.Settings["scorebugscenepath"].Value;
            }
            else if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "ScoreBug.w3d")))
            {
                m_scorebugscenepath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "ScoreBug.w3d");
            }

            if (!string.IsNullOrEmpty(m_scorebugscenepath) && !string.IsNullOrEmpty(m_serverurl))
            {
                WriteTrace("!string.IsNullOrEmpty(m_scorebugscenepath) && !string.IsNullOrEmpty(m_serverurl)");
                string      sLinkID        = string.Empty;
                LinkManager objLinkManager = new LinkManager();
                AppLink = objLinkManager.GetLink(LINKTYPE.TCP, out sLinkID);
                AppLink.OnEngineConnected += new EventHandler <EngineArgs>(objLink_OnEngineConnected);
                AppLink.Connect(m_serverurl);
                objLinkManager.OnEngineDisConnected += objLinkManager_OnEngineDisConnected;
            }
        }
        public async Task <AppLink> AddAsync(AppLink appLink)
        {
            context.Add(appLink);
            await context.SaveChangesAsync();

            return(appLink);
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        public void Initialize()
        {
            isInitialized = false;
            if (File.Exists(ConfigurationManager.AppSettings["scorebugscenepath"]))
            {
                m_scorebugscenepath = ConfigurationManager.AppSettings["scorebugscenepath"];
            }
            else if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Score Bug.wsl")))
            {
                m_scorebugscenepath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Score Bug.wsl");
            }

            if (!string.IsNullOrEmpty(m_scorebugscenepath))
            {
                if (ConfigurationManager.AppSettings["stingserverip"] != null)
                {
                    string sLinkID = string.Empty;
                    _objLinkManager            = new LinkManager();
                    AppLink                    = _objLinkManager.GetLink(LINKTYPE.TCP, out sLinkID);
                    AppLink.OnEngineConnected += new EventHandler <EngineArgs>(_objLink_OnEngineConnected);
                    AppLink.Connect(m_serverip);
                    _objLinkManager.OnEngineDisConnected += _objLinkManager_OnEngineDisConnected;
                }
            }
        }
 public OktaAppLink(AppLink input)
 {
     appName = input.AppName;
     label   = input.Label;
     linkUrl = input.LinkUrl;
     logoUrl = input.LogoUrl;
 }
Example #7
0
 public void Dispose()
 {
     if (objBGPlayer != null)
     {
         objBGPlayer.OnShotBoxStatus           -= objPlayer1_OnShotBoxStatus;
         objBGPlayer.OnShotBoxControllerStatus -= objPlayer1_OnShotBoxStatus;
         objBGPlayer.Dispose();
         objBGPlayer = null;
     }
     if (objScorePlayer != null)
     {
         objScorePlayer.OnShotBoxStatus           -= objPlayer1_OnShotBoxStatus;
         objScorePlayer.OnShotBoxControllerStatus -= objPlayer1_OnShotBoxStatus;
         objScorePlayer.Dispose();
         objScorePlayer = null;
     }
     if (AppLink != null)
     {
         AppLink.Dispose();
         AppLink = null;
     }
     if (FileHandler != null)
     {
         FileHandler.Dispose();
         FileHandler = null;
     }
 }
Example #8
0
        /// <summary>
        ///
        /// </summary>
        public void LoadScene()
        {
            string sXml       = string.Empty;
            string sShotBoxID = null;
            bool   isTicker;

            WriteTrace("LoadScene");
            sXml = Util.getSGFromWSL(m_scorebugscenepath);
            string filetype = Path.GetExtension(m_scorebugscenepath).Split(new string[] { "." }, StringSplitOptions.None)[1];

            if (!string.IsNullOrEmpty(sXml))
            {
                objScorePlayer = AppLink.GetShotBox(sXml, out sShotBoxID, out isTicker) as ShotBox;
                if (!Equals(objScorePlayer, null))
                {
                    objScorePlayer.SetEngineUrl(m_serverurl);

                    InstanceInfo o = new InstanceInfo()
                    {
                        Type = filetype, InstanceId = m_scorebugscenepath, TemplateId = string.Empty, ThemeId = "default"
                    };

                    if (objScorePlayer is IAddinInfo)
                    {
                        (objScorePlayer as IAddinInfo).Init(o);
                    }

                    objScorePlayer.OnShotBoxStatus           += objPlayer1_OnShotBoxStatus;
                    objScorePlayer.OnShotBoxControllerStatus += objPlayer1_OnShotBoxStatus;
                    objScorePlayer.Prepare(m_serverurl, 0, RENDERMODE.PROGRAM);
                }//end (if)
            }
        }
Example #9
0
        public async Task <IActionResult> Create([Bind("IconName,DisplayName,Uri,AccessLevel,Priority")] AppLink appLink)
        {
            if (ModelState.IsValid)
            {
                await appLinkRepository.AddAsync(appLink);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(appLink));
        }
Example #10
0
 /// <summary>
 /// added for template loading
 /// </summary>
 public void Init()
 {
     try
     {
         _objLinkManager = new LinkManager();
         string sLinkID = string.Empty;
         AppLink = _objLinkManager.GetLink(LINKTYPE.TCP, out sLinkID);
         AppLink.OnEngineConnected += new EventHandler <EngineArgs>(_objLink_OnEngineConnected);
         AppLink.Connect(m_serverip);
     }
     catch (Exception ex)
     {
     }
 }
Example #11
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,IconName,DisplayName,Uri,AccessLevel,Priority")] AppLink appLink)
        {
            if (id != appLink.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                await appLinkRepository.UpdateAsync(appLink);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(appLink));
        }
Example #12
0
        /// <summary>
        ///
        /// </summary>
        public void LoadScene()
        {
            string stemplateID = string.Empty;
            string sXml        = string.Empty;
            string sDataXml    = "<dgn><data></data></dgn>";
            string sShotBoxID  = null;
            bool   isTicker;

            sXml = Util.getSGFromWSL(m_scorebugscenepath);
            string filetype = Path.GetExtension(m_scorebugscenepath).Split(new string[] { "." }, StringSplitOptions.None)[1];

            if (!string.IsNullOrEmpty(sXml))
            {
                m_objBugPlayer = AppLink.GetShotBox(sXml, out sShotBoxID, out isTicker) as ShotBox;
                if (!Equals(m_objBugPlayer, null))
                {
                    m_objBugPlayer.SetEngineUrl(m_serverip);

                    InstanceInfo o = new InstanceInfo()
                    {
                        Type = filetype, InstanceId = string.Empty, TemplateId = m_scorebugscenepath, ThemeId = "default"
                    };

                    if (m_objBugPlayer is IAddinInfo)
                    {
                        (m_objBugPlayer as IAddinInfo).Init(o);
                    }

                    //if (m_objBugPlayer == null)
                    //{
                    //m_objBugPlayer = new Beesys.Wasp.Workflow.Player();
                    //m_objBugPlayer.SetLink(_objLink, sXml);
                    //m_objBugPlayer.Prepare(m_serverip, 0, RENDERMODE.PROGRAM);
                    //}


                    m_objBugPlayer.OnShotBoxStatus           += _objPlayer1_OnShotBoxStatus;
                    m_objBugPlayer.OnShotBoxControllerStatus += _objPlayer1_OnShotBoxControllerStatus;
                    m_objBugPlayer.Prepare(m_serverip, 0, RENDERMODE.PROGRAM);
                }//end (if)
            }
        }
 private void AppLinkObtainedEvent(AppLink appLink)
 {
     // do something with applink
     int x = 10;
 }