Beispiel #1
0
        public static void VisibleLoading(LoadingCircle loading, Boolean visibled = true)
        {
            loading.ExeInvoke(() =>
            {
                if (visibled)
                {
                    loading.SuspendLayout();

                    var parent = loading.ParentAnchor;
                    if (null != parent)
                    {
                        parent.ExeInvoke(() =>
                        {
                            var x            = parent.Location.X + parent.Width / 2 - loading.Width / 2;
                            var y            = parent.Location.Y + parent.Height / 2 - loading.Height / 2;
                            loading.Location = new Point(x, y);
                        });
                    }
                }

                loading.Visible = visibled;
                loading.Active  = visibled;

                if (visibled)
                {
                    loading.ResumeLayout();
                    loading.Refresh();
                }
            });
        }
Beispiel #2
0
        public override Control GetControl(Cell cell)
        {
            LoadingCircle circle = null;

            if (cell.Data != null && cell.Data is Color)
            {
                // Yes - we do want to show a control
                circle = new LoadingCircle();

                // We assign the event handler in this way so that when it is clicked, the event is handled
                // *directly* by the form - it doesnt get processed at all by this object (the Spinner Factory)
                if (this.ClickEventHandler != null)
                {
                    circle.Click += ClickEventHandler;
                }

                circle.SetCircleAppearance(12, 2, 5, 11);
                circle.Active = true;
                circle.Height = 12;
                circle.Width  = 12;
                circle.Color  = ((Color)cell.Data); // We've already checked the type of cell.Data above
            }

            return(circle);
        }
Beispiel #3
0
    void Start()
    {
        if (PlayerID != -1)
        {
            Players.Add(PlayerID, this);
        }

        if (!StartingPositionsSet)
        {
            if (!GameProperties.isGame2Player())
            {
                StartingPositions = new Vector3[4];
                for (int j = 0; j < startingPositions.Length; j++)
                {
                    StartingPositions[j] = startingPositions[j];
                }
                StartingPositionsSet = true;
            }
            else
            {
                StartingPositions = new Vector3[2];
                for (int j = 0; j < startingPositions2.Length; j++)
                {
                    StartingPositions[j] = startingPositions2[j];
                }
                StartingPositionsSet = true;
            }
        }
        if (isLocalPlayer)
        {
            LocalLoadingCircle = GameObject.Find("LoadingCircle").GetComponent <LoadingCircle>();
            Server.LocalPlayer = this;
            CmdReadyUp();
        }
    }
Beispiel #4
0
 internal SolrHelper(DataGridView dataGrid, Label labelSolrGrid, LoadingCircle loading, Action <string> raiseUninstall)
 {
     _dataGrid       = dataGrid;
     _labelSolrGrid  = labelSolrGrid;
     _loading        = loading;
     _raiseUninstall = raiseUninstall;
 }
Beispiel #5
0
 public FormAlbums(FacebookObjectCollection <Album> i_Albums, MRG.Controls.UI.LoadingCircle i_LoadingCircleShowMyAlbums)
 {
     r_Albums = i_Albums;
     m_LoadingCircleShowMyAlbums = i_LoadingCircleShowMyAlbums;
     InitializeComponent();
     albumBindingSource.DataSource = r_Albums;
 }
