Ejemplo n.º 1
0
    /// <summary>
    /// ボタンなどのUIを作成する。
    /// </summary>
    /// <param name="arr"></param>
    public void CreateUI(ArrayList arr)
    {
        Debug.LogFormat("{0} : {1}", this.GetType().Name, new System.Diagnostics.StackFrame().GetMethod().Name);
        GameObject FishUIHead = new GameObject("FishUI");

        FishUIHead.transform.parent = _canvas.transform;


        Debug.LogFormat("Count {0}", arr.Count);

        for (int i = 0; i < _PAGE_ELEMENT && i < arr.Count; i++)
        {
            BioData data = ( BioData )arr[i];
            Debug.LogFormat("Count {0}, data name : {1}", arr.Count, data.GetNameEn());

            if (data.GetNameEn().Length < 1)
            {
                continue;
            }
            CreateUITip(FishUIHead, i, data);
        }


        FishUIHead.transform.localPosition = _UiHeadPos;
        FishUIHead.transform.localScale    = _UiHeadScale;
    }
Ejemplo n.º 2
0
        public Operation <BioData> UpdateBioData(BioData data)
        => _authorizer.AuthorizeAccess(UserContext.CurrentProcessPermissionProfile(), () =>
        {
            var user      = UserContext.CurrentUser();
            var persisted = _query.GetBioData(user);

            if (persisted != null)
            {
                data.CopyTo(persisted,
                            nameof(BioData.EntityId),
                            nameof(BioData.OwnerId),
                            nameof(BioData.Owner),
                            nameof(BioData.CreatedOn),
                            nameof(BioData.ModifiedOn));

                if (persisted.Dob <= DateTime.Parse("1753/1/1"))
                {
                    persisted.Dob = null;
                }

                return(_pcommand.Update(persisted));
            }
            else
            {
                return(_pcommand.Add(data));
            }
        });
Ejemplo n.º 3
0
    /// <summary>
    /// 参照するUI画像をリソースから読み込んで表示
    /// </summary>
    /// <param name="fishUI">画像を設定するゲームオブジェクトの親オブジェクト</param>
    /// <param name="data">設定するデータ</param>
    private void PictureRef(GameObject fishUI, BioData data)
    {
        string type           = StringUtil.ToTitle(data.GetBioType().ToString());
        Image  image          = fishUI.transform.FindChild("View").GetComponent <Image>();
        string resourceString = "Image/" + type + "/" + data.GetNameEn();
        Sprite View           = Resources.Load(resourceString, typeof(Sprite)) as Sprite;

        image.sprite = View;
    }
Ejemplo n.º 4
0
 public BioData(BioData bioData) //Copy Constructor
 {
     this.FirstName  = bioData.FirstName;
     this.LastName   = bioData.LastName;
     this.Age        = bioData.Age;
     this.Address    = bioData.Address;
     this.Profession = bioData.Profession;
     this.Gender     = bioData.Gender;
     Console.WriteLine("Copy Constructor");
 }
Ejemplo n.º 5
0
        public void LoadBioData(BioData bioData)
        {
            _isLoading = true;

            _bioData = bioData;
            biodatasource.DataSource = _bioData;
            _status = BioDataStatus.Normal;

            this.pictureBox1.Image = global::OMLDatabaseEditor.Properties.Resources.people;

            _isLoading = false;
        }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        BioData bdOld = new BioData();

        bdOld.bpm         = 128;
        bdOld.temperature = 36.6f;
        bdOld.moisture    = 0.1f;
        Debug.Log(bdOld.toJson());
        string  json = bdOld.toJson();
        BioData bd   = BioData.getInstanceFromJson(json);

        Debug.Log("Recreated");
        Debug.Log(bd.toJson());
    }
Ejemplo n.º 7
0
    /// <summary>
    /// UIオブジェクトの生成
    /// </summary>
    /// <param name="FishUIHead">生成されたオブジェクトの親要素</param>
    /// <param name="i">生成位置を調整するインデックス</param>
    /// <param name="data">生成するオブジェクトのデータが入ったインスタンス</param>
    private void CreateUITip(GameObject FishUIHead, int i, BioData data)
    {
        Debug.LogFormat("uihead name :{0}, data en name :{1}", FishUIHead.name, data.GetNameEn());
        GameObject fishUI;
        int        posx     = 820 + ((i % 2) * 95);
        int        posy     = 370 - ((i / 2) * 95);
        Vector2    position = new Vector2(posx, posy);

        fishUI = Instantiate(_fishUI, position, Quaternion.identity);
        fishUI.transform.parent = FishUIHead.transform;
        fishUI.name             = data.GetNameJp();

        PictureRef(fishUI, data);
        ClickEvent(fishUI, data);
    }
