Exemple #1
0
        public EditPlaylistElementProperties()
        {
            this.Build();

            sizegroupLeft = new SizeGroup(SizeGroupMode.Horizontal);
            sizegroupLeft.IgnoreHidden = false;
            foreach (Widget w in vbox2.Children)
            {
                foreach (Widget t in (w as Table).Children)
                {
                    if ((t is Label))
                    {
                        t.ModifyFont(FontDescription.FromString(App.Current.Style.Font + " 10"));
                        sizegroupLeft.AddWidget(t);
                    }
                }
            }

            sizegroupRight = new SizeGroup(SizeGroupMode.Horizontal);
            sizegroupRight.IgnoreHidden = false;
            foreach (Widget w in vbox2.Children)
            {
                foreach (Widget t in (w as Table).Children)
                {
                    if (!(t is Label))
                    {
                        sizegroupRight.AddWidget(t);
                    }
                }
            }
            buttonOk.Clicked += HandleButtonOkClicked;
            Bind();
        }
Exemple #2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            try
            {
                if (e.RowIndex >= 0 && e.ColumnIndex >= 0 && !dataGridView1.Rows[e.RowIndex].IsNewRow)
                {
                    DataGridView view = (DataGridView)sender;
                    SizeGroup    item = (SizeGroup)dataGridView1.Rows[e.RowIndex].DataBoundItem;

                    if (e.ColumnIndex == enabledDataGridViewCheckBoxColumn.Index)
                    {
                        item.Enabled = !item.Enabled;
                        DoEnable(item);
                    }
                    else if (e.ColumnIndex == ColumnEdit.Index)
                    {
                        Edit(item);
                    }
                    else if (e.ColumnIndex == ColumnDelete.Index)
                    {
                        Removed(item);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonGlobalUtil.ShowError(ex);
            }
        }
        void FillTags(LMProject project, LMTimelineEventVM eventVM)
        {
            Dictionary <string, List <Tag> > tagsByGroup;
            SizeGroup sgroup = new SizeGroup(SizeGroupMode.Horizontal);

            if (eventVM.EventType is AnalysisEventType)
            {
                tagsByGroup = (eventVM.EventType as AnalysisEventType).TagsByGroup;
            }
            else
            {
                tagsByGroup = new Dictionary <string, List <Tag> > ();
            }

            tagsvbox.PackStart(new HSeparator());
            foreach (var kv in project.Dashboard.CommonTagsByGroup)
            {
                AddTagsGroup(eventVM, kv.Key, kv.Value, sgroup);
            }
            foreach (var kv in tagsByGroup)
            {
                AddTagsGroup(eventVM, kv.Key, kv.Value, sgroup);
            }
            tagsvbox.ShowAll();
        }
Exemple #4
0
        internal DialogResult ShowDialog(SizeGroup item, bool readOnly)
        {
            this.readOnly = readOnly;
            this.CurItem  = item;
            Display();

            return(this.ShowDialog());
        }
Exemple #5
0
        public static Gtk.Window Create()
        {
            window           = new Dialog();
            window.Title     = "Sized groups";
            window.Resizable = false;

            VBox vbox = new VBox(false, 5);

            window.VBox.PackStart(vbox, true, true, 0);
            vbox.BorderWidth = 5;

            size_group = new SizeGroup(SizeGroupMode.Horizontal);

            Frame frame = new Frame("Color Options");

            vbox.PackStart(frame, true, true, 0);

            Table table = new Table(2, 2, false);

            table.BorderWidth   = 5;
            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;
            frame.Add(table);

            string [] colors = { "Red", "Green", "Blue", };
            string [] dashes = { "Solid", "Dashed", "Dotted", };
            string [] ends   = { "Square", "Round", "Arrow", };

            Add_Row(table, 0, size_group, "_Foreground", colors);
            Add_Row(table, 1, size_group, "_Background", colors);

            frame = new Frame("Line Options");
            vbox.PackStart(frame, false, false, 0);

            table               = new Table(2, 2, false);
            table.BorderWidth   = 5;
            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;
            frame.Add(table);

            Add_Row(table, 0, size_group, "_Dashing", dashes);
            Add_Row(table, 1, size_group, "_Line ends", ends);

            CheckButton check_button = new CheckButton("_Enable grouping");

            vbox.PackStart(check_button, false, false, 0);
            check_button.Active   = true;
            check_button.Toggled += new EventHandler(Button_Toggle_Cb);

            Button close_button = new Button(Stock.Close);

            close_button.Clicked += new EventHandler(Close_Button);
            window.ActionArea.PackStart(close_button, false, false, 0);

            window.ShowAll();
            return(window);
        }
Exemple #6
0
        private void Edit(SizeGroup item)
        {
            SizeGroupEditForm form = new SizeGroupEditForm();

            if (form.ShowDialog(item, false) == DialogResult.OK)
            {
                RefreshPage();
            }
        }
Exemple #7
0
        void AddTagsGroup(LMTimelineEvent evt, string grp, List <Tag> tags, SizeGroup sgroup)
        {
            HBox        box       = new HBox();
            Label       label     = new Label(String.IsNullOrEmpty(grp) ? Catalog.GetString("Common tags") : grp);
            Table       tagstable = new Table((uint)(tags.Count / TAGS_PER_ROW), TAGS_PER_ROW, true);
            RadioButton first     = null;
            Tag         noneTag   = new Tag(Catalog.GetString("None"));

            label.WidthRequest = 200;
            if (!String.IsNullOrEmpty(grp))
            {
                tags.Insert(0, noneTag);
            }
            for (int i = 0; i < tags.Count; i++)
            {
                uint        row_top, row_bottom, col_left, col_right;
                Tag         t = tags [i];
                CheckButton tb;
                if (String.IsNullOrEmpty(grp))
                {
                    tb = new CheckButton(t.Value);
                }
                else
                {
                    if (first == null)
                    {
                        tb = first = new RadioButton(t.Value);
                    }
                    else
                    {
                        tb = new RadioButton(first, t.Value);
                    }
                }
                tb.Active   = evt.Tags.Contains(t);
                tb.Toggled += (sender, e) => {
                    if (tb.Active && t != noneTag)
                    {
                        evt.Tags.Add(t);
                    }
                    else
                    {
                        evt.Tags.Remove(t);
                    }
                };
                row_top    = (uint)(i / tagstable.NColumns);
                row_bottom = (uint)row_top + 1;
                col_left   = (uint)i % tagstable.NColumns;
                col_right  = (uint)col_left + 1;
                tagstable.Attach(tb, col_left, col_right, row_top, row_bottom);
            }
            sgroup.AddWidget(label);
            box.PackStart(label, false, true, 0);
            box.PackEnd(tagstable, true, true, 0);
            box.Spacing = 5;
            tagsvbox.PackStart(box, false, true, 0);
            tagsvbox.PackStart(new HSeparator());
        }
        public CategoryProperties()
        {
            this.Build();
            nameentry.Changed           += HandleNameentryChanged;
            colorbutton1.ColorSet       += HandleColorSet;
            textcolorbutton.ColorSet    += HandleColorSet;
            tagmodecombobox.Changed     += HandleTagModeChanged;
            tagscheckbutton.Toggled     += HandleTagsToggled;
            tprbutton.ValueChanged      += HandleTagsPerRowValueChanged;
            leadtimebutton.ValueChanged += HandleLeadTimeChanged;
            lagtimebutton.ValueChanged  += HandleLagTimeChanged;
            changebuton.Clicked         += HandleChangeHotkey;
            sortmethodcombobox.Changed  += HandleSortMethodChanged;
            fieldcombobox.Changed       += HandlePositionChanged;
            hfieldcombobox.Changed      += HandlePositionChanged;
            goalcombobox.Changed        += HandlePositionChanged;
            shapecombobox.Changed       += HandleShapeChanged;
            pointsbutton.Changed        += HandlePointsChanged;
            teamcombobox.Changed        += HandleTeamChanged;
            groupentry.Changed          += HandleGroupChanged;

            postable.NoShowAll   = true;
            cattable.NoShowAll   = true;
            scoretable.NoShowAll = true;

            sizegroupLeft = new SizeGroup(SizeGroupMode.Horizontal);
            sizegroupLeft.IgnoreHidden = false;
            foreach (Widget w in vbox3.Children)
            {
                foreach (Widget t in (w as Table).Children)
                {
                    if ((t is Label))
                    {
                        t.ModifyFont(FontDescription.FromString(Config.Style.Font + " 10"));
                        sizegroupLeft.AddWidget(t);
                    }
                }
            }

            sizegroupRight = new SizeGroup(SizeGroupMode.Horizontal);
            sizegroupRight.IgnoreHidden = false;
            foreach (Widget w in vbox3.Children)
            {
                foreach (Widget t in (w as Table).Children)
                {
                    if (!(t is Label))
                    {
                        sizegroupRight.AddWidget(t);
                    }
                }
            }

            Tagger = null;

            UpdateGui();
        }
Exemple #9
0
 void GroupLabels()
 {
     sg = new SizeGroup(SizeGroupMode.Horizontal);
     sg.AddWidget(urilabel);
     sg.AddWidget(outputfilelabel);
     sg.AddWidget(device);
     sg.AddWidget(videoformatlabel);
     sg.AddWidget(deviceformatlabel);
     sg.AddWidget(outputsizelabel);
 }
Exemple #10
0
        void Create()
        {
            // Check if some additional tools are available that should be added to our buttons list
            Populate();

            sizegroup = new SizeGroup(SizeGroupMode.Horizontal);

            Gtk.Image prefImage = new Gtk.Image(
                Helpers.Misc.LoadIcon("lm-preferences",
                                      Sizes.WelcomeIconSize, 0));
            preferencesbutton.Add(prefImage);

            preferencesbutton.WidthRequest  = Sizes.WelcomeIconSize;
            preferencesbutton.HeightRequest = Sizes.WelcomeIconSize;

            // Our logo
            logoImage = new ImageView();

            Image text = App.Current.ResourcesLocator.LoadImage("images/logo/lm-text.svg");

            textImage = new ImageView(text);

            logoBox = new HBox();
            logoBox.Add(logoImage);
            logoBox.Add(textImage);

            //Adding the title
            vbox2.Add(logoBox);

            //Create necessary Hboxes for all icons
            List <HBox> hboxList = new List <HBox> ();

            for (int i = 0; i < NRows; i++)
            {
                Alignment al = new Alignment(0.5F, 0.5F, 0, 0);
                hboxList.Add(new HBox(true, Sizes.WelcomeIconsHSpacing));
                al.Add(hboxList [i]);
                vbox2.Add(al);
            }

            int hboxRow = 0;

            for (uint i = 0; i < buttons.Count; i++)
            {
                Widget b;
                if (i >= Sizes.WelcomeIconsFirstRow && hboxRow == 0)
                {
                    hboxRow++;
                }
                b = CreateButton(buttons [(int)i]);
                hboxList [hboxRow].Add(b);
            }

            ShowAll();
        }
 public GameDescriptionHeader()
 {
     this.Build();
     SetStyle();
     namesGroup = new SizeGroup(SizeGroupMode.Horizontal);
     namesGroup.AddWidget(homenamelabel);
     namesGroup.AddWidget(awaynamelabel);
     scoreGroup = new SizeGroup(SizeGroupMode.Horizontal);
     scoreGroup.AddWidget(homescorelabel);
     scoreGroup.AddWidget(awayscorelabel);
 }
Exemple #12
0
 public void Display(Costume costumeItem)
 {
     try
     {
         if (costumeItem != null)
         {
             SizeGroup sizeGroup = CommonGlobalCache.GetSizeGroup(costumeItem.SizeGroupName);
         }
     }
     catch (Exception ex)
     {
         GlobalUtil.ShowError(ex);
     }
 }
Exemple #13
0
        public HotkeysConfiguration()
        {
            int i = 0;

            this.Build();

            sgroup = new SizeGroup(SizeGroupMode.Horizontal);
            foreach (KeyAction action in App.Current.Config.Hotkeys.ActionsDescriptions.Keys)
            {
                AddWidget(action, App.Current.Config.Hotkeys.ActionsDescriptions [action],
                          App.Current.Config.Hotkeys.ActionsHotkeys [action], i);
                i++;
            }
        }
        private void ChangeCheckBoxNamesAndState()
        {
            SizeGroup sizeGroup = skinComboBoxSizeGroup.SelectedItem as SizeGroup;

            int index = 0;

            foreach (var sizeName in CostumeStoreHelper.CostumeSizeColumn)
            {
                CheckBox box = this.panel1.Controls[index++] as CheckBox;
                box.Checked = false;
                box.Text    = ReflectUtil.GetModelValue("NameOf" + sizeName, sizeGroup);
                box.Tag     = sizeName;
            }
        }
Exemple #15
0
        protected override void OnDestroyed()
        {
            Log.Verbose($"Destroying {GetType ()}");

            ctx.Dispose();
            ctx = null;
            sizegroupLeft.Dispose();
            sizegroupLeft = null;
            sizegroupRight.Dispose();
            sizegroupRight = null;
            base.OnDestroyed();

            Disposed = true;
        }
Exemple #16
0
 public static string GetCostumeSize2(string sizeName, SizeGroup sizeGroup)
 {
     //sizeName = sizeName.ToUpper();
     if (sizeName == sizeGroup.NameOfF)
     {
         return(CostumeSize.F);
     }
     if (sizeName == sizeGroup.NameOfXS)
     {
         return(CostumeSize.XS);
     }
     if (sizeName == sizeGroup.NameOfS)
     {
         return(CostumeSize.S);
     }
     if (sizeName == sizeGroup.NameOfM)
     {
         return(CostumeSize.M);
     }
     if (sizeName == sizeGroup.NameOfL)
     {
         return(CostumeSize.L);
     }
     if (sizeName == sizeGroup.NameOfXL)
     {
         return(CostumeSize.XL);
     }
     if (sizeName == sizeGroup.NameOfXL2)
     {
         return(CostumeSize.XL2);
     }
     if (sizeName == sizeGroup.NameOfXL3)
     {
         return(CostumeSize.XL3);
     }
     if (sizeName == sizeGroup.NameOfXL4)
     {
         return(CostumeSize.XL4);
     }
     if (sizeName == sizeGroup.NameOfXL5)
     {
         return(CostumeSize.XL5);
     }
     if (sizeName == sizeGroup.NameOfXL6)
     {
         return(CostumeSize.XL6);
     }
     return(null);
 }
Exemple #17
0
        public DemoSizeGroup() : base("SizeGroup", null, DialogFlags.DestroyWithParent,
                                      Gtk.Stock.Close, Gtk.ResponseType.Close)
        {
            Resizable = false;

            VBox vbox = new VBox(false, 5);

            this.ContentArea.PackStart(vbox, true, true, 0);
            vbox.BorderWidth = 5;

            sizeGroup = new SizeGroup(SizeGroupMode.Horizontal);

            // Create one frame holding color options
            Frame frame = new Frame("Color Options");

            vbox.PackStart(frame, true, true, 0);

            Table table = new Table(2, 2, false);

            table.BorderWidth   = 5;
            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;
            frame.Add(table);

            AddRow(table, 0, sizeGroup, "_Foreground", colors);
            AddRow(table, 1, sizeGroup, "_Background", colors);

            // And another frame holding line style options
            frame = new Frame("Line Options");
            vbox.PackStart(frame, false, false, 0);

            table               = new Table(2, 2, false);
            table.BorderWidth   = 5;
            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;
            frame.Add(table);

            AddRow(table, 0, sizeGroup, "_Dashing", dashes);
            AddRow(table, 1, sizeGroup, "_Line ends", ends);

            // And a check button to turn grouping on and off
            CheckButton checkButton = new CheckButton("_Enable grouping");

            vbox.PackStart(checkButton, false, false, 0);
            checkButton.Active   = true;
            checkButton.Toggled += new EventHandler(ToggleGrouping);

            ShowAll();
        }
Exemple #18
0
        public static void SetSizeName4CostumeStore(CostumeStore costumeStore, SizeGroup sizeGroup)
        {
            List <CostumeStoreInfo> infos = new List <CostumeStoreInfo>();

            foreach (string sizeColumn in costumeSizeColumn)
            {
                infos.Add(new CostumeStoreInfo()
                {
                    OriginalSizeName = sizeColumn,
                    SizeName         = GetCostumeSizeName(sizeColumn, sizeGroup),
                    Count            = GetStoreCountBySize(costumeStore, sizeColumn)
                });
            }
            costumeStore.CostumeStoreInfos = infos;
        }
Exemple #19
0
        static void Toggle_Grouping(ToggleButton check_button,
                                    SizeGroup size_group)
        {
            SizeGroupMode mode;

            if (check_button.Active)
            {
                mode = SizeGroupMode.Horizontal;
            }
            else
            {
                mode = SizeGroupMode.None;
            }

            size_group.Mode = mode;
        }
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;

            if (menuItem != null && menuItem.Tag != null)
            {
                if (menuItem.Tag is SizeGroup)
                {
                    sizeGroup = menuItem.Tag as SizeGroup;
                    //  menuItem.Owner;
                    CommonGlobalUtil.ChangeSizeGroup(view, sizeGroup, false);
                    SizeGroupChanged?.Invoke(sizeGroup, view);
                    return;
                }
            }
        }
