Beispiel #1
1
        public Form1()
        {
            InitializeComponent();

            eventGuide = XDocument.Load("pubsAndClubs.xml").Element("Event_Guide");
            dataGridViewRows = dataGridView.Rows;
        }
 /// <summary>
 /// 加载质量特性GridView
 /// </summary>
 /// <param name="rows"></param>
 private void loadDataTable(DataGridViewRowCollection rows)
 {
     rows.Clear();
     foreach (PartProperties pro in this.partProperties)
     {
         int i = rows.Add();
         rows[i].Cells["partID"].Value = pro.id;
         rows[i].Cells["partName"].Value = pro.name;
         rows[i].Cells["parentID"].Value = pro.parentID;
         rows[i].Cells["partDensity"].Value = pro.density.ToString("e");
         rows[i].Cells["partDimension"].Value = pro.dimension.ToString("e");
         rows[i].Cells["partArea"].Value = pro.area.ToString("e");
         rows[i].Cells["partQuality"].Value = pro.quality.ToString("e");
         rows[i].Cells["partCenterOfGravityX"].Value = pro.centerOfGravityX.ToString("e");// String.Join(",", pro.centerOfGravity);
         rows[i].Cells["partCenterOfGravityY"].Value = pro.centerOfGravityY.ToString("e");
         rows[i].Cells["partCenterOfGravityZ"].Value = pro.centerOfGravityZ.ToString("e");
         rows[i].Cells["partInertiaMatrixIXX"].Value = pro.inertiaMatrixIXX.ToString("e");
         rows[i].Cells["partInertiaMatrixIXY"].Value = pro.inertiaMatrixIXY.ToString("e");
         rows[i].Cells["partInertiaMatrixIXZ"].Value = pro.inertiaMatrixIXZ.ToString("e");
         rows[i].Cells["partInertiaMatrixIYX"].Value = pro.inertiaMatrixIYX.ToString("e");
         rows[i].Cells["partInertiaMatrixIYY"].Value = pro.inertiaMatrixIYY.ToString("e");
         rows[i].Cells["partInertiaMatrixIYZ"].Value = pro.inertiaMatrixIYZ.ToString("e");
         rows[i].Cells["partInertiaMatrixIZX"].Value = pro.inertiaMatrixIZX.ToString("e");
         rows[i].Cells["partInertiaMatrixIZY"].Value = pro.inertiaMatrixIZY.ToString("e");
         rows[i].Cells["partInertiaMatrixIZZ"].Value = pro.inertiaMatrixIZZ.ToString("e");
     }
 }
Beispiel #3
0
 public Form1()
 {
     InitializeComponent();
     gigDoc = XDocument.Load("pubsAndClubs.xml");
     addGig();
     gridRow = dataGridView1.Rows;
     gridRow2 = dataGridView2.Rows;
     populateGenreComboBoxes();
 }
Beispiel #4
0
        public Form1()
        {
            InitializeComponent();

            //Read in xml from file
            gigDoc = XDocument.Load("pubsAndClubs.xml");
            gridRow = dgvGigs.Rows;
            gridRow2 = dgvBand.Rows;

            //Add the new gig req'd for exercise 5
            addGig();
        }
