コード例 #1
0
        /// <summary>
        /// 删除已经选择的标签
        /// </summary>
        private void DeleteLabel()
        {
            TreeNode tree = treeView1.SelectedNode;

            if (tree == null)
            {
                return;
            }
            if (tree.Level == 0)
            {
                if (MessageBox.Show("删除父标签将删除所有子标签,是否删除?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return;
                }
                TypeLabel type = Selectlabels.FirstOrDefault(t => t.Name == tree.Text);
                treeView1.Nodes.Remove(tree);
                Selectlabels.Remove(type);
                return;
            }
            else
            {
                TypeLabel type = Selectlabels.FirstOrDefault(t => t.Name == tree.Parent.Text);
                if (tree.Parent.Nodes.Count == 1)
                {
                    Selectlabels.Remove(type);
                    treeView1.Nodes.Remove(tree.Parent);
                    return;
                }
                VideoLabel label = type.Labels.FirstOrDefault(t => t.Name == tree.Text);
                type.Labels.Remove(label);
                treeView1.Nodes.Remove(tree);
            }
        }
コード例 #2
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                TypeImage.AtLeftOf(this, AppDimens.Inset1X),
                TypeImage.AtTopOf(this, AppDimens.Inset1X),
                TypeImage.AtBottomOf(this, AppDimens.Inset1X),
                TypeImage.WithSameCenterY(this),
                TypeImage.Height().EqualTo(AppDimens.DefaultTypeImageSize),
                TypeImage.Width().EqualTo(AppDimens.DefaultTypeImageSize));

            this.AddConstraints(
                DurationLabel.ToRightOf(TypeImage, AppDimens.Inset1X),
                DurationLabel.AtTopOf(TypeImage, AppDimens.InsetHalf));

            this.AddConstraints(
                TypeLabel.ToRightOf(TypeImage, AppDimens.Inset1X),
                TypeLabel.AtBottomOf(TypeImage, AppDimens.InsetHalf));

            this.AddConstraints(
                StatusLabel.AtRightOf(this, AppDimens.Inset1X),
                StatusLabel.WithSameCenterY(this));

            this.AddConstraints(
                Separator.WithSameLeft(DurationLabel),
                Separator.WithSameRight(this),
                Separator.WithSameBottom(this),
                Separator.Height().EqualTo(AppDimens.DefaultSeparatorSize));
        }
コード例 #3
0
 /// <summary>
 /// 选择标签加入已有标签栏
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void label_treeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (label_treeView.SelectedNode.Level != 0)
     {
         TreeNode parentnode = label_treeView.SelectedNode.Parent;
         if (Selectlabels.Count(t => t.Name == parentnode.Text) > 0)
         {
             foreach (TypeLabel tree in Selectlabels)
             {
                 if (tree.Name == parentnode.Text)
                 {
                     if (tree.Labels.Count(t => t.Name == label_treeView.SelectedNode.Text) > 0)
                     {
                         return;
                     }
                     tree.Labels.Add(Methods.GetNodeToVideoLabel(label_treeView.SelectedNode));
                     break;
                 }
             }
         }
         else
         {
             TypeLabel typeLabel = Methods.GetNodeToTypeLabel(parentnode);
             typeLabel.Labels.Add(Methods.GetNodeToVideoLabel(label_treeView.SelectedNode));
             Selectlabels.Add(typeLabel);
         }
         SetLabelText();
     }
 }
コード例 #4
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                IconImageView.AtLeadingOf(this, 13),
                IconImageView.WithSameCenterY(this),
                IconImageView.Width().EqualTo(36),
                IconImageView.Height().EqualTo(36),
                RangeLabel.ToTrailingOf(IconImageView, 16),
                RangeLabel.AtTopOf(this, 16),
                TypeLabel.AtLeadingOf(RangeLabel),
                TypeLabel.Below(RangeLabel),
                ArrowImageView.WithSameCenterY(this),
                ArrowImageView.AtTrailingOf(this, 12),
                ArrowImageView.Width().EqualTo(8),
                ArrowImageView.Height().EqualTo(13),
                StateLabel.ToLeadingOf(ArrowImageView, 6),
                StateLabel.WithSameCenterY(this),
                MainDeviderView.Height().EqualTo(Theme.Dimensions.DeviderWidth),
                MainDeviderView.AtBottomOf(this),
                MainDeviderView.AtTrailingOf(this),
                MainDeviderView.WithSameLeading(RangeLabel),
                LastItemDeviderView.WithSameHeight(MainDeviderView),
                LastItemDeviderView.AtBottomOf(this),
                LastItemDeviderView.AtLeadingOf(this),
                LastItemDeviderView.ToLeadingOf(MainDeviderView));
        }