Exemple #21
0
        private void skinComboBox_Size_DropDown(object sender, EventArgs e)
        {
            // 730 库存变化查询页面:颜色、尺码根据是否有输入款号来显示选择项。
            SizeGroup sizeGroup = CommonGlobalCache.DefaultSizeGroup;

            if (!String.IsNullOrEmpty(this.costumeTextBox1.Text))
            {
                Costume costume = CommonGlobalCache.GetCostume(this.costumeTextBox1.Text);
                sizeGroup = CommonGlobalCache.GetSizeGroup(costume?.SizeGroupName);
                CommonGlobalUtil.SetCostumeSize(this.skinComboBox_Size, costume, sizeGroup, true);
            }
            else
            {
                CommonGlobalUtil.SetCostumeSize(this.skinComboBox_Size, null, sizeGroup, true, false);
            }
        }
Exemple #22
0
        /// <summary>
        /// 尺码转 尺码别名
        /// </summary>
        /// <param name="sizeColumn"></param>
        /// <param name="sizeGroup"></param>
        /// <returns></returns>
        public static string GetCostumeSizeName(string sizeColumn, SizeGroup sizeGroup)
        {
            sizeColumn = sizeColumn?.ToUpper();
            if (sizeGroup == null)
            {
                return(sizeColumn);
            }
            switch (sizeColumn)
            {
            case CostumeSize.F:
                return(sizeGroup.NameOfF);

            case CostumeSize.XS:
                return(sizeGroup.NameOfXS);

            case CostumeSize.S:
                return(sizeGroup.NameOfS);

            case CostumeSize.M:
                return(sizeGroup.NameOfM);

            case CostumeSize.L:
                return(sizeGroup.NameOfL);

            case CostumeSize.XL:
                return(sizeGroup.NameOfXL);

            case CostumeSize.XL2:
                return(sizeGroup.NameOfXL2);

            case CostumeSize.XL3:
                return(sizeGroup.NameOfXL3);

            case CostumeSize.XL4:
                return(sizeGroup.NameOfXL4);

            case CostumeSize.XL5:
                return(sizeGroup.NameOfXL5);

            case CostumeSize.XL6:
                return(sizeGroup.NameOfXL6);

            default:
                return(sizeColumn);
            }
        }