Beispiel #5
0
        //CONTROL DE PRECIOS
        public bool actualizarPrecios(eNIVEL nivel, DataGridViewRowCollection PRECIOS, DateTime fecha, string autorizo)
        {
            bool OK = true;
            string datos = "";
            try
            {
                foreach (DataGridViewRow row in PRECIOS)
                {
                    switch (nivel)
                    {
                        case eNIVEL.PRENDASAL:
                            datos = datos + row.Cells["KilatajeN"].Value.ToString() + ">" + Decimal.Parse(row.Cells["PrecioN"].Value.ToString()) +  "&";
                            break;
                        case eNIVEL.AMIGO:
                            datos = datos + row.Cells["KilatajeA"].Value.ToString() + ">" + Decimal.Parse(row.Cells["PrecioA"].Value.ToString()) + "&";
                            break;
                        case eNIVEL.VIP:
                            datos = datos + row.Cells["KilatajeV"].Value.ToString() + ">" + Decimal.Parse(row.Cells["PrecioV"].Value.ToString()) + "&";
                            break;
                        case eNIVEL.MAYOREO:
                            datos = datos + row.Cells["KilatajeM"].Value.ToString() + ">" + Decimal.Parse(row.Cells["PrecioM"].Value.ToString()) + "&";
                            break;
                    }

                }
                string sql = "prendasal.SP_SET_PRECIOS";
                MySqlCommand cmd = new MySqlCommand(sql, conn.conection);
                cmd.CommandType = CommandType.StoredProcedure;
                MySqlParameter n = cmd.Parameters.Add("nivelP", MySqlDbType.Int32);
                n.Direction = ParameterDirection.Input;
                MySqlParameter f = cmd.Parameters.Add("fechaP", MySqlDbType.Date);
                f.Direction = ParameterDirection.Input;
                MySqlParameter auto = cmd.Parameters.Add("autorizoP", MySqlDbType.VarChar, 15);
                auto.Direction = ParameterDirection.Input;
                MySqlParameter items = cmd.Parameters.Add("items", MySqlDbType.LongText);
                items.Direction = ParameterDirection.Input;

                n.Value = (int)nivel;
                f.Value = fecha.Date.ToString("yyyy-MM-dd"); ;
                auto.Value = autorizo.ToUpper();
                items.Value = datos;

                cmd.ExecuteNonQuery();
                MessageBox.Show("PRECIOS " + nivel.ToString() + " ACTUALIZADOS", "OPERACION FINALIZADA", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception e)
            {
                OK = false;
                MessageBox.Show(null, e.Message, "ERROR AL ACTUALIZAR PRECIOS " + nivel.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return OK;
        }
		public void CtorTest ()
		{
			DataGridViewRowCollection rc;
			
			rc = new DataGridViewRowCollection (null);
			Assert.AreEqual (0, rc.Count, "#01");
			
			using (DataGridView dgv = new DataGridView ()) {
				rc = new DataGridViewRowCollection (dgv);
				Assert.AreEqual (0, rc.Count, "#02");
				Assert.IsTrue (rc != dgv.Rows, "#03");
			}
		}
        private void writeData(String fName, DataGridViewRowCollection rows)
        {
            using (XmlWriter writer = XmlWriter.Create(fName))
            {
                writer.WriteStartDocument();
                writer.WriteStartElement("ComponentOrder");
                foreach (DataGridViewRow row in dgvSchedule.Rows)
                {
                    writer.WriteStartElement("Component");
                    writer.WriteElementString("Category", row.Cells["category"].Value.ToString());
                    writer.WriteElementString("Name", row.Cells["name"].Value.ToString());

                    if (row.Cells["pred"].Value == null)
                        throw new NullReferenceException("No Predecessor Found");
                    writer.WriteElementString("PredecessorName", row.Cells["pred"].Value.ToString());

                    if (row.Cells["succ"].Value == null)
                        throw new NullReferenceException("No Successor Found");
                    writer.WriteElementString("SuccessorName", row.Cells["succ"].Value.ToString());

                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
            }
        }
        /// <summary>
        /// Generate graph based on given Gridview. Should Represent a project schedule.
        /// </summary>
        /// <param name="rows"></param>
        private Graph GenerateGraph(DataGridViewRowCollection rows)
        {
            Graph g = new Graph("Schedule");
            List<Edge> startEdges = new List<Edge>();

            Node start = g.AddNode("START");
            start.Attr.Color = Microsoft.Glee.Drawing.Color.Green;
            Node end = g.AddNode("END");
            end.Attr.Color = Microsoft.Glee.Drawing.Color.Red;

            if (rows.Count <= 0)
                g.AddEdge(start.Id, end.Id);

            foreach (DataGridViewRow row in rows)
            {
                if (row.Cells["pred"].Value == null)
                    throw new NullReferenceException("No Predecessor Found");
                if (row.Cells["succ"].Value == null)
                    throw new NullReferenceException("No Successor Found");

                String pred = row.Cells["pred"].Value.ToString();
                String succ = row.Cells["succ"].Value.ToString();
                String curr = row.Cells["name"].Value.ToString();
                Node predNode = g.FindNode(pred);
                Node succNode = g.FindNode(succ);
                Node currNode = g.FindNode(curr);
                if (currNode == null)
                    currNode= g.AddNode(curr);
                if (predNode == null)
                {
                    predNode = g.AddNode(pred);
                    g.AddEdge(predNode.Id, currNode.Id);
                }
                else if (predNode.Id.Equals(start.Id))
                {
                    bool exists = false;
                    foreach (Edge ed in start.OutEdges)
                    {
                        if (ed.Target.Equals(currNode.Id))
                        {
                            exists = true;
                            break;
                        }
                    }
                    if(!exists)
                        g.AddEdge(start.Id, currNode.Id);
                }
                if (succNode == null)
                {
                    succNode = g.AddNode(succ);
                    g.AddEdge(currNode.Id, succNode.Id);
                }
                else if (succNode.Id.Equals(end.Id))
                {
                    bool exists = false;
                    foreach (Edge ed in end.InEdges)
                    {
                        if (ed.Source.Equals(currNode.Id))
                        {
                            exists = true;
                            break;
                        }
                    }
                    if (!exists)
                        g.AddEdge(currNode.Id, end.Id);
                }
                else
                    g.AddEdge(currNode.Id, succNode.Id);
            }

            return g;
        }
Beispiel #9
0
        public bool Insertar(string nombre, bool habilitado, DataGridViewRowCollection permisos)
        {
            this.Nombre = nombre;
            this.Habilitado = Convert.ToBoolean(habilitado);

            foreach (DataGridViewRow fila in permisos)
            {
                var permiso = new Funcionalidad(Convert.ToInt32(fila.Cells["Id"].Value), Convert.ToString(fila.Cells["funcionalidad"].Value), "");

                this.Permisos.Add(permiso);
            }

            return this.Insertar();
        }
Beispiel #10
0
 public RowArrayList(DataGridViewRowCollection owner)
 {
     this.owner = owner;
 }
 /// <summary>
 /// Assign the rows to the internal list.
 /// </summary>
 /// <param name="col">DataGridViewRowCollection</param>
 public void AssignRows(DataGridViewRowCollection col)
 {
     //dataSource.Rows = col.Cast<OutlookGridRow>().ToList();
     internalRows = col.Cast<OutlookGridRow>().ToList();
 }
Beispiel #12
0
 public UnsharingRowEnumerator(DataGridViewRowCollection owner)
 {
     this.owner = owner;
     current    = -1;
 }
 /// <summary>
 /// 加载Excel数据表格GridView
 /// </summary>
 /// <param name="rows"></param>
 private void loadExcelDataTable(DataGridViewRowCollection rows,PartProperties[] pros)
 {
     rows.Clear();
     foreach (PartProperties pro in pros)
     {
         int i = rows.Add();
         rows[i].Cells["partID_excel"].Value = pro.id;
         rows[i].Cells["partName_excel"].Value = pro.name;
         rows[i].Cells["parentID_excel"].Value = pro.parentID;
         rows[i].Cells["partDensity_excel"].Value = pro.density.ToString("e");
         rows[i].Cells["partDimension_excel"].Value = pro.dimension.ToString("e");
         rows[i].Cells["partArea_excel"].Value = pro.area.ToString("e");
         rows[i].Cells["partQuality_excel"].Value = pro.quality.ToString("e");
         rows[i].Cells["partPercent_excel"].Value = pro.qualityPercent;
         rows[i].Cells["partCenterOfGravityX_excel"].Value = pro.centerOfGravityX.ToString("e");//String.Join(",", pro.centerOfGravity);
         rows[i].Cells["partCenterOfGravityY_excel"].Value = pro.centerOfGravityY.ToString("e");
         rows[i].Cells["partCenterOfGravityZ_excel"].Value = pro.centerOfGravityZ.ToString("e");
         rows[i].Cells["partInertiaMatrixIXX_excel"].Value = pro.inertiaMatrixIXX.ToString("e");
         rows[i].Cells["partInertiaMatrixIXY_excel"].Value = pro.inertiaMatrixIXY.ToString("e");
         rows[i].Cells["partInertiaMatrixIXZ_excel"].Value = pro.inertiaMatrixIXZ.ToString("e");
         rows[i].Cells["partInertiaMatrixIYY_excel"].Value = pro.inertiaMatrixIYY.ToString("e");
         rows[i].Cells["partInertiaMatrixIYX_excel"].Value = pro.inertiaMatrixIYX.ToString("e");
         rows[i].Cells["partInertiaMatrixIYZ_excel"].Value = pro.inertiaMatrixIYZ.ToString("e");
         rows[i].Cells["partInertiaMatrixIZX_excel"].Value = pro.inertiaMatrixIZX.ToString("e");
         rows[i].Cells["partInertiaMatrixIZY_excel"].Value = pro.inertiaMatrixIZY.ToString("e");
         rows[i].Cells["partInertiaMatrixIZZ_excel"].Value = pro.inertiaMatrixIZZ.ToString("e");
     }
 }
Beispiel #14
0
		/// <summary>
		/// Checks if the given Row contans values
		/// </summary>
		private bool IsRowEmpty(DataGridViewRowCollection rows, int rowIndex) {
			for (int i = 0; i < rows[rowIndex].Cells.Count; ++i) {
				string valStr = string.Format("{0}", rows[rowIndex].Cells[i].Value);
				if (!string.IsNullOrEmpty(valStr)) return false;
			}
			return true;
		}
 private void sumExcelTemplateGrid(DataGridViewRowCollection rows)
 {
     float[] val = { 0, 0, 0, 0 };
     foreach (DataGridViewRow row in rows)
     {
         val[0] += Convert.ToSingle(row.Cells["partDensity_excel"].Value);
         val[1] += Convert.ToSingle(row.Cells["partDimension_excel"].Value);
         val[2] += Convert.ToSingle(row.Cells["partArea_excel"].Value);
         val[3] += Convert.ToSingle(row.Cells["partQuality_excel"].Value);
     }
     rows[rows.Count - 1].Cells["partDensity_excel"].Value = val[0];
     rows[rows.Count - 1].Cells["partDimension_excel"].Value = val[1];
     rows[rows.Count - 1].Cells["partArea_excel"].Value = val[2];
     rows[rows.Count - 1].Cells["partQuality_excel"].Value = val[3];
 }
Beispiel #16
0
 //内容情報のセット
 public void setContentData(double tax, DataGridViewRowCollection dataTable,string note)
 {
     conTax = tax;
     conContent = dataTable;
     conNote = note;
 }
Beispiel #17
0
 /// <summary>
 /// 导出 BibTex 文件
 /// </summary>
 /// <param name="filename"></param>
 /// <param name="rows"></param>
 public void SaveBibFile(string filename, DataGridViewRowCollection rows)
 {
     if (filename == null) return;
     using (StreamWriter sw = new StreamWriter(filename))
     {
         foreach (DataGridViewRow r in rows)
         {
             sw.WriteLine(getEntryString(r));
         }
     }
 }
Beispiel #18
0
 private bool[] makeAttributesValue(DataGridViewRowCollection rows)
 {
     var result = new bool[rows.Count];
     for (var i = 0; i < rows.Count; i++)
         result[i] = (bool) rows[i].Cells[1].Value;
     return result;
 }
 /// <summary>
 /// Returns an observable sequence wrapping the CollectionChanged event on the DataGridViewRowCollection instance.
 /// </summary>
 /// <param name="instance">The DataGridViewRowCollection instance to observe.</param>
 /// <returns>An observable sequence wrapping the CollectionChanged event on the DataGridViewRowCollection instance.</returns>
 public static IObservable <EventPattern <CollectionChangeEventArgs> > CollectionChangedObservable(this DataGridViewRowCollection instance)
 {
     return(Observable.FromEventPattern <CollectionChangeEventHandler, CollectionChangeEventArgs>(
                handler => instance.CollectionChanged += handler,
                handler => instance.CollectionChanged -= handler));
 }
 public UnsharingRowEnumerator(DataGridViewRowCollection owner)
 {
     this.owner = owner;
     this.current = -1;
 }
 public RowComparer(DataGridViewRowCollection dataGridViewRows, IComparer customComparer, bool ascending)
 {
     this.dataGridView = dataGridViewRows.DataGridView;
     this.dataGridViewRows = dataGridViewRows;
     this.dataGridViewSortedColumn = this.dataGridView.SortedColumn;
     if (this.dataGridViewSortedColumn == null)
     {
         this.sortedColumnIndex = -1;
     }
     else
     {
         this.sortedColumnIndex = this.dataGridViewSortedColumn.Index;
     }
     this.customComparer = customComparer;
     this.ascending = ascending;
 }
Beispiel #22
0
 private void Form1_Load(object sender, EventArgs e)
 {
     doc = XDocument.Load(fileName);
     VenueGridRows = dataGridView1.Rows;
     BandGridRows = dgShowBandMembers.Rows;
     rbShowAll.Checked = true;
 }
 public RowArrayList(DataGridViewRowCollection owner)
 {
     this.owner = owner;
 }
 public void CustomSort(DataGridViewRowCollection.RowComparer rowComparer)
 {
     this.rowComparer = rowComparer;
     this.CustomQuickSort(0, this.Count - 1);
 }
Beispiel #25
0
		public DataGridView ()
		{
			SetStyle (ControlStyles.Opaque, true);
			//SetStyle (ControlStyles.UserMouse, true);
			SetStyle (ControlStyles.OptimizedDoubleBuffer, true);
			
			adjustedTopLeftHeaderBorderStyle = new DataGridViewAdvancedBorderStyle();
			adjustedTopLeftHeaderBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
			advancedCellBorderStyle = new DataGridViewAdvancedBorderStyle();
			advancedCellBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
			advancedColumnHeadersBorderStyle = new DataGridViewAdvancedBorderStyle();
			advancedColumnHeadersBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
			advancedRowHeadersBorderStyle = new DataGridViewAdvancedBorderStyle();
			advancedRowHeadersBorderStyle.All = DataGridViewAdvancedCellBorderStyle.Single;
			alternatingRowsDefaultCellStyle = new DataGridViewCellStyle();
			allowUserToAddRows = true;
			allowUserToDeleteRows = true;
			allowUserToOrderColumns = false;
			allowUserToResizeColumns = true;
			allowUserToResizeRows = true;
			autoGenerateColumns = true;
			autoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
			autoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
			backColor = Control.DefaultBackColor;
			backgroundColor = SystemColors.AppWorkspace;
			borderStyle = BorderStyle.FixedSingle;
			cellBorderStyle = DataGridViewCellBorderStyle.Single;
			clipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithAutoHeaderText;
			columnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
			columnHeadersDefaultCellStyle = new DataGridViewCellStyle();
			columnHeadersDefaultCellStyle.BackColor = SystemColors.Control;
			columnHeadersDefaultCellStyle.ForeColor = SystemColors.WindowText;
			columnHeadersDefaultCellStyle.SelectionBackColor = SystemColors.Highlight;
			columnHeadersDefaultCellStyle.SelectionForeColor = SystemColors.HighlightText;
			columnHeadersDefaultCellStyle.Font = this.Font;
			columnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
			columnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.True;
			columnHeadersHeight = 23;
			columnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
			columnHeadersVisible = true;
			columns = CreateColumnsInstance();
			columns.CollectionChanged += OnColumnCollectionChanged;
			currentCellAddress = new Point (-1, -1);
			dataMember = String.Empty;
			defaultCellStyle = new DataGridViewCellStyle();
			defaultCellStyle.BackColor = SystemColors.Window;
			defaultCellStyle.ForeColor = SystemColors.ControlText;
			defaultCellStyle.SelectionBackColor = SystemColors.Highlight;
			defaultCellStyle.SelectionForeColor = SystemColors.HighlightText;
			defaultCellStyle.Font = this.Font;
			defaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
			defaultCellStyle.WrapMode = DataGridViewTriState.False;
			editMode = DataGridViewEditMode.EditOnKeystrokeOrF2;
			firstDisplayedScrollingColumnHiddenWidth = 0;
			isCurrentCellDirty = false;
			multiSelect = true;
			readOnly = false;
			rowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
			rowHeadersDefaultCellStyle = (DataGridViewCellStyle) columnHeadersDefaultCellStyle.Clone ();
			rowHeadersVisible = true;
			rowHeadersWidth = 41;
			rowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
			rows = CreateRowsInstance();
			rowsDefaultCellStyle = new DataGridViewCellStyle();
			selectionMode = DataGridViewSelectionMode.RowHeaderSelect;
			showCellErrors = true;
			showEditingIcon = true;
			scrollBars = ScrollBars.Both;
			userSetCursor = Cursor.Current;
			virtualMode = false;

			horizontalScrollBar = new HScrollBar();
			horizontalScrollBar.Scroll += OnHScrollBarScroll;
			horizontalScrollBar.Visible = false;
			
			verticalScrollBar = new VScrollBar();
			verticalScrollBar.Scroll += OnVScrollBarScroll;
			verticalScrollBar.Visible = false;
			
			Controls.AddRange (new Control[] {horizontalScrollBar, verticalScrollBar});
		}
Beispiel #26
0
    /// <summary>
    /// Loads the shapes that are listed in the given database table
    ///   and creates corresponding graphic elements.
    /// </summary>
    /// <param name="areaOfInterestTableRows">
    /// Areas of interest table as
    ///   a <see cref="DataGridViewRowCollection"/>
    /// </param>
    public void LoadShapesFromDataGridView(DataGridViewRowCollection areaOfInterestTableRows)
    {
      try
      {
        // Create aoi elements from data view
        this.AoiCollection = new VGElementCollection();

        foreach (DataGridViewRow row in areaOfInterestTableRows)
        {
          if (!row.IsNewRow)
          {
            // retrieve shape parameters from cell values.
            var shapeName = row.Cells["colShapeName"].Value.ToString();
            var strPtList = row.Cells["colShapePts"].Value.ToString();
            Pen usedPen;
            Font usedFont;
            Color usedFontColor;
            VGAlignment usedAlignment;
            VGStyleGroup usedStyleGroup;
            var pointList = ObjectStringConverter.StringToPointFList(strPtList);
            var usedElementGroup = row.Cells["colShapeGroup"].Value.ToString();
            switch (usedElementGroup)
            {
              case "Target":
                usedPen = this.TargetPen;
                usedFont = this.TargetFont;
                usedFontColor = this.TargetFontColor;
                usedStyleGroup = VGStyleGroup.AOI_TARGET;
                usedAlignment = this.TargetTextAlignment;
                break;
              case "SearchRect":
                usedPen = this.SearchRectPen;
                usedFont = this.SearchRectFont;
                usedFontColor = this.SearchRectFontColor;
                usedStyleGroup = VGStyleGroup.AOI_SEARCHRECT;
                usedAlignment = this.SearchRectTextAlignment;
                break;
              default:
                usedPen = this.DefaultPen;
                usedFont = this.DefaultFonts;
                usedFontColor = this.DefaultFontColor;
                usedStyleGroup = VGStyleGroup.AOI_NORMAL;
                usedAlignment = this.DefaultTextAlignment;
                break;
            }

            // Create the shape depending on ShapeType
            var boundingRect = new RectangleF();
            switch (row.Cells["colShapeType"].Value.ToString())
            {
              case "Rectangle":
                boundingRect.Location = pointList[0];
                boundingRect.Width = pointList[2].X - pointList[0].X;
                boundingRect.Height = pointList[2].Y - pointList[0].Y;

                // Create Rect with defined stroke
                var newRect =
                  new VGRectangle(
                    this.hideAOIDescription ? ShapeDrawAction.Edge : ShapeDrawAction.NameAndEdge, 
                    usedPen, 
                    usedFont, 
                    usedFontColor, 
                    boundingRect, 
                    usedStyleGroup, 
                    shapeName, 
                    usedElementGroup);
                newRect.TextAlignment = usedAlignment;
                this.AoiCollection.Add(newRect);
                break;
              case "Ellipse":
                boundingRect.Location = pointList[0];
                boundingRect.Width = pointList[2].X - pointList[0].X;
                boundingRect.Height = pointList[2].Y - pointList[0].Y;

                // Create Rect with defined stroke
                var newEllipse =
                  new VGEllipse(
                    this.hideAOIDescription ? ShapeDrawAction.Edge : ShapeDrawAction.NameAndEdge, 
                    usedPen, 
                    usedFont, 
                    usedFontColor, 
                    boundingRect, 
                    usedStyleGroup, 
                    shapeName, 
                    usedElementGroup);
                newEllipse.TextAlignment = usedAlignment;
                this.AoiCollection.Add(newEllipse);
                break;
              case "Polyline":

                // Create Polyline with defined stroke
                var newPolyline =
                  new VGPolyline(
                    this.hideAOIDescription ? ShapeDrawAction.Edge : ShapeDrawAction.NameAndEdge, 
                    usedPen, 
                    usedFont, 
                    usedFontColor, 
                    usedStyleGroup, 
                    shapeName, 
                    usedElementGroup);
                newPolyline.TextAlignment = usedAlignment;
                foreach (var point in pointList)
                {
                  newPolyline.AddPt(point);
                }

                newPolyline.ClosePolyline();
                this.AoiCollection.Add(newPolyline);
                break;
            }
          }
        }

        // Reset Elements (deselect and clear all)
        this.ResetPicture();

        this.Elements.AddRange(this.AoiCollection);

        // If there were a selected element before updating, try
        // to select it again.
        if (this.SelectedElement != null)
        {
          foreach (VGElement element in this.Elements)
          {
            if (VGPolyline.Distance(element.Location, this.SelectedElement.Location) < 1)
            {
              this.SelectedElement = element;
              element.IsInEditMode = true;
            }
          }
        }

        this.DrawForeground(true);
      }
      catch (Exception ex)
      {
        ExceptionMethods.HandleException(ex);
      }
    }
        internal static void WriteExperiments(ADatabase db, ref int experimentGroup, List<ABaseblock> baseblockInfo, DataGridViewRowCollection calibvalues, int p1, int p2, string p3)
        {
            try
            {
                int groupID = WriteExperimentGroup(db, p1, p2, p3);
                foreach (ABaseblock baseblock in baseblockInfo)
                {
                    int count = 0;
                    foreach (int sysChannel in baseblock.sysChannelsIDs)
                    {
                        int experimentID = WriteExperiment(db, groupID, sysChannel, baseblock.comport, baseblock.channelsWithSensors, calibvalues[count].Cells[1].Value, count);
                        if (experimentID <= 0)
                        {
                        }
                        count++;
                    }

                }
                experimentGroup = groupID;
            }
            catch (Exception ex)
            {
                FileWorker.WriteEventFile(DateTime.Now, "DatabaseWorker", "WriteExperiments", ex.Message);
            }
        }
Beispiel #28
0
 private List<OrderDetail> Obsluga_GenerateOrderDetailsFromGridView(DataGridViewRowCollection gridViewRows)
 {
     List<OrderDetail> orderDetails = new List<OrderDetail>();
     foreach (DataGridViewRow row in gridViewRows)
     {
         var product = row.Tag as Product;
         var quantity = int.Parse((string)row.Cells["Obsluga_IloscHeader"].Value);
         var orderDetail = new OrderDetail()
         {
             Product = product,
             Quantity = quantity
         };
         orderDetails.Add(orderDetail);
     }
     return orderDetails;
 }
Beispiel #29
-1
 public AnalyzeArgument(DataGridViewRowCollection dataGridViewRowCollection)
 {
     files = new List<string>(dataGridViewRowCollection.Count);
     foreach (DataGridViewRow row in dataGridViewRowCollection)
     {
         files.Add((string)row.Cells[1].Value);
     }
 }