예제 #1
0
        public void Init()
        {
            if (Device.OS == TargetPlatform.iOS) {
                var list = new EditableListView<Object> ();
                list.SetBinding (EditableListView<Object>.SourceProperty, "JellyBeanValues");
                list.ViewType = typeof(JellyBeanListViewCell);
                list.CellHeight = 60;
                list.AddRowCommand = new Command (() => {
                    this.DisplayAlert ("Sorry", "Not implemented yet!", "OK");
                });

                if (PageModel.JellyBeanValues != null)
                    list.Source = PageModel.JellyBeanValues;
                Content = list;
            } else {
                var list = new ListView();
                list.SetBinding (ListView.ItemsSourceProperty, "JellyBeanValues");
                var celltemp = new DataTemplate(typeof(TextCell));
                celltemp.SetBinding (TextCell.TextProperty, "Name");
                celltemp.SetBinding (TextCell.DetailProperty, "ReadableValues");
                list.ItemTemplate = celltemp;
                if (PageModel.JellyBeanValues != null)
                    list.ItemsSource = PageModel.JellyBeanValues;
                Content = list;
            }

            ToolbarItems.Add(new ToolbarItem("Add", "", () => {
                this.DisplayAlert("Sorry", "Not implemented yet!", "OK");
            }));
        }
 private void Bind(EditableListView <T> newElement)
 {
     if (newElement != null)
     {
         newElement.PropertyChanged          += ElementPropertyChanged;
         newElement.Source.CollectionChanged += DataCollectionChanged;
     }
 }
 private void Unbind(EditableListView <T> oldElement)
 {
     if (oldElement != null)
     {
         oldElement.PropertyChanged          -= ElementPropertyChanged;
         oldElement.Source.CollectionChanged += DataCollectionChanged;
     }
 }
예제 #4
0
 public void Init()
 {
     var list = new EditableListView<Object> ();
     list.SetBinding (ListView.ItemsSourceProperty, "JellyBeanGraphData");
     list.ViewType = typeof(ManageGraphCustomView);
     if (PageModel.JellyBeanGraphData != null)
         list.Source = PageModel.JellyBeanGraphData;
     Content = list;
 }
예제 #5
0
        public void Init()
        {
            var list = new EditableListView <Object> ();

            list.SetBinding(ListView.ItemsSourceProperty, "JellyBeanGraphData");
            list.ViewType = typeof(ManageGraphCustomView);
            if (PageModel.JellyBeanGraphData != null)
            {
                list.Source = PageModel.JellyBeanGraphData;
            }
            Content = list;
        }
예제 #6
0
        public void Init()
        {
            if (Device.OS == TargetPlatform.iOS)
            {
                var list = new EditableListView <Object> ();
                list.SetBinding(EditableListView <Object> .SourceProperty, "JellyBeanValues");
                list.ViewType      = typeof(JellyBeanListViewCell);
                list.CellHeight    = 60;
                list.AddRowCommand = new Command(() => {
                    this.DisplayAlert("Sorry", "Not implemented yet!", "OK");
                });

                if (PageModel.JellyBeanValues != null)
                {
                    list.Source = PageModel.JellyBeanValues;
                }
                Content = list;
            }
            else
            {
                var list = new ListView();
                list.SetBinding(ListView.ItemsSourceProperty, "JellyBeanValues");
                var celltemp = new DataTemplate(typeof(TextCell));
                celltemp.SetBinding(TextCell.TextProperty, "Name");
                celltemp.SetBinding(TextCell.DetailProperty, "ReadableValues");
                list.ItemTemplate = celltemp;
                if (PageModel.JellyBeanValues != null)
                {
                    list.ItemsSource = PageModel.JellyBeanValues;
                }
                Content = list;
            }

            ToolbarItems.Add(new ToolbarItem("Add", "", () => {
                this.DisplayAlert("Sorry", "Not implemented yet!", "OK");
            }));
        }