Exemple #23
0
        private bool Validate(SizeGroup item)
        {
            bool success = true;

            if (String.IsNullOrEmpty(this.textBoxSizeGroupName.Text))
            {
                textBoxSizeGroupName.Focus();
                success = false;
                GlobalMessageBox.Show("尺码组名称不能为空!");
            }
            else if (ValidateUtil.InputOutOfLimit(this.textBoxSizeGroupName.Text, "尺码组名称", 20))
            {
                textBoxSizeGroupName.Focus();
                success = false;
                GlobalMessageBox.Show("尺码组名称不能为空!");
            }

            return(success);
        }
        void ApplyStyle()
        {
            /* Keep the central box aligned in the center of the widget */
            SizeGroup grp = new SizeGroup(SizeGroupMode.Horizontal);

            grp.AddWidget(lefttable);
            grp.AddWidget(righttable);

            centerbox.WidthRequest          = StyleConf.NewTeamsComboWidth * 2 + StyleConf.NewTeamsSpacing;
            lefttable.RowSpacing            = outputfiletable.RowSpacing =
                righttable.RowSpacing       = StyleConf.NewTableHSpacing;
            lefttable.ColumnSpacing         = righttable.ColumnSpacing = StyleConf.NewTableHSpacing;
            vsimage.WidthRequest            = StyleConf.NewTeamsSpacing;
            hometeamscombobox.WidthRequest  = awayteamscombobox.WidthRequest = StyleConf.NewTeamsComboWidth;
            hometeamscombobox.HeightRequest = awayteamscombobox.HeightRequest = StyleConf.NewTeamsComboHeight;
            hometeamscombobox.WrapWidth     = awayteamscombobox.WrapWidth = 1;
            homealignment.Xscale            = awayalignment.Xscale = 0;
            homealignment.Xalign            = 0.8f;
            awayalignment.Xalign            = 0.2f;
        }
