Esempio n. 1
0
        protected override void OnPeforming()
        {
            base.OnPeforming();

            AppointmentInfo appointment = new AppointmentInfo();

            Scheduler.Add(appointment);

            MessageInfo item  = new MessageInfo();
            ShapeLabel  label = new ShapeLabel();

            ShapeLayer layer = new ShapeLayer(label);

            layer.EmphasisEffect.StartTime = 0;
            layer.EmphasisEffect.EndTime   = 8;

            item.Add(layer);
            item.Length = 8;

            appointment.Target   = item;
            appointment.AllDay   = true;
            appointment.Subject  = item.Name;
            appointment.StatusId = 0;
            double length = Convert.ToDouble(item.Length) / 3600;

            appointment.Duration    = TimeSpan.FromHours(length);
            appointment.End         = appointment.Start.AddSeconds(item.Length);
            appointment.Description = item.Type.ToString();
        }
Esempio n. 2
0
        public Create_Figure(List <Shape> shapeList)
        {
            InitializeComponent();
            ShapeList = shapeList;

            CBCreateFigure.Items.Add("Triangle");
            CBCreateFigure.Items.Add("Trapezoid");
            CBCreateFigure.Items.Add("Square");
            CBCreateFigure.Items.Add("Rectangle");
            CBCreateFigure.Items.Add("Circle");

            ShapeLabel.Hide();
            sideOneLabel.Hide();
            sideTwoLabel.Hide();
            sideThreeLabel.Hide();
            sideFourLabel.Hide();

            textBox1.Hide();
            textBox2.Hide();
            textBox3.Hide();
            textBox4.Hide();

            //ShapeLabel.BackColor = Color.Black;
            //sideOneLabel.BackColor = Color.Black;
            //sideTwoLabel.BackColor = Color.Black;
            //sideThreeLabel.BackColor = Color.Black;
            //sideFourLabel.BackColor = Color.Black;
        }
    public Shape Get(ShapeLabel label)
    {
        List <Shape> pool      = pools[label];
        int          lastIndex = pool.Count - 1;

        Shape shape;

        if (lastIndex <= 0)
        {
            var obj = Instantiate(prefabs[(int)label]);
            shape = new Shape()
            {
                label = label, obj = obj
            };
        }
        else
        {
            shape = pool[lastIndex];
            shape.obj.SetActive(true);
            pool.RemoveAt(lastIndex);
        }

        active.Add(shape);
        return(shape);
    }
Esempio n. 4
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     ShapeLabel shape = new ShapeLabel();
     ShapeLayer layer = new ShapeLayer(shape);
     //layerContainer.AddLayer(layer);
     //pnLayers.Controls.Add(frameLayer);
     //pnLayers.Controls.SetChildIndex(frameLayer, 0);
     //propertyGrid1.SelectedObject = layer;
 }
        public override void ViewDidLoad()
        {
            View = new UIView()
            {
                BackgroundColor = UIColor.White
            };
            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
            {
                EdgesForExtendedLayout = UIRectEdge.None;
            }


            var label = new ShapeLabel(new RectangleF(10, 10, 300, 40));

            Add(label);
            var textField = new UITextField(new RectangleF(10, 50, 300, 40));

            Add(textField);
            var shapeView = new ShapeView(new RectangleF(60, 90, 200, 200));

            Add(shapeView);

            var picker          = new UIPickerView();
            var pickerViewModel = new MvxPickerViewModel(picker);

            picker.Model = pickerViewModel;
            picker.ShowSelectionIndicator = true;
            textField.InputView           = picker;

            var set = this.CreateBindingSet <FirstView, Core.ViewModels.FirstViewModel>();

            set.Bind(label).For(s => s.TheShape).To(vm => vm.Shape);
            set.Bind(textField).To(vm => vm.Shape);
            set.Bind(pickerViewModel).For(p => p.ItemsSource).To(vm => vm.List);
            set.Bind(pickerViewModel).For(p => p.SelectedItem).To(vm => vm.Shape);
            set.Bind(shapeView).For(s => s.TheShape).To(vm => vm.Shape);
            set.Apply();

            var g = new UITapGestureRecognizer(() => textField.ResignFirstResponder());

            View.AddGestureRecognizer(g);
        }
Esempio n. 6
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (CBCreateFigure.SelectedItem.Equals("Circle"))
            {
                ShapeLabel.Text = "Circle";

                ShapeLabel.Show();
                textBox1.Show();

                sideOneLabel.Text = "Radius";
                sideOneLabel.Show();

                sideTwoLabel.Hide();
                sideThreeLabel.Hide();
                sideFourLabel.Hide();
                textBox2.Hide();
                textBox3.Hide();
                textBox4.Hide();
            }
            else if (CBCreateFigure.SelectedItem.Equals("Rectangle"))
            {
                ShapeLabel.Text = "Rectangle";
                ShapeLabel.Show();
                textBox1.Show();
                textBox2.Show();

                sideOneLabel.Text = "Width";
                sideOneLabel.Show();

                sideTwoLabel.Text = "Heigth";
                sideTwoLabel.Show();

                sideThreeLabel.Hide();
                sideFourLabel.Hide();
                textBox3.Hide();
                textBox4.Hide();
            }
            else if (CBCreateFigure.SelectedItem.Equals("Triangle"))
            {
                textBox1.Show();
                textBox2.Show();
                textBox3.Show();
                sideOneLabel.Text = "SideOne";
                sideOneLabel.Show();
                sideTwoLabel.Text = "SideTwo";
                sideTwoLabel.Show();
                sideThreeLabel.Text = "SideThree";
                sideThreeLabel.Show();

                ShapeLabel.Text = "Triangle";
                ShapeLabel.Show();
                sideFourLabel.Hide();

                textBox4.Hide();
            }
            else if (CBCreateFigure.SelectedItem.Equals("Square"))
            {
                ShapeLabel.Text = "Square";

                ShapeLabel.Show();
                textBox1.Show();

                sideOneLabel.Text = "Side";
                sideOneLabel.Show();

                sideTwoLabel.Hide();
                sideThreeLabel.Hide();
                sideFourLabel.Hide();
                textBox2.Hide();
                textBox3.Hide();
                textBox4.Hide();
            }
            else if (CBCreateFigure.SelectedItem.Equals("Trapezoid"))
            {
                ShapeLabel.Text = "Trapezoid";

                ShapeLabel.Show();

                textBox1.Show();
                textBox2.Show();
                textBox3.Show();
                textBox4.Show();
                sideOneLabel.Show();
                sideTwoLabel.Show();
                sideThreeLabel.Show();
                sideFourLabel.Show();
            }
            else
            {
                MessageBox.Show("Select form to add.");
            }
        }
Esempio n. 7
0
 public override void VisitLabel(ShapeLabel shape)
 {
     VisitShape(shape);
 }
Esempio n. 8
0
 public virtual void VisitLabel(ShapeLabel shape)
 {
 }