コード例 #1
0
        public ActionResult EditSection(PanelView panelView)
        {
            //dodaj przed wybranym
            var editedSection = unitOfWork.Sections.Get(panelView.editedSectionId);
            var groupid       = (Convert.ToInt32(panelView.SelectedGroup));
            var group         = unitOfWork.Repository <Group>().Get(groupid);

            if (editedSection.Name == panelView.SelectedSection)
            {
                editedSection.Group       = group;
                editedSection.Description = panelView.Description;
                editedSection.Name        = panelView.Name;
            }
            else
            {
                var sectionid = Convert.ToInt32(panelView.SelectedSection);
                var section   = unitOfWork.Sections.Get(sectionid);
                var order     = section.Order;

                var items = unitOfWork.Sections.Find(x => x.Order >= order);

                foreach (var item in items)
                {
                    item.Order = item.Order + 1;
                }

                editedSection.Order       = order;
                editedSection.Group       = group;
                editedSection.Description = panelView.Description;
                editedSection.Name        = panelView.Name;
            }
            unitOfWork.Complete();

            return(RedirectToAction("Index", "Home"));
        }
コード例 #2
0
        private void DrawButtonHeader()
        {
            GUIStyle buttonStyle = new GUIStyle(GUI.skin.button);

            buttonStyle.margin  = new RectOffset(0, 0, 2, 2);
            buttonStyle.padding = new RectOffset(0, 0, 2, 2);
            buttonStyle.border  = new RectOffset(
                2,                //buttonStyle.border.left,
                2,                //buttonStyle.border.right ,
                2,                //buttonStyle.border.top,
                2);               //buttonStyle.border.bottom);

            GUILayout.Space(10);
            EditorGUILayout.BeginHorizontal();
            if (true == GUILayout.Toggle((0 == activePanelProperty.intValue), "Glasses", buttonStyle))
            {
                view = PanelView.GlassesConfig;
                activePanelProperty.intValue = 0;
            }
            if (true == GUILayout.Toggle((2 == activePanelProperty.intValue), "Tools", buttonStyle))
            {
                view = PanelView.EditorConfig;
                activePanelProperty.intValue = 2;
            }
            EditorGUILayout.EndHorizontal();


            //EditorGUILayout.LabelField ("", GUI.skin.horizontalSlider);
            GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(4));
            GUILayout.Space(8);
        }
コード例 #3
0
    Image fillImage;            // スライダゲージ画像


    void Start()
    {
        ImageColorModel icm        = imageObj.GetComponent <ImageColorModel>();
        Slider          slider     = GetComponent <Slider>();
        PanelView       pv         = imageObj.GetComponent <PanelView>();
        InputField      inputfield = valueObj.GetComponent <InputField>();

        // model→imageの反映
        icm.colorRP
        .Subscribe(color => {
            // viewに色を反映
            pv.SetBlue(color.b);

            // InputFieldに値を反映
            inputfield.text = ((int)(color.b * 255.0f)).ToString();

            // スライダの色を変える
            backgroundImage.color = new Color(1 - color.b, 1 - color.b, 255);
            fillImage.color       = new Color(1 - color.b, 1 - color.b, 255);
        });

        // slider→modelの反映
        slider
        .OnValueChangedAsObservable()
        .DistinctUntilChanged()
        .Subscribe(b => {
            // modelに色を反映
            icm.colorRP.Value = new Color(icm.colorRP.Value.r, icm.colorRP.Value.g, b);
        });
    }
コード例 #4
0
        private void OpenConfiguration()
        {
            m_CurrentPanelView = PanelView.Configuration;

            if (m_MainCacheMaterials == null || m_CurrentMeshACIndex < 0 || m_CurrentMeshACIndex >= m_MainCacheMaterials.Count)
            {
                return;
            }
            Material mat    = m_MainCacheMaterials[m_CurrentMeshACIndex];
            Shader   shader = mat.shader;

            if (ShaderMetaDataUtility.IsValidShader(shader))
            {
#pragma warning disable 0618
                // Data conversion between Polybrush Beta and Polybrush 1.0.
                string path = ShaderMetaDataUtility.FindPolybrushMetaDataForShader(shader);
                if (!string.IsNullOrEmpty(path))
                {
                    ShaderMetaDataUtility.ConvertMetaDataToNewFormat(shader);
                }
#pragma warning restore 0618

                m_LoadedAttributes = ShaderMetaDataUtility.LoadShaderMetaData(shader);
            }
        }