예제 #7
0
 private void InitializeComponent()
 {
     System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Predefined Properties", System.Windows.Forms.HorizontalAlignment.Left);
     System.Windows.Forms.ListViewGroup listViewGroup4 = new System.Windows.Forms.ListViewGroup("Custom Properties", System.Windows.Forms.HorizontalAlignment.Left);
     System.Windows.Forms.ListViewItem  listViewItem3  = new System.Windows.Forms.ListViewItem(new string[] {
         "",
         "Location",
         "50,50"
     }, -1);
     System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem(new string[] {
         "",
         "Collision",
         "true"
     }, -1);
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PropertyPane));
     this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
     this._propertyList       = new Treefrog.Windows.Controls.WinEx.EditableListView();
     this._colLabel           = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this._colName            = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this._colValue           = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.toolStrip1          = new System.Windows.Forms.ToolStrip();
     this._buttonAddProp      = new System.Windows.Forms.ToolStripButton();
     this._buttonRemoveProp   = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.toolStripTextBox1   = new System.Windows.Forms.ToolStripTextBox();
     this.toolStripContainer1.ContentPanel.SuspendLayout();
     this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
     this.toolStripContainer1.SuspendLayout();
     this.toolStrip1.SuspendLayout();
     this.SuspendLayout();
     //
     // toolStripContainer1
     //
     //
     // toolStripContainer1.ContentPanel
     //
     this.toolStripContainer1.ContentPanel.Controls.Add(this._propertyList);
     this.toolStripContainer1.ContentPanel.Margin = new System.Windows.Forms.Padding(0);
     this.toolStripContainer1.ContentPanel.Size   = new System.Drawing.Size(239, 264);
     this.toolStripContainer1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
     this.toolStripContainer1.Margin   = new System.Windows.Forms.Padding(0);
     this.toolStripContainer1.Name     = "toolStripContainer1";
     this.toolStripContainer1.Size     = new System.Drawing.Size(239, 289);
     this.toolStripContainer1.TabIndex = 0;
     this.toolStripContainer1.Text     = "toolStripContainer1";
     //
     // toolStripContainer1.TopToolStripPanel
     //
     this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1);
     //
     // _propertyList
     //
     this._propertyList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this._colLabel,
         this._colName,
         this._colValue
     });
     this._propertyList.Dock = System.Windows.Forms.DockStyle.Fill;
     this._propertyList.DoubleClickActivation = true;
     this._propertyList.FullRowSelect         = true;
     listViewGroup3.Header = "Special Properties";
     listViewGroup3.Name   = "_groupPredef";
     listViewGroup4.Header = "Custom Properties";
     listViewGroup4.Name   = "_groupCustom";
     this._propertyList.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
         listViewGroup3,
         listViewGroup4
     });
     this._propertyList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
     listViewItem3.Group            = listViewGroup3;
     listViewItem4.Group            = listViewGroup4;
     this._propertyList.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
         listViewItem3,
         listViewItem4
     });
     this._propertyList.Location    = new System.Drawing.Point(0, 0);
     this._propertyList.Margin      = new System.Windows.Forms.Padding(0);
     this._propertyList.MultiSelect = false;
     this._propertyList.Name        = "_propertyList";
     this._propertyList.Size        = new System.Drawing.Size(239, 264);
     this._propertyList.TabIndex    = 0;
     this._propertyList.UseCompatibleStateImageBehavior = false;
     this._propertyList.View = System.Windows.Forms.View.Details;
     //
     // _colLabel
     //
     this._colLabel.Text  = "";
     this._colLabel.Width = 0;
     //
     // _colName
     //
     this._colName.Text  = "Name";
     this._colName.Width = 100;
     //
     // _colValue
     //
     this._colValue.Text  = "Value";
     this._colValue.Width = 135;
     //
     // toolStrip1
     //
     this.toolStrip1.Dock      = System.Windows.Forms.DockStyle.None;
     this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this._buttonAddProp,
         this._buttonRemoveProp,
         this.toolStripSeparator1,
         this.toolStripTextBox1
     });
     this.toolStrip1.Location = new System.Drawing.Point(0, 0);
     this.toolStrip1.Name     = "toolStrip1";
     this.toolStrip1.Size     = new System.Drawing.Size(239, 25);
     this.toolStrip1.Stretch  = true;
     this.toolStrip1.TabIndex = 0;
     //
     // _buttonAddProp
     //
     this._buttonAddProp.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this._buttonAddProp.Image                 = ((System.Drawing.Image)(resources.GetObject("_buttonAddProp.Image")));
     this._buttonAddProp.ImageTransparentColor = System.Drawing.Color.Magenta;
     this._buttonAddProp.Name = "_buttonAddProp";
     this._buttonAddProp.Size = new System.Drawing.Size(23, 22);
     this._buttonAddProp.Text = "Add Property";
     //
     // _buttonRemoveProp
     //
     this._buttonRemoveProp.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this._buttonRemoveProp.Image                 = ((System.Drawing.Image)(resources.GetObject("_buttonRemoveProp.Image")));
     this._buttonRemoveProp.ImageTransparentColor = System.Drawing.Color.Magenta;
     this._buttonRemoveProp.Name = "_buttonRemoveProp";
     this._buttonRemoveProp.Size = new System.Drawing.Size(23, 22);
     this._buttonRemoveProp.Text = "Delete Selected Property";
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
     //
     // toolStripTextBox1
     //
     this.toolStripTextBox1.AutoSize = false;
     this.toolStripTextBox1.Name     = "toolStripTextBox1";
     this.toolStripTextBox1.ReadOnly = true;
     this.toolStripTextBox1.Size     = new System.Drawing.Size(150, 22);
     //
     // PropertyPane
     //
     this.Controls.Add(this.toolStripContainer1);
     this.Margin = new System.Windows.Forms.Padding(0);
     this.Name   = "PropertyPane";
     this.Size   = new System.Drawing.Size(239, 289);
     this.toolStripContainer1.ContentPanel.ResumeLayout(false);
     this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
     this.toolStripContainer1.TopToolStripPanel.PerformLayout();
     this.toolStripContainer1.ResumeLayout(false);
     this.toolStripContainer1.PerformLayout();
     this.toolStrip1.ResumeLayout(false);
     this.toolStrip1.PerformLayout();
     this.ResumeLayout(false);
 }
        private void InitializeComponent()
        {
            _includePathLabel    = new Label();
            _includePathListView = new PathListView();
            _excludePathLabel    = new Label();
            _excludePathListView = new PathListView();
            _artistsListLabel    = new Label();
            _artistsRichTextBox  = new RichTextBox();
            _regexLabel          = new Label();
            _regexListView       = new EditableListView();
            _startButton         = new Button();
            _progressBar         = new ProgressBar();
            _stepLabel           = new CurrentMaxValueLabel();

            _includePathLabel.Location  = new Point(0, 0);
            _includePathLabel.Size      = new Size(LayoutGUI.AdditionalsPathListViewWidth, 15);
            _includePathLabel.TextAlign = ContentAlignment.MiddleLeft;
            _includePathLabel.AutoSize  = false;

            _includePathListView.Location    = new Point(_includePathLabel.Location.X, _includePathLabel.Location.X + _includePathLabel.Size.Height);
            _includePathListView.Size        = new Size(LayoutGUI.AdditionalsPathListViewWidth, LayoutGUI.AdditionalsPathListViewHeight);
            _includePathListView.HeaderStyle = ColumnHeaderStyle.None;
            _includePathListView.View        = View.Details;
            _includePathListView.PathType    = PathType.Folder;
            _includePathListView.PathStatus  = PathStatus.Exist;

            _excludePathLabel.Location  = new Point(_includePathListView.Size.Width + LayoutGUI.DistanceBetweenControls * 2, _includePathLabel.Location.Y);
            _excludePathLabel.Size      = _includePathLabel.Size;
            _excludePathLabel.TextAlign = ContentAlignment.MiddleLeft;
            _excludePathLabel.AutoSize  = false;

            _excludePathListView.Location    = new Point(_excludePathLabel.Location.X, _excludePathLabel.Location.Y + _excludePathLabel.Size.Height);
            _excludePathListView.Size        = _includePathListView.Size;
            _excludePathListView.HeaderStyle = ColumnHeaderStyle.None;
            _excludePathListView.View        = View.Details;
            _excludePathListView.PathType    = PathType.Folder;
            _excludePathListView.PathStatus  = PathStatus.Exist;

            _artistsListLabel.Location  = new Point(_includePathListView.Location.X, _includePathListView.Location.Y + _includePathListView.Size.Height);
            _artistsListLabel.Size      = _includePathLabel.Size;
            _artistsListLabel.TextAlign = ContentAlignment.MiddleLeft;
            _artistsListLabel.AutoSize  = true;

            _artistsRichTextBox.Location = new Point(_artistsListLabel.Location.X, _artistsListLabel.Location.Y + _artistsListLabel.Size.Height);
            _artistsRichTextBox.Size     = _includePathListView.Size;
            _artistsRichTextBox.ReadOnly = true;

            _regexLabel.Location  = new Point(_excludePathListView.Location.X, _excludePathListView.Location.Y + _excludePathListView.Size.Height);
            _regexLabel.Size      = _excludePathLabel.Size;
            _regexLabel.Text      = "regex";
            _regexLabel.TextAlign = ContentAlignment.MiddleLeft;
            _regexLabel.AutoSize  = true;

            _regexListView.Location     = new Point(_excludePathListView.Location.X, _regexLabel.Location.Y + _regexLabel.Size.Height);
            _regexListView.Size         = _artistsRichTextBox.Size;
            _regexListView.HeaderStyle  = ColumnHeaderStyle.None;
            _regexListView.View         = View.Details;
            _regexListView.ValidateFunc = obj => RegexUtils.IsValidRegex(obj.ToString());

            _startButton.Location = new Point(0, _artistsRichTextBox.Location.Y + _artistsRichTextBox.Size.Height);
            _startButton.Size     = new Size(LayoutGUI.AdditionalsPathListViewWidth, 30);
            _startButton.Click   += (sender, args) => Task.Run(ShowArtists);

            _progressBar.Location = new Point(0, _startButton.Location.Y + _startButton.Size.Height);
            _progressBar.Size     = new Size(LayoutGUI.AdditionalsFormWidth, 10);
            _progressBar.Step     = 1;
            _progressBar.Style    = ProgressBarStyle.Continuous;

            _stepLabel.Location               = new Point(_regexListView.Location.X, _startButton.Location.Y);
            _stepLabel.Size                   = new Size(LayoutGUI.AdditionalsFormWidth - _regexListView.Location.X, _startButton.Size.Height);
            _stepLabel.AutoSize               = false;
            _stepLabel.TextAlign              = ContentAlignment.MiddleLeft;
            _stepLabel.Font                   = new Font(Font.Name, Font.Size + 3);
            _stepLabel.DisplayType            = MathUtils.DisplayType.ValueAndPercent;
            _stepLabel.PercentFractionalCount = 2;

            MinimizeBox         = false;
            MaximizeBox         = false;
            ShowInTaskbar       = false;
            AutoScaleDimensions = new SizeF(7F, 15F);
            ClientSize          = new Size(LayoutGUI.AdditionalsFormWidth, LayoutGUI.AdditionalsFormHeight);
            AutoScaleMode       = AutoScaleMode.Font;
            FormBorderStyle     = FormBorderStyle.FixedDialog;
            Controls.Add(_includePathLabel);
            Controls.Add(_includePathListView);
            Controls.Add(_excludePathLabel);
            Controls.Add(_excludePathListView);
            Controls.Add(_regexLabel);
            Controls.Add(_regexListView);
            Controls.Add(_artistsListLabel);
            Controls.Add(_artistsRichTextBox);
            Controls.Add(_startButton);
            Controls.Add(_progressBar);
            Controls.Add(_stepLabel);
            Icon = ImageUtils.IconFromImage(Images.Line.Tech);
        }