コード例 #5
0
ファイル: DigitsLabel.cs プロジェクト: lunice/bgo
 public void setValue(int v, AdditionalPrefixSymbols addPrefixSymbols = AdditionalPrefixSymbols.NONE)
 {
     additionalPrefixSymbols = addPrefixSymbols;
     labelWidth = 0;
     //if (!checkOnnegativeBalanceAndShow(v) ) print("Error! Gold value is negative");
     iValue    = v;
     typeLabel = TypeLabel.INT;
     setValue(v.ToString(), iValue);
 }
コード例 #6
0
        void ReleaseDesignerOutlets()
        {
            if (BrandLabel != null)
            {
                BrandLabel.Dispose();
                BrandLabel = null;
            }

            if (BrandTextField != null)
            {
                BrandTextField.Dispose();
                BrandTextField = null;
            }

            if (RegistrationNumberLabel != null)
            {
                RegistrationNumberLabel.Dispose();
                RegistrationNumberLabel = null;
            }

            if (RegistrationNumberTextField != null)
            {
                RegistrationNumberTextField.Dispose();
                RegistrationNumberTextField = null;
            }

            if (TypeLabel != null)
            {
                TypeLabel.Dispose();
                TypeLabel = null;
            }

            if (TypeTextField != null)
            {
                TypeTextField.Dispose();
                TypeTextField = null;
            }

            if (WeightLabel != null)
            {
                WeightLabel.Dispose();
                WeightLabel = null;
            }

            if (WeightTextField != null)
            {
                WeightTextField.Dispose();
                WeightTextField = null;
            }

            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }
        }
コード例 #7
0
        void ReleaseDesignerOutlets()
        {
            if (BrandLabel != null)
            {
                BrandLabel.Dispose();
                BrandLabel = null;
            }

            if (BrandTextField != null)
            {
                BrandTextField.Dispose();
                BrandTextField = null;
            }

            if (MaxTonCapacityLabel != null)
            {
                MaxTonCapacityLabel.Dispose();
                MaxTonCapacityLabel = null;
            }

            if (MaxTonCapacityTextField != null)
            {
                MaxTonCapacityTextField.Dispose();
                MaxTonCapacityTextField = null;
            }

            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }

            if (RegistrationNumberLabel != null)
            {
                RegistrationNumberLabel.Dispose();
                RegistrationNumberLabel = null;
            }

            if (RegistrationNumberTextField != null)
            {
                RegistrationNumberTextField.Dispose();
                RegistrationNumberTextField = null;
            }

            if (TypeLabel != null)
            {
                TypeLabel.Dispose();
                TypeLabel = null;
            }

            if (TypeTextField != null)
            {
                TypeTextField.Dispose();
                TypeTextField = null;
            }
        }
コード例 #8
0
        /// <summary>
        /// 得到选中接的的tag
        /// </summary>
        /// <param name="nodes"></param>
        /// <returns></returns>
        private List <TypeLabel> GetTypeLabels(List <TreeListNode> nodes)
        {
            List <TypeLabel> typeLabels = new List <TypeLabel>();

            foreach (TreeListNode item in nodes)
            {
                TypeLabel label = (TypeLabel)item.Tag;
                typeLabels.Add(label);
            }
            return(typeLabels);
        }
コード例 #9
0
ファイル: DigitsLabel.cs プロジェクト: lunice/bgo
 public void setFloatValue(float v, AdditionalPrefixSymbols addPrefixSymbols = AdditionalPrefixSymbols.NONE)
 {
     additionalPrefixSymbols = addPrefixSymbols;
     labelWidth = 0;
     if (!checkOnNegativeBalanceAndShow(v))
     {
         print("Error! Gold value is negative");
     }
     fValue    = v;
     typeLabel = TypeLabel.FLOAT;
     setValue(v.ToString(), fValue);
 }