コード例 #5
0
        internal override void OnEnable()
        {
            base.OnEnable();

            m_CurrentPanelView = PanelView.Paint;

            m_LikelySupportsTextureBlending = false;
            m_MeshAttributesContainer       = null;
            brushColor = null;

            if (meshAttributes != null)
            {
                OnMaterialSelected();
            }

            foreach (GameObject go in Selection.gameObjects)
            {
                m_LikelySupportsTextureBlending = CheckForTextureBlendSupport(go);

                if (m_LikelySupportsTextureBlending)
                {
                    break;
                }
            }
        }
コード例 #6
0
        public void AdjustContainer_With_Border_Absolute_Values()
        {
            var top = Application.Top;
            var win = new Window();
            var pv  = new PanelView(new Label("This is a test.")
            {
                Border = new Border()
                {
                    BorderStyle     = BorderStyle.Double,
                    BorderThickness = new Thickness(1, 2, 3, 4),
                    Padding         = new Thickness(1, 2, 3, 4)
                }
            });

            win.Add(pv);
            top.Add(win);

            Application.Begin(top);

            Assert.False(pv.Child.Border.Effect3D);
            Assert.Equal(new Rect(0, 0, 25, 15), pv.Frame);
            Assert.Equal(new Rect(0, 0, 15, 1), pv.Child.Frame);

            pv.Child.Border.Effect3D = true;

            Assert.True(pv.Child.Border.Effect3D);
            Assert.Equal(new Rect(0, 0, 25, 15), pv.Frame);
            Assert.Equal(new Rect(0, 0, 15, 1), pv.Child.Frame);

            pv.Child.Border.Effect3DOffset = new Point(-1, -1);

            Assert.Equal(new Point(-1, -1), pv.Child.Border.Effect3DOffset);
            Assert.Equal(new Rect(0, 0, 25, 15), pv.Frame);
            Assert.Equal(new Rect(0, 0, 15, 1), pv.Child.Frame);
        }
コード例 #7
0
        private void CloseConfiguration(bool saveOnDisk)
        {
            if (saveOnDisk)
            {
                Material mat    = m_CacheMaterials[currentMeshACIndex];
                Shader   shader = mat.shader;

                ShaderMetaDataUtility.SaveShaderMetaData(shader, m_LoadedAttributes);
                foreach (GameObject go in Selection.gameObjects)
                {
                    m_LikelySupportsTextureBlending = CheckForTextureBlendSupport(go);

                    if (m_LikelySupportsTextureBlending)
                    {
                        break;
                    }
                }

                if (m_CacheTarget != null)
                {
                    RebuildCaches(m_CacheTarget.editMesh);
                }
            }

            m_LoadedAttributes = null;
            m_CurrentPanelView = PanelView.Paint;
        }
コード例 #8
0
        public void UsePanelFrame_True_PanelView_Position_And_Size_Are_Used_Depending_On_Effect3DOffset()
        {
            var top = Application.Top;
            var win = new Window();
            var pv  = new PanelView(new TextView()
            {
                X      = 2,
                Y      = 4,
                Width  = 20,
                Height = 10
            })
            {
                X             = 5,
                Y             = 6,
                Width         = Dim.Fill(),
                Height        = Dim.Fill(),
                UsePanelFrame = true
            };
            var pv1 = new PanelView(new TextView()
            {
                X      = 5,
                Y      = 6,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            })
            {
                X             = 2,
                Y             = 4,
                Width         = 20,
                Height        = 10,
                UsePanelFrame = true
            };

            win.Add(pv, pv1);
            top.Add(win);

            Application.Begin(top);

            Assert.Equal(new Rect(5, 6, 73, 17), pv.Frame);
            Assert.Equal(new Rect(2, 4, 20, 10), pv.Child.Frame);
            Assert.Equal(new Rect(2, 4, 20, 10), pv1.Frame);
            Assert.Equal(new Rect(5, 6, 15, 4), pv1.Child.Frame);

            pv.Border.Effect3D = pv1.Border.Effect3D = true;

            Assert.Equal(new Rect(5, 6, 73, 17), pv.Frame);
            Assert.Equal(new Rect(2, 4, 20, 10), pv.Child.Frame);
            Assert.Equal(new Rect(2, 4, 20, 10), pv1.Frame);
            Assert.Equal(new Rect(5, 6, 15, 4), pv1.Child.Frame);

            pv.Border.Effect3DOffset = pv1.Border.Effect3DOffset = new Point(-1, -1);

            Assert.Equal(new Rect(6, 7, 73, 17), pv.Frame);
            Assert.Equal(new Rect(2, 4, 20, 10), pv.Child.Frame);
            Assert.Equal(new Rect(3, 5, 20, 10), pv1.Frame);
            Assert.Equal(new Rect(5, 6, 15, 4), pv1.Child.Frame);
        }