Beispiel #6
0
        public override Control UpdateControl(Cell cell, Control control)
        {
            // We either show a loading circle with the given colour, or just load an image.
            Control newControl = null;

            if (cell.Data is Color)
            {
                Color color = (Color)cell.Data;
                if (control is LoadingCircle)
                {
                    LoadingCircle lc = (LoadingCircle)control;
                    lc.Color = color;
                }
            }
            else
            {
                // We are getting rid of the control now - so remove event handlers
                if (control is LoadingCircle && this.ClickEventHandler != null)
                {
                    ((LoadingCircle)control).Click -= ClickEventHandler;
                }

                PictureBox pic = new PictureBox();
                pic.Image  = new Bitmap(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Resources\EmailRead.bmp");
                newControl = pic;
            }
            return(newControl);
        }
Beispiel #7
0
 public FormMosiftDiggingFriend(DigginFriend i_MostDiggingFriend, MRG.Controls.UI.LoadingCircle i_LoadingCircleShowMostDiggingFriend)
 {
     m_MostDiggingFriend = i_MostDiggingFriend;
     m_LoadingCircleShowMostDiggingFriend = i_LoadingCircleShowMostDiggingFriend;
     InitializeComponent();
     initializeComponent(i_MostDiggingFriend);
 }
Beispiel #8
0
    public void StartSnapPhoto()
    {
        textmesh.text             = "Verifying...";
        cameraButton.interactable = false;

        LoadingCircle.Show();

        StartCoroutine(controller.SnapPhoto(async tex =>
        {
            try
            {
                audioSource.PlayOneShot(clipCamera);

                // encode the image from the camera as a PNG to send to the Computer Vision API
                byte[] pngBuff  = tex.EncodeToPNG();
                MemoryStream ms = new MemoryStream(pngBuff);

                // call the vision service and get the image analysis
                VisionServiceClient client = new VisionServiceClient(Globals.VisionKey, Globals.VisionEndpoint);
                AnalysisResult result      = await client.DescribeAsync(ms);

                // send the tag list to the debug log
                string tags = result.Description.Tags.Aggregate((x, y) => $"{x}, {y}");
                Debug.Log(tags);

                foreach (string itemTag in Globals.CurrentItem.Tags)
                {
                    if (result.Description.Tags.Contains(itemTag.ToLower()))
                    {
                        audioSource.PlayOneShot(clipFound);
                        textmesh.text = "You found it!";

                        PlayFabEvents.WriteEvent(PlayFabEventType.ItemFound);

                        // if the image matches, call the ItemFound function to record it
                        string s = JsonConvert.SerializeObject(Globals.CurrentItem);
                        await Globals.HttpClient.PostAsync("ItemFound", new StringContent(s, Encoding.UTF8, "application/json"));
                        LoadingCircle.Dismiss();
                        SceneManager.LoadScene("ItemList");
                        return;
                    }
                }

                audioSource.PlayOneShot(clipNotFound);
                textmesh.text = "Not a match, please try again.";

                PlayFabEvents.WriteEvent(PlayFabEventType.ItemNotFound);

                controller.StartStream();
                cameraButton.interactable = true;
                LoadingCircle.Dismiss();
            }
            catch (Exception e)
            {
                LoadingCircle.Dismiss();
                Debug.Log(e);
                DialogBox.Show(e.Message);
            }
        }));
    }
Beispiel #9
0
 private void Start()
 {
     Instance      = this;
     rectComponent = GetComponent <Transform>();
     sr            = GetComponent <SpriteRenderer>();
     sr.enabled    = false;
 }
 public FormEventsList(FacebookWrapper.ObjectModel.FacebookObjectCollection <FacebookWrapper.ObjectModel.Event> i_Events, MRG.Controls.UI.LoadingCircle i_LoadingCircleShowEvents)
 {
     m_Events = i_Events;
     m_LoadingCircleShowEvents = i_LoadingCircleShowEvents;
     InitializeComponent();
     eventBindingSource.DataSource = m_Events;
 }
Beispiel #11
0
 public PopulateWithFormsRoles(Form currentForm, DataTable dt,
                               DataGridNavigation currentPaging,
                               Display firstOrLastpage,
                               LoadingCircle currentLoadingCircle,
                               ComboBox currentComboBox)
     : base(currentForm, dt, currentPaging, firstOrLastpage, currentLoadingCircle, currentComboBox)
 {
 }
Beispiel #12
0
 /// <summary>
 /// This function issues the InitiateConnection command to the holoboard controller and sets up the UI to recieve state updates
 /// </summary>
 public void Connect()
 {
     mHoloboardController.InitiateConnection();
     Button1.SetActive(false);
     Button2.SetActive(false);
     Button.SetActive(false);
     LoadingCircle.SetActive(true);
     InstructionsText.text = "Connecting..";
 }
 public PopulateWithStores(Form currentForm, DataTable dt,
                           DataGridNavigation currentPaging,
                           Display firstOrLastpage,
                           LoadingCircle currentLoadingCircle,
                           CRUDClient CRUDClient)
     : base(currentForm, dt, currentPaging, firstOrLastpage, currentLoadingCircle)
 {
     this.CRUDClient = CRUDClient;
 }
Beispiel #14
0
 public void DeleteDataAndSignOut()
 {
     LoadingCircle.SetActive(true);
     SaveSystem.DeleteUsrData();
     if (data.isFB)
     {
         loginManager.FacebookLogout();
     }
     LoadScene(0);
 }
Beispiel #15
0
        private void backgroundWorker_Ping_DoWork(object sender, DoWorkEventArgs e)
        {
            InstallationChecker checker = new InstallationChecker();

            e.Result = checker.CommunicationCheck(textBox_IP.Text);

            LoadingCircle lc = new LoadingCircle();

            lc.Active = true;
        }
Beispiel #16
0
 // Use this for initialization
 void Start()
 {
     mHoloboardController = HoloboardController.Instance;
     TroubleShootScreen.SetActive(false);
     LoadingCircle.SetActive(false);
     PairRequest.SetActive(false);
     LEDImage.enabled = false;
     Button1.SetActive(false);
     ControllerCallbacks.OnControllerStateChanged += ControllerCallbacks_OnControllerStateChanged;
 }
 public PopulateUIFromSeparateThread(Form currentForm, DataTable dt,
                                     DataGridNavigation currentPaging,
                                     Display firstOrLastPage,
                                     LoadingCircle currentLoadingCircle)
     : this(currentForm, dt)
 {
     this.paging               = currentPaging;
     this.loadingCircle        = currentLoadingCircle;
     this.loadingCircle.Active = true;
     this.firstOrLastPage      = firstOrLastPage;
 }
        public PopulateUIFromSeparateThread(Form currentForm, DataTable dt,
                                            DataGridNavigation currentPaging,
                                            Display firstOrLastPage,
                                            LoadingCircle currentLoadingCircle,
                                            ComboBox currentComboBox)
            : this(currentForm, dt, currentPaging, firstOrLastPage, currentLoadingCircle)

        {
            this.comboBox      = currentComboBox;
            this.ComboBoxItems = new List <string>();
        }
Beispiel #19
0
    public void FacebookLogin()
    {
        LoadingCircle.SetActive(true);
        isFB = true;
        var permissions = new List <string>()
        {
            "public_profile", "email"
        };

        FB.LogInWithReadPermissions(permissions, AuthCallback);
    }
Beispiel #20
0
        public static void stylizeLoadingMessage(Form formPai)
        {
            LoadingCircle loadingCircle1 = formPai.Controls.Find("loadingCircle1", true).FirstOrDefault() as LoadingCircle;
            Label         loadingText    = formPai.Controls.Find("loadingText", true).FirstOrDefault() as Label;
            Panel         centralPanel   = formPai.Controls.Find("centralPanel", true).FirstOrDefault() as Panel;


            loadingText.Font        = Styles.defaultFont;
            loadingCircle1.Location = new Point(Convert.ToInt32((centralPanel.Width / 2) - (loadingCircle1.Width / 2)), Convert.ToInt32(formPai.Height / 2 - loadingCircle1.Height / 2));
            loadingText.Location    = new Point(Convert.ToInt32((centralPanel.Width / 2) - (loadingText.Width / 2)) + 10, loadingCircle1.Location.Y - loadingText.Height - 10);
        }
Beispiel #21
0
        public PopulateWithFormsRoles(Form currentForm, DataTable dt,
                                      DataGridNavigation currentPaging,
                                      Display firstOrLastpage,
                                      LoadingCircle currentLoadingCircle)
            : base(currentForm, dt, currentPaging, firstOrLastpage, currentLoadingCircle)
        {
            if (dt.Columns.Count == 0)
            {
                DataManipulation.AddColumnsTheirNamesInDataTable(dt, "FormName", "Roles");

                currentPaging.AllPages = dt;
                currentPaging.FillDataGridWithRecords(Display.FirstPage);
            }
        }
Beispiel #22
0
        public PopulateWithUsers(Form currentForm, DataTable dt,
                                 DataGridNavigation currentPaging,
                                 Display firstOrLastpage,
                                 LoadingCircle currentLoadingCircle)
            : base(currentForm, dt, currentPaging, firstOrLastpage, currentLoadingCircle)
        {
            if (dt.Columns.Count == 0)
            {
                DataManipulation.AddColumnsTheirNamesInDataTable(dt, "Username", "LastLoginDate", "LastLoginTime", "User roles", "IsUserOnline", "CreationDate");

                currentPaging.AllPages = dt;
                currentPaging.FillDataGridWithRecords(Display.FirstPage);
            }
        }
        public FormCheckinList(FacebookObjectCollection <Checkin> i_Checkins, MRG.Controls.UI.LoadingCircle i_LoadingCircleShowCheckins)
        {
            m_LoadingCircleShowCheckins = i_LoadingCircleShowCheckins;
            m_Checkins = new FacebookObjectCollection <CheckinProxy>();
            foreach (Checkin checkin in i_Checkins)
            {
                m_Checkins.Add(new CheckinProxy {
                    Checkin = checkin
                });
            }

            InitializeComponent();
            initializeComponent();
        }
Beispiel #24
0
        public PopulateWithProducts(Form currentForm, DataTable dt,
                                    DataGridNavigation currentPaging,
                                    Display firstOrLastPage,
                                    LoadingCircle currentLoadingCircle)
            : base(currentForm, dt, currentPaging, firstOrLastPage, currentLoadingCircle)
        {
            if (dt.Columns.Count == 0)
            {
                DataManipulation.AddColumnsTheirNamesInDataTable(dt, "Product", "Category", "Vendor", "Price", "Quantity", "Store", "Town");

                currentPaging.AllPages = dt;
                currentPaging.FillDataGridWithRecords(Display.FirstPage);
                currentLoadingCircle.Active = true;
            }
        }
Beispiel #25
0
    public async void FirebaseLogin()
    {
        auth       = Firebase.Auth.FirebaseAuth.DefaultInstance;
        credential = Firebase.Auth.FacebookAuthProvider.GetCredential(FbToken);
        bool isError = false;
        await auth.SignInWithCredentialAsync(credential).ContinueWith(task =>
        {
            if (task.IsCanceled)
            {
                isError = true;
                LoadingCircle.SetActive(false);
                Faildtxt.SetActive(true);
                Debug.LogError("SignInWithCredentialAsync was canceled.");
                return;
            }
            if (task.IsFaulted)
            {
                isError = true;
                //LoadingCircle.SetActive (false);
                //Faildtxt.SetActive (true);
                Debug.LogError("SignInWithCredentialAsync encountered an error: " + task.Exception);
                return;
            }
            newUser = task.Result;
            Debug.LogFormat("User signed in successfully: {0} ({1})", newUser.DisplayName, newUser.UserId);
        });

        if (!isError)
        {
            user = auth.CurrentUser;
            if (user != null)
            {
                Debug.Log("Entered (user != null)");
                FireName  = user.DisplayName;
                FireEmail = user.Email;
                FireId    = user.UserId;
                photo_url = user.PhotoUrl.OriginalString;
                isFB      = true;
                if (PlayerPrefs.GetInt("firsttime", -1) == 0)
                {
                    PlayerPrefs.SetInt("firsttime", 1);
                    Player.coin += 50;
                }
                SaveSession();
                finished = true;
            }
        }
    }
Beispiel #26
0
    public void LoadSession()
    {
        UserData data = SaveSystem.LoadUser();

        if (data != null)
        {
            btnLogin.GetComponent <Button>().interactable = false;
            btnGuest.GetComponent <Button>().interactable = false;
            LoadingCircle.SetActive(true);
            finished = true;
        }
        else
        {
            txtLogin.SetActive(true);
            return;
        }
    }
Beispiel #27
0
    public async void GuestLogin()
    {
        LoadingCircle.SetActive(true);
        auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
        bool isError = false;

        await auth.SignInAnonymouslyAsync().ContinueWith(task =>
        {
            if (task.IsCanceled)
            {
                isError = true;
                LoadingCircle.SetActive(false);
                Faildtxt.SetActive(true);
                Debug.LogError("SignInAnonymouslyAsync was canceled.");
                return;
            }
            if (task.IsFaulted)
            {
                isError = true;
                LoadingCircle.SetActive(false);
                Faildtxt.SetActive(true);
                Debug.LogError("SignInAnonymouslyAsync encountered an error: " + task.Exception);
                return;
            }

            Firebase.Auth.FirebaseUser newUser = task.Result;
            Debug.LogFormat("Anonymous signed in successfully: {0} ({1})",
                            newUser.DisplayName, newUser.UserId);
        });

        if (!isError)
        {
            user = auth.CurrentUser;
            if (user != null)
            {
                Debug.Log("Entered (user != null)");
                FireName = user.DisplayName;
                FireId   = user.UserId;
                isFB     = false;
                isAnony  = true;
                SaveSession();
                finished = true;
            }
        }
    }
Beispiel #28
0
    public IEnumerator RunAsync(string source, TextMeshProUGUI textUI, List <int> list, List <double> listD)
    {
        LoadingCircle.UpdateLoad(true);
        Debug.Log(source);
        ScriptDomain          domain         = ScriptDomain.CreateDomain("resposta");
        AsyncCompileOperation compileRequest = domain.CompileAndLoadSourceAsync(source, ScriptSecurityMode.UseSettings);

        // Wait for operation to complete
        yield return(compileRequest);

        // Check for compiler errors
        if (compileRequest.IsSuccessful == false)
        {
            // Get all errors
            foreach (CompilationError error in compileRequest.CompileDomain.CompileResult.Errors)
            {
                if (error.IsError == true)
                {
                    Debug.LogError(error.ToString());
                    textUI.text = error.ToString();
                }
                else if (error.IsWarning == true)
                {
                    Debug.LogWarning(error.ToString());
                }
            }
        }
        else
        {
            type  = compileRequest.CompiledType;
            proxy = type.CreateInstance(this.gameObject);
            proxy.Fields["_inputs"]  = list;
            proxy.Fields["_Dinputs"] = listD;
            proxy.Call(initBlock.name);
            if ((string)proxy.Fields["_loopError"] != null)
            {
                textUI.text = (string)proxy.Fields["_loopError"];
            }
            else
            {
                textUI.text = (string)proxy.Fields["_output"];
            }
        }
        LoadingCircle.UpdateLoad(false);
    }
Beispiel #29
0
 public static void SetLoadingCircleState(LoadingCircle lcControl, bool bActive, bool bVisible, Color controlColor, int rotationSpeed = 100)
 {
     if (lcControl.InvokeRequired)
     {
         SetLoadingCircleStateCallback d = SetLoadingCircleState;
         lcControl.Invoke(d, new object[] { lcControl, bActive, bVisible, controlColor, rotationSpeed });
     }
     else
     {
         lcControl.Active        = bActive;
         lcControl.Visible       = bVisible;
         lcControl.RotationSpeed = rotationSpeed;
         if (lcControl.Color != controlColor)
         {
             lcControl.Color = controlColor;
         }
     }
 }
    // Use this for initialization
    async void Start()
    {
        LoadingCircle.Show();

        GameObject prefab    = Resources.Load("Prefabs/ItemRow") as GameObject;
        GameObject container = GameObject.Find("ItemList");

        try
        {
            string result = await Globals.HttpClient.GetStringAsync("GetDailyItems");

            DailyItems items = JsonConvert.DeserializeObject <DailyItems>(result);

            GameObject.Find("DateText").GetComponent <Text>().text = DateTime.Parse(items.Date).ToShortDateString();

            foreach (Item i in items.Items)
            {
                GameObject item    = Instantiate(prefab);
                ListItem   objItem = item.GetComponent <ListItem>();
                objItem.item = i;

                item.transform.Find("ItemName").gameObject.GetComponent <Text>().text = i.Name;
                item.transform.Find("Checkmark").gameObject.SetActive(i.Found);

                item.transform.SetParent(container.transform, false);
                item.SetActive(true);
            }
        }
        catch (Exception e)
        {
            Debug.Log(e);
            DialogBox.Show(e.Message);
        }
        finally
        {
            LoadingCircle.Dismiss();
        }
    }