コード例 #10
0
 //Активация и Диактивация объектов
 public static void SetActiveLabel(TypeLabel _tl, bool _g)  //лейбл
 {
     for (int i = 0; i < lLabel.Count; i++)
     {
         if (lLabel[i].type == _tl)
         {
             lLabel[i].SetActive(_g);
             return;
         }
     }
     Debug.LogError("Label not found");
 }
コード例 #11
0
 //Присвоение текста
 public static void SetLabelText(TypeLabel _tl, string _str)//Лебл
 {
     for (int i = 0; i < lLabel.Count; i++)
     {
         if (lLabel[i].type == _tl)
         {
             lLabel[i].SetText(_str);
             return;
         }
     }
     Debug.LogError("Label not found");
 }
コード例 #12
0
 //Проверка на активность хз зачем
 public static bool isActive(TypeLabel _tl)//лейбл
 {
     for (int i = 0; i < lLabel.Count; i++)
     {
         if (lLabel[i].type == _tl)
         {
             return(lLabel[i].isActive());
         }
     }
     Debug.LogError("Active:None Label");
     return(false);
 }
コード例 #13
0
        protected virtual void DisplayItem(Option <IEquipment> item)
        {
            _buttonListeners.Clear();

            foreach (var button in ButtonContainer.GetChildren().OfType <Button>())
            {
                button.QueueFree();
            }

            match(from i in item from c in PlayerControl.Character select(item: i, character: c),
                  v =>
            {
                InfoPanel.Visible = true;
                ItemStand.Visible = true;

                ItemStand.Mesh = v.item.Meshes.First().Mesh;

                TitleLabel.Text = v.item.DisplayName;

                TypeLabel.Iter(label => label.Text        = v.item.EquipmentType.DisplayName(Node));
                DescriptionLabel.Iter(label => label.Text = v.item.Description.IfNone(string.Empty));

                ViewControl.Reset();

                var context = new InteractionContext(v.character, v.item);
                var actions = v.character.Actions.Values
                              .OfType <Interaction>()
                              .Where(a => a.Active && a.Valid && a.AllowedFor(context));

                foreach (var action in actions)
                {
                    var button = (Button)ActionButton.Instance();

                    button.Text = action.DisplayName;

                    ButtonContainer.AddChild(button);

                    var listener = button.OnPress().Subscribe(_ => OnButtonPress(action.Key), this);

                    _buttonListeners.Add(listener);
                }
            },
                  () =>
            {
                InfoPanel.Visible = false;
                ItemStand.Visible = false;

                ItemStand.Mesh = null;
            }
                  );
        }
コード例 #14
0
        /// <summary>
        /// 关联变色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeList2_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            TreeListNode node = e.Node;

            if (node.Level == 0)
            {
                TypeLabel typeLabel = (TypeLabel)node.Tag;
                if (typeLabel.Ref == AllLabels.GetSelectIds("车"))
                {
                    e.Appearance.ForeColor = Color.Red;
                }
                else if (typeLabel.Ref == AllLabels.GetSelectIds("人"))
                {
                    e.Appearance.ForeColor = Color.Blue;
                }
                return;
            }
        }
コード例 #15
0
ファイル: NewItem.cs プロジェクト: chosoicute113/HospitalUI
        public NewItem()
        {
            
            InitializeComponent();
            FandWComboBox.Items.Add("Food(Kg)");
            FandWComboBox.Items.Add("Drink(Liter)");
            if (Storage_UI.itemtype == "Equipment")
            {
                ItemDateTimePicker.Hide();
                ExpirationDateLabel.Hide();
                TypeLabel.Hide();
                FandWComboBox.Hide();


            }
            else if(Storage_UI.itemtype == "Medicine")
            {
                TypeLabel.Hide();
                FandWComboBox.Hide();
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }

            if (PilotSwitch != null)
            {
                PilotSwitch.Dispose();
                PilotSwitch = null;
            }

            if (RatingLabel != null)
            {
                RatingLabel.Dispose();
                RatingLabel = null;
            }

            if (RatingPickerView != null)
            {
                RatingPickerView.Dispose();
                RatingPickerView = null;
            }

            if (TypeLabel != null)
            {
                TypeLabel.Dispose();
                TypeLabel = null;
            }

            if (TypePickerView != null)
            {
                TypePickerView.Dispose();
                TypePickerView = null;
            }
        }