コード例 #9
0
        /// <summary>
        /// Metoda wyswietlajaca formularz do stworzenia nowej sekcji na forum.
        /// </summary>
        /// <returns> Widok z formularzem tworzenia sekcji na forum.</returns>
        public ActionResult CreateSection()
        {
            var model = new PanelView()
            {
                Groups = unitOfWork.Repository <Group>().GetAll(),
            };

            return(View(model));
        }
コード例 #10
0
 protected virtual void OnMainFormLocationChanged(object sender, EventArgs e)
 {
     if (MainForm.WindowState == System.Windows.Forms.FormWindowState.Minimized)
     {
         return;
     }
     m_SrcGameForm.Location = PanelView.PointToScreen(new System.Drawing.Point(0, 0));
     m_Graphics.ApplyChanges();
 }
コード例 #11
0
ファイル: PanelControll.cs プロジェクト: congibab/Unity
    /// <summary>
    ///
    /// </summary>
    /// <param name="panelScript"></param>
    /// <param name="panelPos"></param>
    /// <param name="addCount"></param>
    /// <returns></returns>
    private bool ChangePanelCheck(PanelView panelScript, int panelPos, int addCount)
    {
        if (panelPos + addCount == voidPanelNum)
        {
            voidPanelNum = panelPos;

            panelScript.SetPanelPos(panelPos + addCount);
        }
        return(true);
    }
コード例 #12
0
        public void Child_Sets_To_Null_Remove_From_Subviews_PanelView()
        {
            var pv = new PanelView(new Label("This is a test."));

            Assert.NotNull(pv.Child);
            Assert.Equal(1, pv.Subviews [0].Subviews.Count);

            pv.Child = null;
            Assert.Null(pv.Child);
            Assert.Equal(0, pv.Subviews [0].Subviews.Count);
        }
コード例 #13
0
        public void Add_View_Also_Sets_Child()
        {
            var pv = new PanelView();

            Assert.Null(pv.Child);
            Assert.Equal(0, pv.Subviews [0].Subviews.Count);

            pv.Add(new Label("This is a test."));
            Assert.NotNull(pv.Child);
            Assert.Equal(1, pv.Subviews [0].Subviews.Count);
        }
コード例 #14
0
 private void panel1ScarletButton(object sender, EventArgs e)
 {
     panel1.Controls.Clear();
     panelView                      = PanelView.game;
     timerMapMove.Enabled           = true;
     timerEnemyShoot.Enabled        = true;
     timerGenerateObstacles.Enabled = true;
     avenger = new Avenger("ScarletWitch", new Point(1000 / 2, 500 - 120));
     Prev    = "ScarletWitch";
     boss    = new Boss(new Point(1000 / 2, 0));
     map     = new Map(500, 1000, avenger.Name, r);
 }
コード例 #15
0
 private void panel1StartOverButton(object sender, EventArgs e)
 {
     panel1.Controls.Clear();
     panelView = PanelView.game;
     timerGenerateObstacles.Interval = timerMapMove.Interval * 108;
     timerMapMove.Enabled            = true;
     timerEnemyShoot.Enabled         = true;
     timerGenerateObstacles.Enabled  = true;
     avenger = new Avenger(Prev, new Point(1000 / 2, 500 - 120));
     boss    = new Boss(new Point(1000 / 2, 0));
     map     = new Map(500, 1000, avenger.Name, r);
 }