Ejemplo n.º 8
0
        private void fetchImage(object sender,DoWorkEventArgs e)
        {
            var    image = e.Argument as FingerImage;
            String type,data;

            Dispatcher.Invoke(new Action(() => currDevice.Dispatch(COMMAND.SINGLECAPTURE_STOP)));
            Thread.Sleep(250); // it's magic!

            image.Serialize(out type,out data);
            var bioData = new BioData(type,data);

            Dispatcher.Invoke(new Action(() => SendBio(bioData)));
            FingerPicture pic = image.MakePicture();

            Dispatcher.Invoke(new Action(() => showImage(pic)));
        }
Ejemplo n.º 9
0
    /// <summary>
    /// 配列の値を初期化する
    /// </summary>
    /// <param name="fish">データを追加したい配列</param>
    /// <param name="type">設定する生体型</param>
    /// <param name="en">設定する英語名</param>
    /// <param name="jp">設定する日本語名</param>
    private void ArrayInit(ArrayList fish, BioType type, string[] en, string[] jp)
    {
        for (int i = 0; i < en.Length; i++)
        {
            BioData data = new BioData()
                           .SetType(type)
                           .SetNameEn(en[i])
                           .SetNameJp(jp[i]);
            fish.Add(data);
        }

        BioData blank    = new BioData().SetType(type);
        int     pageData = 8;
        int     fillSize = pageData - (en.Length % pageData);

        ArrayListUtil <BioData> .Fill(fish, blank, fillSize);
    }
Ejemplo n.º 10
0
        private void SetupTransformationGoalScreenButtonActions(Window window)
        {
            this.appViews.ChooseGoalScreen.SelectButton.Clicked += () =>
            {
                //mapper BiodataEntitie to Biodata
                BioData userBioData = new BioData(loggedInUser.BioData.Age, (GenderType)loggedInUser.BioData.Gender,
                                                  loggedInUser.BioData.Weight, loggedInUser.BioData.Height, loggedInUser.BioData.NeckSize,
                                                  loggedInUser.BioData.WaistSize, loggedInUser.BioData.HipsSize);

                //mapper UserEntitie to User
                User user = new User(loggedInUser.Username, userBioData);

                var currentFatPerc = this.bodyCalculator.CalculateBodyFat(user);
                var caloriesNeed   = this.bodyCalculator.CalculateCalories(user);


                IBodyTransformationGoal goal = transformationGoalFactory.GetGoal(this.appViews.ChooseGoalScreen.RadioGroup.Selected,
                                                                                 user.BioData.Weight,
                                                                                 currentFatPerc,
                                                                                 caloriesNeed);

                window.Remove(this.appViews.ChooseGoalScreen);
                string finalAdvise = string.Empty;

                if (goal != null)
                {
                    user.SetTransformationGoal(goal);
                    finalAdvise = user.Goal.ToString();

                    //Update user goal at db
                    loggedInUser.TrainingProgramAdvise = finalAdvise;
                    userService.UpdateUser(loggedInUser);

                    window.Add(new TextView {
                        Text = finalAdvise
                    });
                }

                Application.Run(window);
            };
        }
Ejemplo n.º 11
0
    /// <summary>
    /// OnClickイベントの作成
    /// </summary>
    /// <param name="fishUI">UI単位をまとめるオブジェクト。</param>
    /// <param name="data">作成する魚のデータ</param>
    private void ClickEvent(GameObject fishUI, BioData data)
    {
        BiologicalManager _manager     = GetComponent <BiologicalManager>();
        FishManager       fish         = _manager.GetFishManager();
        Button            createButton = GetButtonComponent(fishUI, "CreateButton");

        createButton.onClick.AddListener(() =>
        {
            fish.FishCreate(data.GetBioType(), data.GetNameEn());
        });

        Button deleteButton = GetButtonComponent(fishUI, "DeleteButton");

        if (BioType.FISH == data.GetBioType())
        {
            deleteButton.onClick.AddListener(() => fish.ObjectDelete(data.GetNameEn()));
            return;
        }
        // 魚以外はDeleteButtonは使わないので削除
        Destroy(deleteButton.gameObject);
    }
        public static void RemoveBioData(BioData bd)
        {
            // delete the image if it exists
            if (bd.DaoBioData.PhotoID != null)
            {
                Dao.TitleCollectionDao.SetDeleteImage((int)bd.DaoBioData.PhotoID);
            }

            Dao.DBContext.Instance.BioDatas.DeleteOnSubmit(bd.DaoBioData);
            Dao.DBContext.Instance.SubmitChanges();
        }
Ejemplo n.º 13
0
        private void AddBioData()
        {
            SaveCurrentBioData();

            var e = from Object li in lbBioData.Items
                    where li.ToString() == "New Person"
                    select li;

            if (e.Count() == 0)
            {
                BioData bd = new BioData();
                bd.FullName = "New Person";

                lbBioData.Items.Add(bd);
                lbBioData.SelectedItem = bd;

                TitleCollectionManager.AddBioData(bd);

                bioDataEditor.LoadBioData((BioData)bd);
            }
            else
            {
                lbBioData.SelectedItem = e.First();
            }
        }