コード例 #17
0
ファイル: LensParser.cs プロジェクト: TrickyCat/lens
        /// <summary>
        /// type_stmt                                   = identifier [ "of" type ]
        /// </summary>
        private TypeLabel parseTypeStmt()
        {
            var node = new TypeLabel();

            node.Name = ensure(LexemType.Identifier, ParserMessages.TypeLabelIdentifierExpected).Value;
            if (check(LexemType.Of))
                node.TagType = ensure(parseType, ParserMessages.TypeLabelTagTypeExpected);

            return node;
        }
コード例 #18
0
        void ReleaseDesignerOutlets()
        {
            if (AddObservationView != null)
            {
                AddObservationView.Dispose();
                AddObservationView = null;
            }

            if (AttachmentContentView != null)
            {
                AttachmentContentView.Dispose();
                AttachmentContentView = null;
            }

            if (CheckButton != null)
            {
                CheckButton.Dispose();
                CheckButton = null;
            }

            if (ConfidentialConteinerView != null)
            {
                ConfidentialConteinerView.Dispose();
                ConfidentialConteinerView = null;
            }

            if (ConstraintHeightObservationContentView != null)
            {
                ConstraintHeightObservationContentView.Dispose();
                ConstraintHeightObservationContentView = null;
            }

            if (CreateObservationButton != null)
            {
                CreateObservationButton.Dispose();
                CreateObservationButton = null;
            }

            if (DateLabel != null)
            {
                DateLabel.Dispose();
                DateLabel = null;
            }

            if (DetailLabel != null)
            {
                DetailLabel.Dispose();
                DetailLabel = null;
            }

            if (EditButton != null)
            {
                EditButton.Dispose();
                EditButton = null;
            }

            if (HeightAddObservationConstraint != null)
            {
                HeightAddObservationConstraint.Dispose();
                HeightAddObservationConstraint = null;
            }

            if (HeightAttachmentConstraint != null)
            {
                HeightAttachmentConstraint.Dispose();
                HeightAttachmentConstraint = null;
            }

            if (HeightConfidentialConteinerConstraint != null)
            {
                HeightConfidentialConteinerConstraint.Dispose();
                HeightConfidentialConteinerConstraint = null;
            }

            if (HeightSectionConteinerViewConstraint != null)
            {
                HeightSectionConteinerViewConstraint.Dispose();
                HeightSectionConteinerViewConstraint = null;
            }

            if (ObservationContentView != null)
            {
                ObservationContentView.Dispose();
                ObservationContentView = null;
            }

            if (ObservationTextView != null)
            {
                ObservationTextView.Dispose();
                ObservationTextView = null;
            }

            if (PlaceLabel != null)
            {
                PlaceLabel.Dispose();
                PlaceLabel = null;
            }

            if (SectionConteinerView != null)
            {
                SectionConteinerView.Dispose();
                SectionConteinerView = null;
            }

            if (SectionTextField != null)
            {
                SectionTextField.Dispose();
                SectionTextField = null;
            }

            if (StatusLabel != null)
            {
                StatusLabel.Dispose();
                StatusLabel = null;
            }

            if (TagLabel != null)
            {
                TagLabel.Dispose();
                TagLabel = null;
            }

            if (TitleEventLabel != null)
            {
                TitleEventLabel.Dispose();
                TitleEventLabel = null;
            }

            if (TopAttachmentContentConstraint != null)
            {
                TopAttachmentContentConstraint.Dispose();
                TopAttachmentContentConstraint = null;
            }

            if (TopConfidentialContainerConstraint != null)
            {
                TopConfidentialContainerConstraint.Dispose();
                TopConfidentialContainerConstraint = null;
            }

            if (TopSectionConteinerViewConstraint != null)
            {
                TopSectionConteinerViewConstraint.Dispose();
                TopSectionConteinerViewConstraint = null;
            }

            if (TypeLabel != null)
            {
                TypeLabel.Dispose();
                TypeLabel = null;
            }

            if (ViewTagConteiner != null)
            {
                ViewTagConteiner.Dispose();
                ViewTagConteiner = null;
            }
        }