コード例 #16
0
        public void AdjustContainer_With_Border_Computed_Values()
        {
            var top = Application.Top;
            var win = new Window();
            var pv  = new PanelView(new TextView()
            {
                Width  = Dim.Fill(),
                Height = Dim.Fill(),
                Border = new Border()
                {
                    BorderStyle     = BorderStyle.Double,
                    BorderThickness = new Thickness(1, 2, 3, 4),
                    Padding         = new Thickness(1, 2, 3, 4)
                }
            });

            var pv1 = new PanelView(new TextView()
            {
                Width  = Dim.Fill(1),
                Height = Dim.Fill(1),
                Border = new Border()
                {
                    BorderStyle     = BorderStyle.Double,
                    BorderThickness = new Thickness(1, 2, 3, 4),
                    Padding         = new Thickness(1, 2, 3, 4)
                }
            });

            var pv2 = new PanelView(new TextView()
            {
                Width  = Dim.Fill(2),
                Height = Dim.Fill(2),
                Border = new Border()
                {
                    BorderStyle     = BorderStyle.Double,
                    BorderThickness = new Thickness(1, 2, 3, 4),
                    Padding         = new Thickness(1, 2, 3, 4)
                }
            });

            win.Add(pv, pv1, pv2);
            top.Add(win);

            Application.Begin(top);

            Assert.Equal(new Rect(0, 0, 78, 23), pv.Frame);
            Assert.Equal(new Rect(0, 0, 68, 9), pv.Child.Frame);
            Assert.Equal(new Rect(0, 0, 77, 22), pv1.Frame);
            Assert.Equal(new Rect(0, 0, 65, 6), pv1.Child.Frame);
            Assert.Equal(new Rect(0, 0, 76, 21), pv2.Frame);
            Assert.Equal(new Rect(0, 0, 62, 3), pv2.Child.Frame);
        }
コード例 #17
0
 public void ToggleView(PanelView view)
 {
     if (view == PanelView.Capes)
     {
         capesView.SetActive(true);
     }
     else if (view == PanelView.Money)
     {
     }
     else if (view == PanelView.Laws)
     {
     }
 }
コード例 #18
0
        public void Add_More_Views_Remove_Last_Child_Before__Only_One_Is_Allowed()
        {
            var pv = new PanelView(new Label("This is a test."));

            Assert.NotNull(pv.Child);
            Assert.Equal(1, pv.Subviews [0].Subviews.Count);
            Assert.IsType <Label> (pv.Child);

            pv.Add(new TextField("This is a test."));
            Assert.NotNull(pv.Child);
            Assert.Equal(1, pv.Subviews [0].Subviews.Count);
            Assert.IsNotType <Label> (pv.Child);
            Assert.IsType <TextField> (pv.Child);
        }
コード例 #19
0
        public void AdjustContainer_Without_Border()
        {
            var top = Application.Top;
            var win = new Window();
            var pv  = new PanelView(new Label("This is a test."));

            win.Add(pv);
            top.Add(win);

            Application.Begin(top);

            Assert.Equal(new Rect(0, 0, 15, 1), pv.Frame);
            Assert.Equal(new Rect(0, 0, 15, 1), pv.Child.Frame);
        }
コード例 #20
0
 public Form1()
 {
     InitializeComponent();
     FormBorderStyle     = FormBorderStyle.None;
     WindowState         = FormWindowState.Maximized;
     TopMost             = true;
     won                 = new bool[7];
     this.DoubleBuffered = true;
     r         = new Random();
     panelView = PanelView.menu;
     timerGenerateObstacles.Interval = timerMapMove.Interval * 108;
     timerEnemyShoot.Interval        = timerMapMove.Interval * 54;
     this.Height = 500;
     this.Width  = 1000;
     Form1_Resize(null, null);
     KeyPreview      = true;
     backgroundImage = new Bitmap(Resources.menuBackground, new Size(1000, 500));
 }
コード例 #21
0
        /// <summary>
        /// Metoda wyswietla formularz edycji sekcji z uwzglednieniem wczesniej wprowadzonych pol.
        /// </summary>
        /// <param name="id"> Id edytowanej sekcji.</param>
        /// <returns> Widok formularza danej sekcji.</returns>
        public ActionResult EditSection(int id)
        {
            var edit  = unitOfWork.Sections.Get(id);
            var model = new PanelView()
            {
                Name            = edit.Name,
                Description     = edit.Description,
                Groups          = unitOfWork.Repository <Group>().GetAll(),
                SelectedGroup   = edit.Group.GroupName,
                SelectedSection = unitOfWork.Sections.GetSelectedSectionName(edit),
                editedSectionId = edit.SectionId
            };
            var sectionNames = unitOfWork.Sections.Find(x => x.GroupId == edit.GroupId);

            ViewBag.Sections = sectionNames;

            return(View(model));
        }
