コード例 #1
0
 private void SetInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #2
0
        public static void DeleteProject(string projectId)
        {
            CheckForInitAndLoginSDK();

            Project project = GetProjectById(projectId);

            string keyPromt = project.DataTable.Cells.Any()
                ? string.Format("with keys : '{0}'", string.Join(", ", project.DataTable.Cells.Select(c => c.ClientMetadata.Label)))
                : "witout keys";

            string prompt =
                string.Format(
                    "You are going to delete project: '{0}'{2}{1},{2}Please note that this action cannot be undone. you will lose all your data associated with this project. Press 'Y' to confirm."
                    , project.Name
                    , keyPromt
                    , Environment.NewLine);

            if (PromptManager.ShowPrompt(prompt))
            {
                if (SDK.CurrentUser.DeleteProject(projectId))
                {
                    Console.WriteLine("Project '{0}' has been deleted", projectId);
                }
                else
                {
                    Console.WriteLine("Project '{0}' was not deleted", projectId);
                }
            }
        }
コード例 #3
0
        public static void DeleteKey(string projectId, string keyId)
        {
            CheckForInitAndLoginSDK();

            Project project = GetProjectById(projectId);

            CellInfo key = project.DataTable.Cells.FirstOrDefault(c => c.CellId == keyId);

            if (key == null)
            {
                throw new Exception(string.Format("Key by id: '{0}' not found.", keyId));
            }

            string prompt =
                string.Format(
                    "You actually want delete key by label: '{0}'{1}(you won't be able recovery infomation after this procedure)"
                    , key.ClientMetadata.Label
                    , Environment.NewLine);

            if (PromptManager.ShowPrompt(prompt))
            {
                key = project.DataTable.DeleteCell(keyId);
                Console.WriteLine("Key '{0}' by label: '{1}' has been deleted", key.CellId, key.ClientMetadata.Label);
            }
        }
コード例 #4
0
        /// <summary>
        /// Constructs a new instance of the InfoCollectionDialog class
        /// </summary>
        /// <param name="dialogId">dialog id</param>
        public UserInputDialog(PromptManager <TContext> promptManager)
            : base($"UserInput_{typeof(TContext).Name}")
        {
            // Set prompt Manager
            if (promptManager == null)
            {
                throw new ArgumentNullException(nameof(promptManager));
            }

            this.promptManager = promptManager;

            // Add dialogs required by prompt
            this.AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            this.promptManager.Dialogs.ToList().ForEach(p => this.AddDialog(p));

            // Add waterfall dialog and steps for user input collection as well as confirm step and final step
            var waterfallSteps = new List <WaterfallStep>();

            waterfallSteps.AddRange(this.promptManager.WaterfallSteps);
            waterfallSteps.Add(this.ConfirmStepAsync);
            waterfallSteps.Add(this.FinalStepAsync);
            this.AddDialog(new WaterfallDialog(nameof(WaterfallDialog), waterfallSteps));

            // Set the initial child Dialog to run to be the waterfall dialog
            this.InitialDialogId = nameof(WaterfallDialog);
        }
コード例 #5
0
    private void Start()
    {
        initializePoolWhenPlayerItemPrefabIsLoaded = false;
        profileDataList    = new List <ProfileData>();
        membershipDataList = new List <MembershipData>();
        pooledScrollRect   = GetComponentInChildren <VerticalGridPooledScrollRect>();
        addPooledScrollRectObservers();
        playerAvatarRenderer = GetComponent <AvatarImageComponent>();
        AvatarImageComponent avatarImageComponent = playerAvatarRenderer;

        avatarImageComponent.OnImageReady = (Action <DataEntityHandle, Texture2D>)Delegate.Combine(avatarImageComponent.OnImageReady, new Action <DataEntityHandle, Texture2D>(onImageReady));
        initPlayersList();
        dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <ProfileData> >(onProfileDataAdded);
        dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <MembershipData> >(onMembershipDataAdded);
        PromptManager promptManager = Service.Get <PromptManager>();

        promptManager.PromptCreated = (Action <GameObject>)Delegate.Combine(promptManager.PromptCreated, new Action <GameObject>(onPromptCreated));
        List <string> playerSwids = getPlayerSwids();

        if (playerSwids.Count > 0)
        {
            Service.Get <INetworkServicesManager>().PlayerStateService.GetOnlinePlayersBySwids(playerSwids);
        }
        else
        {
            onlineStatusReceived = true;
        }
        Content.LoadAsync(onPlayerItemPrefabLoaded, PlayerItemContentKey);
        start();
        isInitialized = true;
    }