Exemple #25
0
        static void Add_Row(Table table, uint row, SizeGroup size_group,
                            string label_text, string [] options)
        {
            Label label = new Label(label_text);

            label.SetAlignment(0, 1);

            table.Attach(label,
                         0, 1, row, row + 1,
                         AttachOptions.Expand, AttachOptions.Fill,
                         0, 0);

            ComboBox combo_box = Create_ComboBox(options);

            size_group.AddWidget(combo_box);
            table.Attach(combo_box,
                         1, 2, row, row + 1,
                         AttachOptions.Expand, AttachOptions.Expand,
                         0, 0);
        }
Exemple #26
0
        void Create()
        {
            // One extra row for our logo
            tablewidget.NRows    = (uint)NRows + 1;
            tablewidget.NColumns = StyleConf.WelcomeIconsPerRow;
            sizegroup            = new SizeGroup(SizeGroupMode.Horizontal);

            Gtk.Image prefImage = new Gtk.Image(
                Helpers.Misc.LoadIcon("longomatch-preferences",
                                      StyleConf.WelcomeIconSize, 0));
            preferencesbutton.Add(prefImage);
            preferencesbutton.WidthRequest  = StyleConf.WelcomeIconSize;
            preferencesbutton.HeightRequest = StyleConf.WelcomeIconSize;

            // Our logo
            logoImage        = new Gtk.Image();
            logoImage.Pixbuf = Config.Background.Scale(StyleConf.WelcomeLogoWidth,
                                                       StyleConf.WelcomeLogoHeight).Value;
            logoImage.WidthRequest  = StyleConf.WelcomeLogoWidth;
            logoImage.HeightRequest = StyleConf.WelcomeLogoHeight;
            tablewidget.Attach(logoImage, 0, StyleConf.WelcomeIconsPerRow, 0, 1,
                               AttachOptions.Expand | AttachOptions.Fill,
                               AttachOptions.Expand | AttachOptions.Fill,
                               0, StyleConf.WelcomeIconsVSpacing / 2);

            for (uint i = 0; i < buttons.Length; i++)
            {
                Widget b;
                uint   c, l;

                c = i % StyleConf.WelcomeIconsPerRow;
                l = i / StyleConf.WelcomeIconsPerRow + 1;

                b = CreateButton(buttons [i]);
                tablewidget.Attach(b, c, c + 1, l, l + 1,
                                   AttachOptions.Expand | AttachOptions.Fill,
                                   AttachOptions.Expand | AttachOptions.Fill,
                                   0, StyleConf.WelcomeIconsVSpacing / 2);
                buttonWidgets.Add(b);
            }
        }