コード例 #22
0
        public void Constructor_Defaults()
        {
            var pv = new PanelView();

            Assert.False(pv.CanFocus);
            Assert.False(pv.Visible);
            Assert.False(pv.UsePanelFrame);
            Assert.Null(pv.Child);

            pv = new PanelView(new Label("This is a test."));

            Assert.False(pv.CanFocus);
            Assert.True(pv.Visible);
            Assert.False(pv.UsePanelFrame);
            Assert.NotNull(pv.Child);
            Assert.NotNull(pv.Border);
            Assert.NotNull(pv.Child.Border);
        }
コード例 #23
0
        public void UsePanelFrame_False_PanelView_Always_Respect_The_Child_Upper_Left_Corner_Position_And_Size()
        {
            var top = Application.Top;
            var win = new Window();
            var pv  = new PanelView(new Label("This is a test."))
            {
                X      = 2,
                Y      = 4,
                Width  = 20,
                Height = 10
            };
            var pv1 = new PanelView(new TextField(3, 4, 15, "This is a test."))
            {
                X      = 2,
                Y      = 4,
                Width  = 20,
                Height = 10
            };
            var pv2 = new PanelView(new TextView()
            {
                X      = 5,
                Y      = 6,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            })
            {
                X      = 2,
                Y      = 4,
                Width  = 20,
                Height = 10
            };

            win.Add(pv, pv1, pv2);
            top.Add(win);

            Application.Begin(top);

            Assert.Equal(new Rect(0, 0, 15, 1), pv.Frame);
            Assert.Equal(new Rect(0, 0, 15, 1), pv.Child.Frame);
            Assert.Equal(new Rect(3, 4, 15, 1), pv1.Frame);
            Assert.Equal(new Rect(0, 0, 15, 1), pv1.Child.Frame);
            Assert.Equal(new Rect(5, 6, 73, 17), pv2.Frame);
            Assert.Equal(new Rect(0, 0, 73, 17), pv2.Child.Frame);
        }
コード例 #24
0
        public ActionResult CreateSection(PanelView panelView)
        {
            if (panelView.SelectedSection == null)
            {
                var orderNull       = unitOfWork.Sections.GetTopOrder();
                var sectionDataNull = new Section()
                {
                    Order       = orderNull + 1,
                    Name        = panelView.Name,
                    Description = panelView.Description,
                    GroupId     = Convert.ToInt32(panelView.SelectedGroup)
                };
                unitOfWork.Sections.Add(sectionDataNull);

                unitOfWork.Complete();
                return(RedirectToAction("Index", "Home"));
            }
            //dodaj przed wybranym
            var sectionid = Convert.ToInt32(panelView.SelectedSection);
            var section   = unitOfWork.Sections.Get(sectionid);
            var order     = section.Order;
            var items     = unitOfWork.Sections.Find(id => id.Order >= order);

            foreach (var item in items)
            {
                item.Order = item.Order + 1;
            }

            var sectionData = new Section()
            {
                Order       = order,
                Name        = panelView.Name,
                Description = panelView.Description,
                GroupId     = Convert.ToInt32(panelView.SelectedGroup)
            };



            unitOfWork.Sections.Add(sectionData);
            unitOfWork.Complete();


            return(RedirectToAction("Index", "Home"));
        }
コード例 #25
0
        public void UsePanelFrame_True_PanelView_Position_And_Size_Are_Used()
        {
            var top = Application.Top;
            var win = new Window();
            var pv  = new PanelView(new TextView()
            {
                X      = 2,
                Y      = 4,
                Width  = 20,
                Height = 10
            })
            {
                X             = 5,
                Y             = 6,
                Width         = Dim.Fill(),
                Height        = Dim.Fill(),
                UsePanelFrame = true
            };
            var pv1 = new PanelView(new TextView()
            {
                X      = 5,
                Y      = 6,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            })
            {
                X             = 2,
                Y             = 4,
                Width         = 20,
                Height        = 10,
                UsePanelFrame = true
            };

            win.Add(pv, pv1);
            top.Add(win);

            Application.Begin(top);

            Assert.Equal(new Rect(5, 6, 73, 17), pv.Frame);
            Assert.Equal(new Rect(0, 0, 20, 10), pv.Child.Frame);
            Assert.Equal(new Rect(2, 4, 20, 10), pv1.Frame);
            Assert.Equal(new Rect(0, 0, 20, 10), pv1.Child.Frame);
        }