コード例 #6
0
    private void OnDestroy()
    {
        if (playerAvatarRenderer != null)
        {
            AvatarImageComponent avatarImageComponent = playerAvatarRenderer;
            avatarImageComponent.OnImageReady = (Action <DataEntityHandle, Texture2D>)Delegate.Remove(avatarImageComponent.OnImageReady, new Action <DataEntityHandle, Texture2D>(onImageReady));
        }
        if (dataEntityCollection != null)
        {
            dataEntityCollection.EventDispatcher.RemoveListener <DataEntityEvents.ComponentAddedEvent <ProfileData> >(onProfileDataAdded);
        }
        if (profileDataList != null)
        {
            for (int i = 0; i < profileDataList.Count; i++)
            {
                profileDataList[i].ProfileDataUpdated -= onProfileDataUpdated;
            }
        }
        if (membershipDataList != null)
        {
            for (int i = 0; i < membershipDataList.Count; i++)
            {
                membershipDataList[i].MembershipDataUpdated -= onMembershipDataUpdated;
            }
        }
        removePooledScrollRectObservers();
        PromptManager promptManager = Service.Get <PromptManager>();

        promptManager.PromptCreated = (Action <GameObject>)Delegate.Remove(promptManager.PromptCreated, new Action <GameObject>(onPromptCreated));
        onDestroy();
    }
コード例 #7
0
 public ErrorService()
 {
     connectionManager     = Service.Get <ConnectionManager>();
     gameStateController   = Service.Get <GameStateController>();
     promptManager         = Service.Get <PromptManager>();
     sessionManager        = Service.Get <SessionManager>();
     dataEntityCollection  = Service.Get <CPDataEntityCollection>();
     zoneTransitionService = Service.Get <ZoneTransitionService>();
     eventDispatcher       = Service.Get <EventDispatcher>();
     eventDispatcher.AddListener <ApplicationService.Error>(onError);
     eventDispatcher.AddListener <SessionErrorEvents.AccountBannedEvent>(onAccountBannedEvent);
     eventDispatcher.AddListener <SessionErrorEvents.AuthenticationRequiresParentalConsentEvent>(onAuthenticationRequiresParentalConsentEvent);
     eventDispatcher.AddListener <SessionErrorEvents.AuthenticationRevokedEvent>(onAuthenticationRevokedEvent);
     eventDispatcher.AddListener <SessionErrorEvents.AuthenticationUnavailableEvent>(onAuthenticationUnavailableEvent);
     eventDispatcher.AddListener <SessionErrorEvents.SessionTerminated>(onSessionTerminated);
     eventDispatcher.AddListener <SessionErrorEvents.SessionDataCorrupted>(onSessionDataCorrupted);
     eventDispatcher.AddListener <SessionErrorEvents.NoNetworkOnResumeError>(onNoNetworkOnResume);
     eventDispatcher.AddListener <SessionErrorEvents.NoSessionOnResumeError>(onNoSessionOnResume);
     eventDispatcher.AddListener <SessionErrorEvents.RegistrationConfigError>(onRegistrationConfigError);
     eventDispatcher.AddListener <WorldServiceErrors.WorldDisconnectedEvent>(onWorldDisconnected);
     eventDispatcher.AddListener <WorldServiceErrors.WorldNetworkErrorEvent>(onWorldNetworkError);
     eventDispatcher.AddListener <NetworkErrors.NoConnectionError>(onNoConnectionError);
     eventDispatcher.AddListener <NetworkErrors.GeneralError>(onGeneralNetworkError);
     Service.Get <EventDispatcher>().AddListener <LoadingController.TimeoutEvent>(onLoadingScreenTimeout);
     eventDispatcher.AddListener <WorldServiceEvents.SelfRoomJoinedEvent>(onRoomJoined);
     CoroutineRunner.StartPersistent(preloadIcons(), this, "Preload error icons");
 }
コード例 #8
0
ファイル: Main.cs プロジェクト: Predatorie/FileLocker
        /// <summary> Automatic save off. </summary>
        ///
        /// <param name="param"> The parameter (optional) </param>
        ///
        /// <returns> A MCamReturn. </returns>
        public MCamReturn AutoSaveOff(int param)
        {
            try
            {
                if (!this._autoSave.Enabled)
                {
                    return(MCamReturn.NoErrors);
                }

                PromptManager.WriteString(ApplicationStrings.LockFileAutoSaveDisabled);

                this._autoSave.Stop();
                this._autoSave.Enabled = false;

                MastercamFileService.Instance.LogInformation(ApplicationStrings.LockFileAutoSaveDisabled);

                DialogManager.OK(ApplicationStrings.LockFileAutoSaveDisabled, ApplicationStrings.Title);
            }
            finally
            {
                PromptManager.Clear();
            }

            return(MCamReturn.NoErrors);
        }