Exemple #27
0
        private void AddRow(Table table, uint row, SizeGroup sizeGroup, string labelText, string [] options)
        {
            Label label = new Label(labelText);

            label.SetAlignment(0, 1);

            table.Attach(label,
                         0, 1, row, row + 1,
                         AttachOptions.Expand | AttachOptions.Fill, 0,
                         0, 0);

            ComboBox combo = CreateComboBox(options);

            label.MnemonicWidget = combo;

            sizeGroup.AddWidget(combo);
            table.Attach(combo,
                         1, 2, row, row + 1,
                         0, 0,
                         0, 0);
        }
Exemple #28
0
        private void DoEnable(SizeGroup item)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                EnabledSizeGroupPara para = new EnabledSizeGroupPara()
                {
                    SizeGroupName = item.SizeGroupName,
                    Enabled       = item.Enabled
                };
                InteractResult result = CommonGlobalCache.ServerProxy.EnabledSizeGroup(para);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    break;

                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    item.Enabled = !item.Enabled;
                    dataGridView1.RefreshEdit();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
Exemple #29
0
        private void Removed(SizeGroup item)
        {
            try
            {
                if (CommonGlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                if (GlobalMessageBox.Show("确定删除吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    String         sizeGroupName = item.SizeGroupName;
                    InteractResult result        = GlobalCache.ServerProxy.DeleteSizeGroup(sizeGroupName);
                    switch (result.ExeResult)
                    {
                    case ExeResult.Success:
                        GlobalCache.DeleteSizeGroup(sizeGroupName);
                        RefreshPage();
                        break;

                    case ExeResult.Error:
                        GlobalMessageBox.Show(result.Msg);
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ee)
            {
                ShowError(ee);
            }
            finally
            {
                UnLockPage();
            }
        }
        public EditPlaylistElementProperties(Window parent, IPlaylistElement element)
        {
            TransientFor = parent;
            this.Build();

            sizegroupLeft = new SizeGroup(SizeGroupMode.Horizontal);
            sizegroupLeft.IgnoreHidden = false;
            foreach (Widget w in vbox2.Children)
            {
                foreach (Widget t in (w as Table).Children)
                {
                    if ((t is Label))
                    {
                        t.ModifyFont(FontDescription.FromString(App.Current.Style.Font + " 10"));
                        sizegroupLeft.AddWidget(t);
                    }
                }
            }

            sizegroupRight = new SizeGroup(SizeGroupMode.Horizontal);
            sizegroupRight.IgnoreHidden = false;
            foreach (Widget w in vbox2.Children)
            {
                foreach (Widget t in (w as Table).Children)
                {
                    if (!(t is Label))
                    {
                        sizegroupRight.AddWidget(t);
                    }
                }
            }

            PlaylistElement = element;
            durationspinbutton.ValueChanged += HandleDurationChanged;
            nameentry.Changed += HandleNameChanged;
        }