コード例 #26
0
        public void Remove_RemoveAll_View_Also_Sets_Child_To_Null()
        {
            var pv = new PanelView(new Label("This is a test."));

            Assert.NotNull(pv.Child);
            Assert.Equal(1, pv.Subviews [0].Subviews.Count);

            pv.Remove(pv.Child);
            Assert.Null(pv.Child);
            Assert.Equal(0, pv.Subviews [0].Subviews.Count);

            pv = new PanelView(new Label("This is a test."));
            Assert.NotNull(pv.Child);
            Assert.Equal(1, pv.Subviews [0].Subviews.Count);

            pv.RemoveAll();
            Assert.Null(pv.Child);
            Assert.Equal(0, pv.Subviews [0].Subviews.Count);
        }
コード例 #27
0
        public override void Awake()
        {
            // This is to make it so nothing else can be interacted with.
            this.EncompassingView      = new View(this.main.GeeUI, this.main.GeeUI.RootView);
            this.MainView              = new PanelView(this.main.GeeUI, this.EncompassingView, Vector2.Zero);
            MainView.Resizeable        = false;
            MainView.AnchorPoint.Value = new Vector2(0.5f, 0.5f);
            MainView.Width.Value       = 400;
            MainView.Height.Value      = 100;

            this.EncompassingView.Add(new Binding <int, Point>(EncompassingView.Height, (p) => p.Y, main.ScreenSize));
            this.EncompassingView.Add(new Binding <int, Point>(EncompassingView.Width, (p) => p.X, main.ScreenSize));
            this.MainView.Add(new Binding <Vector2, int>(MainView.Position, i => new Vector2(i / 2f, MainView.Y), EncompassingView.Width));
            this.MainView.Add(new Binding <Vector2, int>(MainView.Position, i => new Vector2(MainView.X, i / 2f), EncompassingView.Height));

            new TextView(this.main.GeeUI, this.MainView, this.label, new Vector2(10, 8));
            this.Text = new TextFieldView(this.main.GeeUI, this.MainView, new Vector2(10, 25))
            {
                MultiLine = false,
            };
            this.Text.Height.Value   = 20;
            this.Text.Width.Value    = 340;
            this.Text.Text           = this.defaultText;
            this.Text.Selected.Value = true;

            this.Okay   = new ButtonView(main.GeeUI, MainView, this.action, new Vector2(50, 60));
            this.Cancel = new ButtonView(main.GeeUI, MainView, "Cancel", new Vector2(300, 60));

            this.Okay.OnMouseClick += (sender, args) =>
            {
                this.Go();
            };

            this.Cancel.OnMouseClick += (sender, args) =>
            {
                this.Delete.Execute();
            };

            base.Awake();

            this.Text.ParentGeeUI.OnKeyPressedHandler += this.keyHandler;
        }
コード例 #28
0
ファイル: MainWindow.xaml.cs プロジェクト: agatex20/IO_proj
        private void  PanelViewClicked(object sender, RoutedEventArgs e)
        {
            if (user.name != "Unlogged")
            {
                DataContext = new PanelView();
            }

            // ------------- Create --------------- //
            //Balance newBalance = new Balance(1200.0);
            //db.Balances.Add(newBalance);
            //db.SaveChanges();

            /*
             * Grown_up adult = new Grown_up();
             * adult.name = "Tomek";
             * adult.password = "******";
             * adult.BalanceId = 1;
             * db.Grown_Ups.Add(adult);
             * db.SaveChanges();
             */
            //Income newIncome = new Income();
            //newIncome.amount = 1000;
            //db.Incomes.Add(newIncome);
            //db.SaveChanges();

            // -------------- Read ---------------- //
            //List<Balance> lists = db.Balances.ToList();
            //ICollection<Balance> balans = lists;

            // ------------- Update ---------------- //
            //Balance firstBalance = db.Balances.FirstOrDefault();
            //firstBalance.curr_balance = 1337.00;
            //db.SaveChanges();

            // -------------- Delete ---------------- //
            //Balance firstBalance = db.Balances.FirstOrDefault();
            //db.Balances.Remove(firstBalance);
            //db.SaveChanges();
        }
コード例 #29
0
 public ProductsPanelType(PanelView panelView)
 {
     _panelView = panelView;
 }