Ejemplo n.º 14
0
 void SendBio(BioData data)
 {
     _collectorServer.SendBiometrics(data,CryptoProvidersCombo.SelectedIndex);
 }
Ejemplo n.º 15
0
        public static void xMain()
        {
            #region Type System (Value Types/Reference Types, Memory Allocation of value types and ref types, Methods,Type Casting
            //Value types:- all those types which are primitive types or system generated types.
            //1-All structs
            //2-Value types creates on Stack in memory(RAM)
            //3-Example all those types which are not human made.
            //4-It hold the values only.
            uint   ui     = 10;
            int    i      = 0;  // Int32
            short  s      = 1;  //Int16
            long   l      = 10; //Int64
            byte   b      = 1;
            double d      = 1.6;
            float  f      = 1.34f;
            bool   b_bool = true;
            char   c      = 'a';
            char   c1     = 'b';

            //Reference Type:-
            //Address to the object     //Object
            Vitz1999Standard vitz = new Vitz1999Standard();
            Console.WriteLine(vitz.dimensions);
            Console.WriteLine(vitz.engine);

            //All references create on heap
            //User defined Types/Classes

            string str = "1dkashdkash1.45true";

            Vegitable v         = GiveMeVegitable(100, new Bike());
            int       subResult = Subtract(1, 2);

            //Type Casting
            int    result  = (int)(3.5 - 1.2);          //Explicit type casting
            double dResult = 5 - 2;                     //Implicit Type Casting
            float  fResult = 1.5f - 1;                  //Implicit Type Casting
            int    iResult = (int)(1.5f - (float)3.2d); //Explicit type casting

            #endregion

            // Copy by Value (Value Type)
            int x = 10;
            int y = x;
            y = 12;
            Console.WriteLine($"{x}, {y}");// 10,12

            // Copy by Reference (Reference Type)
            //200       //100
            A obj1 = new A()
            {
                a = 10
            };
            //300  = //200
            A obj2 = obj1;

            obj2.a = 12;
            Console.WriteLine($"{obj1.a}, {obj2.a}");//12,12

            Console.WriteLine("Hello world");

            //Arithmatic Operations:-
            //pre-fix
            int p1 = 0;
            // ++ == increment by one, => x=x+1, x+=1
            Console.WriteLine(++p1); // p1=1, print(1)

            Console.WriteLine(p1++); // p1=2, print(1)

            p1 = 0;
            int val = p1++ + ++p1;

            p1 += 2; /*equals*/ p1 = p1 + 2;
            p1 -= 4; /*equals*/ p1 = p1 - 4;

            --p1;
            p1--;

            //Concatination
            Console.WriteLine("aamir" + "akhtar");

            //Reference type casting
            C objC1 = new C();
            P objB1 = (P)objC1; // Valid bcz Child can be type casted to parent but not vice versa

            P objB2 = new P();
            //C objC2 = (C)objB2; //Invalid bcz Parent cannot be type casted to child

            //String Formatting
            //1-Parameterized
            Console.WriteLine("x={0}, y={1}", x, y);
            //2-Dollar
            Console.WriteLine($"x={x}, y={y}");

            Console.WriteLine("**aamir\nakhtar**");
            Console.WriteLine("**aamir\takhtar**");

            //BioData objBioData1 = new BioData();//Default Constructor
            //BioData objBioData2 = new BioData(30);//Overloaded Constructor

            BioData farasatBioData = new BioData()
            {
                FirstName  = "Farasat",
                LastName   = "Hussain",
                Age        = 21,
                Address    = "Austria",
                Gender     = "Male",
                Profession = "Student"
            };

            BioData farasatBioDataCopy = new BioData(farasatBioData);

            BioData objBioData3 = new BioData();

            //Static property
            BioData.FathersName = "Donald";

            //Non-static properties
            BioData b1 = new BioData(); b1.FirstName = "noman"; b1.LastName = "Aqeel";
            BioData.GetFullName(b1.FirstName, b1.LastName);
            BioData b2 = new BioData(); b2.FirstName = "aamir"; b2.LastName = "akhtar";
            BioData.GetFullName(b2.FirstName, b2.LastName);
            BioData b3 = new BioData(); b3.FirstName = "farast"; b3.LastName = "hussain";
            BioData.GetFullName(b3.FirstName, b3.LastName);

            b1.GetBio();

            BioData.PrintFathersName();

            Console.ReadLine();
        }
Ejemplo n.º 16
0
 public IHttpActionResult UpdateBioData([FromBody] BioData data)
 => this.Log(() => Operation.Try(() => data.ThrowIfNull(new MalformedApiArgumentsException()))
             .Then(opr => _account.UpdateBioData(data))
             .OperationResult(Request));
 public static void AddBioData(BioData bd)
 {
     UpdatesImagesForBioData(bd.DaoBioData);
     Dao.DBContext.Instance.BioDatas.InsertOnSubmit(bd.DaoBioData);
     Dao.DBContext.Instance.SubmitChanges();
 }