コード例 #9
0
ファイル: Main.cs プロジェクト: Predatorie/FileLocker
        /// <summary> Automatic save on. </summary>
        ///
        /// <param name="param"> The parameter (optional) </param>
        ///
        /// <returns> A MCamReturn. </returns>
        public MCamReturn AutoSaveOn(int param)
        {
            try
            {
                if (this._autoSave.Enabled)
                {
                    DialogManager.OK(ApplicationStrings.AutoSaveIsEnabled, ApplicationStrings.Title);
                    return(MCamReturn.NoErrors);
                }

                PromptManager.WriteString(ApplicationStrings.LockFileAutoSaveEnabled);

                this._autoSave.Interval = Properties.Settings.Default.Interval * 60000;
                this._autoSave.Enabled  = true;
                this._autoSave.Start();

                MastercamFileService.Instance.LogInformation(ApplicationStrings.LockFileAutoSaveEnabled);

                DialogManager.OK(ApplicationStrings.LockFileAutoSaveEnabled, ApplicationStrings.Title);
            }
            finally
            {
                PromptManager.Clear();
            }

            return(MCamReturn.NoErrors);
        }
コード例 #10
0
ファイル: PromptWindow.cs プロジェクト: anorman728/Ant
 public PromptWindow(int numOfFields, WriteFile inputWriteFileObj, PromptManager inputPromptManager)
 {
     InitializeComponent();
     System.Media.SystemSounds.Beep.Play();
     this.createTextBoxes(numOfFields);
     this.writeFileObj     = inputWriteFileObj;
     this.promptManagerObj = inputPromptManager;
     this.PlaceLowerRight();
 }
コード例 #11
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
     }
 }
コード例 #12
0
ファイル: Transmission.cs プロジェクト: viruscmd/GGJ2018
    void DoIdle()
    {
        float distanceToPlayer = Vector3.Distance(player.transform.position, transform.position);

        if (distanceToPlayer <= promptDistance)
        {
            currentState = States.WAITING;
            PromptManager.SetText(promptMessage);
            PromptManager.SetVisible(true);
        }
    }
コード例 #13
0
    void Awake()
    {
        instance = this;

        promptObjectScript = promptGameObject.GetComponent <PromptObject>();

        SetRandomCharacterName();
        GeneratePrompts();

        currentPrompt = promptList[Random.Range(0, promptList.Count)];
        SetPromptValues();

        StartCoroutine(AnimatePromptToCenter(animationTime));
    }
コード例 #14
0
ファイル: Transmission.cs プロジェクト: viruscmd/GGJ2018
    void DoWaiting()
    {
        float distanceToPlayer = Vector3.Distance(player.transform.position, transform.position);

        if (distanceToPlayer > promptDistance)
        {
            currentState = States.IDLE;
            PromptManager.SetVisible(false);
        }
        else if (Input.GetKeyDown(KeyCode.E))
        {
            currentState = States.INTERACTING;
            Interact(); //delete this
            PromptManager.SetVisible(false);
        }
    }
コード例 #15
0
ファイル: PromptManager.cs プロジェクト: mengtest/actdemo
    void Awake()
    {
        _Instance = this;

        DontDestroyOnLoad(gameObject);
    }
コード例 #16
0
ファイル: GameManager.cs プロジェクト: Patton97/LD45
 void Awake()
 {
     SetInstance();
     Player = FindObjectOfType <PlayerController>();
     Prompt = FindObjectOfType <PromptManager>();
 }
コード例 #17
0
 public void RefreshObject()
 {
     promptUI   = GameObject.FindObjectOfType <PromptManager>();
     languageUI = GameObject.FindGameObjectWithTag("LanguageUI");
 }
コード例 #18
0
ファイル: PromptManager.cs プロジェクト: viruscmd/GGJ2018
 void Awake()
 {
     self = this;
     SetVisible(false);
 }
コード例 #19
0
ファイル: InputPrompts.cs プロジェクト: stephaje/NomaiVR
 void Start()
 {
     _manager = Locator.GetPromptManager();
 }
コード例 #20
0
 public void OnDestory()
 {
     _instance = null;
 }