コード例 #30
0
        public override void Awake()
        {
            // This is to make it so nothing else can be interacted with.
            this.EncompassingView      = new View(main.GeeUI, main.GeeUI.RootView);
            this.MainView              = new PanelView(main.GeeUI, EncompassingView, Vector2.Zero);
            MainView.Resizeable        = false;
            MainView.AnchorPoint.Value = new Vector2(0.5f, 0.5f);
            MainView.Width.Value       = 400;
            MainView.Height.Value      = 400;

            this.EncompassingView.Add(new Binding <int, Point>(EncompassingView.Height, (p) => p.Y, main.ScreenSize));
            this.EncompassingView.Add(new Binding <int, Point>(EncompassingView.Width, (p) => p.X, main.ScreenSize));
            this.MainView.Add(new Binding <Vector2, int>(MainView.Position, i => new Vector2(i / 2f, MainView.Y), EncompassingView.Width));
            this.MainView.Add(new Binding <Vector2, int>(MainView.Position, i => new Vector2(MainView.X, i / 2f), EncompassingView.Height));

            new TextView(main.GeeUI, MainView, "Workshop entry:", new Vector2(10, 8));
            this.SelectFile = new DropDownView(main.GeeUI, MainView, new Vector2(10, 35));
            SelectFile.AddOption("[Fetching...]", null);
            this.SelectFile.Position.Value = new Vector2(10, 30);

            this.queryResult = SteamWorker.GetCreatedWorkShopEntries((entries) =>
            {
                SelectFile.RemoveAllOptions();
                SelectFile.AddOption("[new]", delegate()
                {
                    this.currentPublishedFile = default(SteamUGCDetails_t);
                    this.UploadButton.Text    = "Publish";
                    this.UploadButton.AllowMouseEvents.Value = true;
                    this.CloseButton.AllowMouseEvents.Value  = true;
                });
                var listEntries = entries as List <SteamUGCDetails_t>;
                if (listEntries == null)
                {
                    SelectFile.AddOption("[Error fetching entries]", null);
                    return;
                }
                foreach (var entry in listEntries)
                {
                    SteamUGCDetails_t entry1 = entry;
                    SelectFile.AddOption(entry.m_rgchTitle, () =>
                    {
                        this.currentPublishedFile = entry1;
                        this.NameView.Text        = entry1.m_rgchTitle;
                        this.DescriptionView.Text = entry1.m_rgchDescription;
                        this.UploadButton.Text    = "Update";
                        this.UploadButton.AllowMouseEvents.Value = true;
                        this.CloseButton.AllowMouseEvents.Value  = true;
                    }, related: entry);
                }
            });

            new TextView(main.GeeUI, MainView, "Name:", new Vector2(10, 68));
            this.NameView = new TextFieldView(main.GeeUI, MainView, new Vector2(10, 85))
            {
                MultiLine = false
            };
            new TextView(main.GeeUI, MainView, "Description:", new Vector2(10, 118));
            this.DescriptionView = new TextFieldView(main.GeeUI, MainView, new Vector2(10, 135));

            this.UploadButton = new ButtonView(main.GeeUI, MainView, "Publish", new Vector2(50, 360));
            this.CloseButton  = new ButtonView(main.GeeUI, MainView, "Close", new Vector2(300, 360));

            var statusString = new TextView(main.GeeUI, MainView, "Waiting", new Vector2(110, 365))
            {
                TextJustification = TextJustification.Center,
            };

            statusString.AutoSize.Value = false;
            statusString.Width.Value    = 190;

            ConfigureTextField(NameView);
            ConfigureTextField(DescriptionView);

            UploadButton.OnMouseClick += (sender, args) =>
            {
                DoUpload();
            };

            CloseButton.OnMouseClick += (sender, args) =>
            {
                this.Delete.Execute();
            };

            this.Add(new Binding <string>(statusString.Text, StatusString));

            base.Awake();
        }
コード例 #31
0
        private string Write21_PanelView(PanelView v)
        {
            switch (v)
            {
                case PanelView.LargeIcon:
                    return "LargeIcon";

                case PanelView.Details:
                    return "Details";

                case PanelView.SmallIcon:
                    return "SmallIcon";

                case PanelView.List:
                    return "List";

                case PanelView.Tile:
                    return "Tile";

                case PanelView.Thumbnail:
                    return "Thumbnail";
            }
            long num = (long) v;
            throw base.CreateInvalidEnumValueException(num.ToString(CultureInfo.InvariantCulture), "Nomad.FileSystem.Virtual.PanelView");
        }