protected override void FillAttributes(System.Collections.IList attributeList)
 {
     base.FillAttributes(attributeList);
     if (desc != null)
     {
         attributeList.Add(new DescriptionAttribute(desc));
     }
     if (category != null)
     {
         attributeList.Add(new CategoryAttribute(category));
     }
     if (editorType != null)
     {
         attributeList.Add(new EditorAttribute(editorType, typeof(PropertyEditorCell)));
     }
 }
        /// <summary>
        /// Set grid selection to items.
        /// </summary>
        /// <param name="items">Breaks, which must be selected.</param>
        public void Select(System.Collections.IEnumerable items)
        {
            // Check that editing is not in progress.
            if (IsEditingInProgress)
            {
                throw new NotSupportedException(App.Current.FindString("EditingInProcessExceptionMessage"));
            }

            // Check that all items are breaks.
            foreach (object item in items)
            {
                if (!(item is Break))
                {
                    throw new ArgumentException(App.Current.FindString("BreaksTypeExceptionMessage"));
                }
            }

            // Add items to selection.
            this.Dispatcher.BeginInvoke(new Action(delegate()
            {
                SelectedItems.Clear();
                foreach (object item in items)
                {
                    SelectedItems.Add(item);
                }
            }), System.Windows.Threading.DispatcherPriority.Background);
        }
Esempio n. 3
0
 /// <summary>
 /// Make sure this list contains only these items.
 /// </summary>
 public static void SetItems(this System.Collections.IList List, System.Collections.IList Items)
 {
     if (isInside.ContainsKey(List))
     {
         return;
     }
     try
     {
         isInside[List] = null;
         for (int i = 0; i < List.Count; i++)
         {
             var item = List[i];
             if (Items.Contains(item))
             {
                 continue;
             }
             List.Remove(item);
             i--;
         }
         foreach (var item in Items)
         {
             if (!List.Contains(item))
             {
                 List.Add(item);
             }
         }
     }
     finally
     {
         isInside.Remove(List);
     }
 }
Esempio n. 4
0
 public static void AddAll(System.Collections.IList list, System.Collections.IEnumerable added)
 {
     foreach (object o in added)
     {
         list.Add(o);
     }
 }
Esempio n. 5
0
        public void IList_Add_WrongType()
        {
            var people = new EntitySet <Person>();

            System.Collections.IList list = people;
            list.Add("WrongType");
        }
Esempio n. 6
0
        void FillControl()
        {
            itemSource = Element.ItemsSource as System.Collections.IList;
            if (itemSource == null)
            {
                itemSource = new System.Collections.ArrayList();
                foreach (var o in Element.ItemsSource)
                {
                    itemSource.Add(o);
                }
            }

            var adapter = new SizableArrayAdapter(Context, Android.Resource.Layout.SimpleSpinnerItem, itemSource);

            adapter.TextSize = Element.FontSize;
            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            Control.Adapter = adapter;

            int index = itemSource.IndexOf(Element.SelectedItem);

            if (index != -1)
            {
                Control.SetSelection(index);
            }
        }
Esempio n. 7
0
        private void HandleChildCollections(XElement document, object parentObject)
        {
            IEnumerable <XNode> xNodes = document.Nodes();

            foreach (XElement element in xNodes)
            {
                if (element.Attribute("ObjectType") != null)
                {
                    if (element.Attribute("ObjectType").Value == "Collection")
                    {
                        string assemblyQualifiedClassNameCollection = element.Attribute("AssemblyQualifiedClassName").Value;
                        Type   collectionType = Type.GetType(assemblyQualifiedClassNameCollection);
                        System.Collections.IList childObjectCollection = (System.Collections.IList)Activator.CreateInstance(collectionType);

                        IEnumerable <XNode> childNodes = element.Nodes();
                        foreach (XElement childElement in childNodes)
                        {
                            string assemblyQualifiedClassNameChild = childElement.Attribute("AssemblyQualifiedClassName").Value;
                            Type   childType   = Type.GetType(assemblyQualifiedClassNameChild);
                            object childObject = Activator.CreateInstance(childType);
                            YellowstonePathology.Business.Persistence.XmlPropertyWriter rootXmlPropertyWriter = new Persistence.XmlPropertyWriter(childElement, childObject);
                            rootXmlPropertyWriter.Write();
                            childObjectCollection.Add(childObject);
                        }

                        PropertyInfo collectionPropertyInfo = parentObject.GetType().GetProperty(element.Name.ToString());
                        collectionPropertyInfo.SetValue(parentObject, childObjectCollection, null);
                    }
                }
            }
        }
Esempio n. 8
0
    public void Do()
    {
        PropertyInfo info = MapModifier.Instance.CurMap.GetType().GetProperty(valuename);

        System.Collections.IList test = (System.Collections.IList)info.GetValue(MapModifier.Instance.CurMap, null);
        test.Remove(old);
        test.Add(present);
    }
Esempio n. 9
0
        public static void FillThemeNames(System.Collections.IList list)
        {
            IEnumerator keys = _hash.Keys.GetEnumerator();

            while (keys.MoveNext())
            {
                list.Add(_hash[keys.Current].ToString());
            }
        }
Esempio n. 10
0
 /// <summary>
 /// Adds all of the strings in this trie alphabetically to the end of the given list, with each
 /// string prefixed by the given prefix.
 /// </summary>
 /// <param name="prefix">The prefix.</param>
 /// <param name="list">The list to which the strings are to be added.</param>
 public void AddAll(StringBuilder prefix, System.Collections.IList list)
 {
     if (_hasEmptyString)
     {
         list.Add(prefix.ToString());
     }
     prefix.Append(_childLabel);
     _child.AddAll(prefix, list);
     prefix.Length--;
 }
Esempio n. 11
0
        public void IList_Add_DuplicateItem()
        {
            var people = new EntitySet <Person>();
            var p      = new Person {
                FirstName = "A", LastName = "B"
            };

            people.Add(p);
            System.Collections.IList list = people;
            list.Add(p);
        }
Esempio n. 12
0
 /// <summary>
 /// Add range values to this List
 /// </summary>
 public static void AddRange(this System.Collections.IList Collection, System.Collections.IEnumerable Items, bool AllowRepeatedValues = true)
 {
     foreach (var item in Items)
     {
         if (!AllowRepeatedValues && Collection.Contains(item))
         {
             continue;
         }
         Collection.Add(item);
     }
 }
Esempio n. 13
0
        public void AddReferenceToCollection(object targetResource, string propertyName, object resourceToBeAdded)
        {
            PropertyInfo pi = targetResource.GetType().GetProperty(propertyName);

            if (pi == null)
            {
                throw new Exception("Can not find property");
            }
            System.Collections.IList collection = (System.Collections.IList)pi.GetValue(targetResource, null);
            collection.Add(resourceToBeAdded);
        }
Esempio n. 14
0
        private System.Collections.IList ToList(ISQLDbReader reader, Type type)
        {
            System.Collections.IList result =
                (System.Collections.IList)Activator.CreateInstance(typeof(List <>).MakeGenericType(type));
            while (reader.Read())
            {
                result.Add(MappingData(reader, type));
            }

            return(result);
        }
            public object Handle(IDataReader dataReader)
            {
                Type generic     = typeof(System.Collections.Generic.List <>);
                Type constructed = generic.MakeGenericType(_beanType);

                System.Collections.IList resultList = (System.Collections.IList)Activator.CreateInstance(constructed);
                while (dataReader.Read())
                {
                    resultList.Add(_valueType.GetValue(dataReader, 0)); // It's zero origin.
                }
                return(resultList);
            }
Esempio n. 16
0
        public virtual string getInsertDataStatement(int paramInt, string paramString)
        {
            string str = getDestTableName(paramInt, paramString);

            System.Collections.IList list = getCommaSeperatedColumnsNoFilterColumn(false, false);
            list.Insert(0, "REF__ID");
            if (!this.filterColumn.Equals(PrimaryKeyColumn))
            {
                list.Add(this.filterColumn);
            }
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            return("INSERT INTO " + str + "(" + (string)list.collect(Collectors.joining(",")) + ") VALUES(" + StringUtils.questionMarks(list.Count) + ")");
        }
Esempio n. 17
0
        public void AddAssignment(Assignment assignment)
        {
            foreach (Assignment item in _assignments)
            {
                if (assignment.Overlaps(item))
                {
                    throw new Exception("L'assegnazione si sovrappone ad un'altra già esistente");
                }
            }


            assignment.Booking = this;
            _assignments.Add(assignment);
        }
Esempio n. 18
0
 public void Do()
 {
     if (add == true)
     {
         PropertyInfo             info = MapModifier.Instance.CurMap.GetType().GetProperty(valuename);
         System.Collections.IList test = (System.Collections.IList)info.GetValue(MapModifier.Instance.CurMap, null);
         test.Add(obj);
     }
     else
     {
         PropertyInfo             info = MapModifier.Instance.CurMap.GetType().GetProperty(valuename);
         System.Collections.IList test = (System.Collections.IList)info.GetValue(MapModifier.Instance.CurMap, null);
         test.Remove(obj);
     }
 }
Esempio n. 19
0
        public virtual object BuildNonGenericCollectionInstance(CollectionObjectInfo coi, Type t)
        {
            System.Collections.IList       newCollection = (System.Collections.IList)System.Activator.CreateInstance(classPool.GetClass(coi.GetRealCollectionClassName()));
            System.Collections.IEnumerator iterator      = coi.GetCollection().GetEnumerator();
            AbstractObjectInfo             aoi           = null;

            while (iterator.MoveNext())
            {
                aoi = (AbstractObjectInfo)iterator.Current;
                if (!aoi.IsDeletedObject())
                {
                    newCollection.Add(BuildOneInstance(aoi));
                }
            }
            return(newCollection);
        }
Esempio n. 20
0
        private void  createEdgeList(ClosestFirstIterator iter, System.Object endVertex)
        {
            m_edgeList = new System.Collections.ArrayList();

            while (true)
            {
                Edge edge = iter.getSpanningTreeEdge(endVertex);

                if (edge == null)
                {
                    break;
                }

                m_edgeList.Add(edge);
                endVertex = edge.oppositeVertex(endVertex);
            }

            ((ArrayList)m_edgeList).Reverse();
        }
Esempio n. 21
0
        private int GetErrors(int pageIndex, System.Collections.IList errorEntryList, int pageSize = 15)
        {
            List <string> kEx = new List <string>();

            ConfigUtility.GetKException.Split(',').ToList().ForEach(x => kEx.Add(x.ToEnum <KExceptionType>().ToEnumDesc <KExceptionType>()));
            List <string> kExMsg = ConfigUtility.GetKExceptionMsg.Split(',').ToList();

            using (var db = new DbContextElmah())
            {
                using (var tran = db.Database.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted))
                {
                    int errorCount = db.ELMAH_Error
                                     .Where(x => kEx.Contains(x.Type) && !kExMsg.Any(y => x.Message.Contains(y)))
                                     .Count();

                    var eLMAH_Error = db.ELMAH_Error
                                      .Where(x => kEx.Contains(x.Type) && !kExMsg.Any(y => x.Message.Contains(y)))
                                      .OrderByDescending(x => x.Sequence)
                                      .Skip(pageIndex * pageSize)
                                      .Take(pageSize)
                                      .ToList();

                    eLMAH_Error.ForEach(x =>
                    {
                        errorEntryList.Add(new ErrorLogEntry(this, x.ErrorId.ToString(), new Error
                        {
                            ApplicationName    = x.Application,
                            Detail             = x.AllXml,
                            HostName           = x.Host,
                            Message            = x.Message,
                            Source             = x.Source,
                            StatusCode         = x.StatusCode,
                            Time               = x.TimeUtc,
                            Type               = x.Type,
                            User               = x.User,
                            WebHostHtmlMessage = ""
                        }));
                    });

                    return(errorCount);
                }
            }
        }
Esempio n. 22
0
    public int prGetMRZData(System.Collections.IList list)
    {
        try
        {
            if (_doc.IsValid())
            {
                string fieldName, text;
                int    j = "PR_DF_MRZ_".Length;
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                foreach (int i in Enum.GetValues(typeof(PR_DOCFIELD)))
                {
                    if (i <= (int)PR_DOCFIELD.PR_DF_MRZ_FIELDS)
                    {
                        continue;
                    }

                    fieldName = Enum.GetName(typeof(PR_DOCFIELD), i);
                    if (fieldName.StartsWith("PR_DF_MRZ_"))
                    {
                        text = _doc.Field(i);
                        text = text.Replace('<', ' ').Trim();
                        if (!string.IsNullOrEmpty(text))
                        {
                            text = fieldName.Substring(j).Replace('_', ' ') + ": " + text;
                            list.Add(text);
                        }
                    }
                }
            }
        }
        catch (gxException e)
        {
            return(_helper.GetErrorMessage(e, out _errorMessage));
        }
        catch (Exception e)
        {
            _errorMessage = e.Message + " --- prGetMRZData()";
            return(1305);
        }

        return(0);
    }
Esempio n. 23
0
 public void addWorldObject(System.Collections.IList toList, WorldObject worldObject, bool recursive)
 {
     if (!worldObject.HasIdData)
     {
         Core.IDQueue.AddToQueue(worldObject.Id);
     }
     if (worldObject.ObjectClass.Equals(ObjectClass.Container))
     {
         if (recursive)
         {
             foreach (WorldObject obj in Core.WorldFilter.GetByContainer(worldObject.Id))
             {
                 addWorldObject(toList, obj, recursive);
             }
         }
     }
     else
     {
         toList.Add(worldObject);
     }
 }
Esempio n. 24
0
        public override int GetErrors(int pageIndex, int pageSize, System.Collections.IList errorEntryList)
        {
            //return base.GetErrors(pageIndex, pageSize, errorEntryList);

            var count = base.GetErrors(pageIndex, pageSize, errorEntryList);

            List <ErrorLogEntry> filterErrorEntryList = new List <ErrorLogEntry>();

            foreach (ErrorLogEntry item in errorEntryList)
            {
                if (item.Error.Type == "System.Runtime.InteropServices.COMException")
                {
                    filterErrorEntryList.Add(item);
                }
            }

            errorEntryList.Clear();
            filterErrorEntryList.ForEach(y => errorEntryList.Add(y));


            return(errorEntryList.Count);
        }
		private System.Collections.IList lazyFindBiconnectedSets()
		{
			if (biconnectedSets_Renamed_Field == null)
			{
				biconnectedSets_Renamed_Field = new System.Collections.ArrayList();
				
                IList inspector = new ConnectivityInspector(graph).connectedSets();
                System.Collections.IEnumerator connectedSets = inspector.GetEnumerator();
				
				while (connectedSets.MoveNext())
				{
                    object obj = ((DictionaryEntry)connectedSets.Current).Value;
                    if (!(obj is CSGraphT.SupportClass.HashSetSupport))
                        continue;
					CSGraphT.SupportClass.SetSupport connectedSet = (CSGraphT.SupportClass.SetSupport)obj;
					if (connectedSet.Count == 1)
					{
						continue;
					}
					
					org._3pq.jgrapht.Graph subgraph = new Subgraph(graph, connectedSet, null);
					
					// do DFS
					
					// Stack for the DFS
					System.Collections.ArrayList vertexStack = new System.Collections.ArrayList();
					
					CSGraphT.SupportClass.SetSupport visitedVertices = new CSGraphT.SupportClass.HashSetSupport();
					IDictionary parent = new System.Collections.Hashtable();
					IList dfsVertices = new System.Collections.ArrayList();
					
					CSGraphT.SupportClass.SetSupport treeEdges = new CSGraphT.SupportClass.HashSetSupport();

                    System.Object currentVertex = subgraph.vertexSet()[0];//.ToArray()[0];

					vertexStack.Add(currentVertex);
					visitedVertices.Add(currentVertex);
					
					while (!(vertexStack.Count == 0))
					{
						currentVertex = SupportClass.StackSupport.Pop(vertexStack);
						
						System.Object parentVertex = parent[currentVertex];
						
						if (parentVertex != null)
						{
							Edge edge = subgraph.getEdge(parentVertex, currentVertex);
							
							// tree edge
							treeEdges.Add(edge);
						}
						
						visitedVertices.Add(currentVertex);
						
						dfsVertices.Add(currentVertex);
						
						System.Collections.IEnumerator edges = subgraph.edgesOf(currentVertex).GetEnumerator();
						while (edges.MoveNext())
						{
							// find a neighbour vertex of the current vertex 
							Edge edge = (Edge)edges.Current;
							
							if (!treeEdges.Contains(edge))
							{
								System.Object nextVertex = edge.oppositeVertex(currentVertex);
								
								if (!visitedVertices.Contains(nextVertex))
								{
									vertexStack.Add(nextVertex);
									
									parent[nextVertex] = currentVertex;
								}
								else
								{
									// non-tree edge
								}
							}
						}
					}
					
					// DFS is finished. Now create the auxiliary graph h
					// Add all the tree edges as vertices in h
					SimpleGraph h = new SimpleGraph();
					
					h.addAllVertices(treeEdges);
					
					visitedVertices.Clear();
					
					CSGraphT.SupportClass.SetSupport connected = new CSGraphT.SupportClass.HashSetSupport();
					
					for (System.Collections.IEnumerator it = dfsVertices.GetEnumerator(); it.MoveNext(); )
					{
						System.Object v = it.Current;
						
						visitedVertices.Add(v);
						
						// find all adjacent non-tree edges
						for (System.Collections.IEnumerator adjacentEdges = subgraph.edgesOf(v).GetEnumerator(); adjacentEdges.MoveNext();)
						{
							Edge l = (Edge)adjacentEdges.Current;
							if (!treeEdges.Contains(l))
							{
								h.addVertex(l);
								System.Object u = l.oppositeVertex(v);
								
								// we need to check if (u,v) is a back-edge
								if (!visitedVertices.Contains(u))
								{
									while (u != v)
									{
										System.Object pu = parent[u];
										Edge f = subgraph.getEdge(u, pu);
										
										h.addEdge(f, l);
										
										if (!connected.Contains(f))
										{
											connected.Add(f);
											u = pu;
										}
										else
										{
											u = v;
										}
									}
								}
							}
						}
					}
					
					ConnectivityInspector connectivityInspector = new ConnectivityInspector(h);
					
					biconnectedSets_Renamed_Field.Add(connectivityInspector.connectedSets());
				}
			}
			
			return biconnectedSets_Renamed_Field;
		}
Esempio n. 26
0
        public void Init(System.String LoadFN, bool StreamMode)
        {
			streamMode = StreamMode;
			
			// application
			
//			Closing += new System.ComponentModel.CancelEventHandler(this.MainWindow_Closing_DISPOSE_ON_CLOSE);
			// JFrame.setDefaultLookAndFeelDecorated(false);
			
			//UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'"
			//GetType();
			//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
            
            mainIcon = new Bitmap(Utility.GetFullPath("images\\MainIcon.png"));
			//Icon = System.Drawing.Icon.FromHandle(((System.Drawing.Bitmap) mainIcon).GetHicon());
			//UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'"
			GetType();
			//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
            mainLogo = new Bitmap(Utility.GetFullPath("/images/MainLogo.png"));


            templ = new Templates();
			
			// toolbar

			ImageList temp_ImageList;
			temp_ImageList = new System.Windows.Forms.ImageList();
			// temp_ToolBar = new System.Windows.Forms.ToolBar();
            toolButtons = new Button[TOOL_COUNT];
			//UPGRADE_TODO: Class 'javax.swing.Image' was converted to 'System.Drawing.Image' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingImageIcon'"
			toolIcons = new System.Drawing.Image[TOOL_COUNT];
			//UPGRADE_TODO: Class 'javax.swing.ButtonGroup' was converted to 'System.Collections.IList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			toolGroup = new ArrayList();
			for (int n = 0; n < TOOL_COUNT; n++)
			{
				//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
				toolIcons[n] = new Bitmap(Utility.GetFullPath("/images/" + IMAGE_TOOL[n] + ".png"));
				if (ACTIVE_TOOL[n])
				{
                    toolButtons[n] = new Button();
                    toolButtons[n].Image = toolIcons[n]; 
					toolGroup.Add((System.Object) toolButtons[n]);
					System.Windows.Forms.ToolBarButton temp_ToolBarButton;
					//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
					// tools.Items.Add(toolButtons[n]);
                    SupportClass.CommandManager.CheckCommand(toolButtons[n]);
                    SupportClass.ToolTipSupport.setToolTipText(toolButtons[n], TOOL_TIPS[n]);
				}
				/*else {toolButtons[n]=new JButton(toolIcons[n]);
				tools.Add(toolButtons[n]);
				toolButtons[n].addActionListener(this);}*/
			}
			//UPGRADE_TODO: Method 'javax.swing.AbstractButton.getModel' was converted to 'ToolStripButtonBase' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			SupportClass.ButtonGroupSupport.SetSelected(toolGroup, toolButtons[TOOL_CURSOR], true);
			
			toolButtons[TOOL_SETATOM].MouseDown += new System.Windows.Forms.MouseEventHandler(mouseDown);
			toolButtons[TOOL_SETATOM].MouseDown += new System.Windows.Forms.MouseEventHandler(this.mousePressed);
			toolButtons[TOOL_SETATOM].KeyDown += new System.Windows.Forms.KeyEventHandler(keyDown);
			toolButtons[TOOL_SETATOM].KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed);
			toolButtons[TOOL_SETATOM].KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped);
			toolButtons[TOOL_TEMPLATE].MouseDown += new System.Windows.Forms.MouseEventHandler(mouseDown);
			toolButtons[TOOL_TEMPLATE].MouseDown += new System.Windows.Forms.MouseEventHandler(this.mousePressed);
			
			SelectElement("C");
			
			// menus
			
			System.Windows.Forms.MainMenu menubar = new System.Windows.Forms.MainMenu();
			
			System.Windows.Forms.MenuItem menufile = new System.Windows.Forms.MenuItem("&File");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menufile.setMnemonic((int) System.Windows.Forms.Keys.F);
			menufile.MenuItems.Add(MenuItem("New", (int) System.Windows.Forms.Keys.N, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('N' | (int) System.Windows.Forms.Keys.Control))));
			menufile.MenuItems.Add(MenuItem("New Window", (int) System.Windows.Forms.Keys.W, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('N' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menufile.MenuItems.Add(MenuItem("Open", (int) System.Windows.Forms.Keys.O, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('O' | (int) System.Windows.Forms.Keys.Control))));
			if (!streamMode)
				menufile.MenuItems.Add(MenuItem("Save", (int) System.Windows.Forms.Keys.S, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('S' | (int) System.Windows.Forms.Keys.Control))));
			menufile.MenuItems.Add(MenuItem("Save As", (int) System.Windows.Forms.Keys.A));
			System.Windows.Forms.MenuItem menuexport = new System.Windows.Forms.MenuItem("&Export");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuexport.setMnemonic((int) System.Windows.Forms.Keys.X);
			menuexport.MenuItems.Add(MenuItem("as MDL MOL", (int) System.Windows.Forms.Keys.M, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('M' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuexport.MenuItems.Add(MenuItem("as CML XML", (int) System.Windows.Forms.Keys.X, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('X' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menufile.MenuItems.Add(menuexport);
			menufile.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			if (!streamMode)
				menufile.MenuItems.Add(MenuItem("Quit", (int) System.Windows.Forms.Keys.Q, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Q' | (int) System.Windows.Forms.Keys.Control))));
			else
				menufile.MenuItems.Add(MenuItem("Save & Quit", (int) System.Windows.Forms.Keys.Q, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Q' | (int) System.Windows.Forms.Keys.Control))));
			
			System.Windows.Forms.MenuItem menuedit = new System.Windows.Forms.MenuItem("&Edit");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuedit.setMnemonic((int) System.Windows.Forms.Keys.E);
			menuedit.MenuItems.Add(MenuItem("Edit...", (int) System.Windows.Forms.Keys.E, toolIcons[TOOL_DIALOG], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) (' ' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Undo", (int) System.Windows.Forms.Keys.U, toolIcons[TOOL_UNDO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Z' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Redo", (int) System.Windows.Forms.Keys.R, toolIcons[TOOL_REDO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Z' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuedit.MenuItems.Add(MenuItem("Cut", (int) System.Windows.Forms.Keys.X, toolIcons[TOOL_CUT], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('X' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Copy", (int) System.Windows.Forms.Keys.C, toolIcons[TOOL_COPY], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('C' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Paste", (int) System.Windows.Forms.Keys.V, toolIcons[TOOL_PASTE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('V' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			menuedit.MenuItems.Add(MenuItem("Select All", (int) System.Windows.Forms.Keys.S, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('A' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Next Atom", (int) System.Windows.Forms.Keys.N, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('E' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Previous Atom", (int) System.Windows.Forms.Keys.P, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('E' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuedit.MenuItems.Add(MenuItem("Next Group", (int) System.Windows.Forms.Keys.G, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('G' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Previous Group", (int) System.Windows.Forms.Keys.R, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('G' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			menuedit.MenuItems.Add(MenuItem("Flip Horizontal", (int) System.Windows.Forms.Keys.H, null, null));
			menuedit.MenuItems.Add(MenuItem("Flip Vertical", (int) System.Windows.Forms.Keys.V, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate +45°", (int) System.Windows.Forms.Keys.D4, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate -45°", (int) System.Windows.Forms.Keys.D5, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate +90°", (int) System.Windows.Forms.Keys.D9, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate -90°", (int) System.Windows.Forms.Keys.D0, null, null));
			menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			menuedit.MenuItems.Add(MenuItem("Add Temporary Template", (int) System.Windows.Forms.Keys.T, null, null));
			menuedit.MenuItems.Add(MenuItem("Normalise Bond Lengths", (int) System.Windows.Forms.Keys.N, null, null));
			
			System.Windows.Forms.MenuItem menuview = new System.Windows.Forms.MenuItem("&View");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuview.setMnemonic((int) System.Windows.Forms.Keys.V);
			menuview.MenuItems.Add(MenuItem("Zoom Full", (int) System.Windows.Forms.Keys.F, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('0' | (int) System.Windows.Forms.Keys.Control))));
			menuview.MenuItems.Add(MenuItem("Zoom In", (int) System.Windows.Forms.Keys.I, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('=' | (int) System.Windows.Forms.Keys.Control))));
			menuview.MenuItems.Add(MenuItem("Zoom Out", (int) System.Windows.Forms.Keys.O, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('-' | (int) System.Windows.Forms.Keys.Control))));
			menuview.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			//UPGRADE_TODO: Class 'javax.swing.ButtonGroup' was converted to 'System.Collections.IList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			System.Collections.IList showBG = new ArrayList();
			menuview.MenuItems.Add(RadioMenuItem("Show Elements", (int) System.Windows.Forms.Keys.E, true, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show All Elements", (int) System.Windows.Forms.Keys.A, false, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show Indices", (int) System.Windows.Forms.Keys.I, false, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show Ring ID", (int) System.Windows.Forms.Keys.R, false, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show CIP Priority", (int) System.Windows.Forms.Keys.C, false, showBG));
			
			System.Windows.Forms.MenuItem menutool = new System.Windows.Forms.MenuItem("&Tool");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menutool.setMnemonic((int) System.Windows.Forms.Keys.T);
			menutool.MenuItems.Add(MenuItem("Cursor", (int) System.Windows.Forms.Keys.C, toolIcons[TOOL_CURSOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ((int) System.Windows.Forms.Keys.Escape | 0))));
			menutool.MenuItems.Add(MenuItem("Rotator", (int) System.Windows.Forms.Keys.R, toolIcons[TOOL_ROTATOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('R' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Erasor", (int) System.Windows.Forms.Keys.E, toolIcons[TOOL_ERASOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('D' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Edit Atom", (int) System.Windows.Forms.Keys.A, toolIcons[TOOL_EDIT], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) (',' | (int) System.Windows.Forms.Keys.Control))));
			//UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'"
			GetType();
			//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
			menutool.MenuItems.Add(MenuItem("Set Atom", (int) System.Windows.Forms.Keys.S, new Bitmap(Utility.GetFullPath("/images/ASelMenu.png")), new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('.' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Single Bond", (int) System.Windows.Forms.Keys.D1, toolIcons[TOOL_SINGLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('1' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Double Bond", (int) System.Windows.Forms.Keys.D2, toolIcons[TOOL_DOUBLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('2' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Triple Bond", (int) System.Windows.Forms.Keys.D3, toolIcons[TOOL_TRIPLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('3' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Zero Bond", (int) System.Windows.Forms.Keys.D0, toolIcons[TOOL_ZERO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('0' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Inclined Bond", (int) System.Windows.Forms.Keys.I, toolIcons[TOOL_INCLINED]));
			menutool.MenuItems.Add(MenuItem("Declined Bond", (int) System.Windows.Forms.Keys.D, toolIcons[TOOL_DECLINED]));
			menutool.MenuItems.Add(MenuItem("Unknown Bond", (int) System.Windows.Forms.Keys.U, toolIcons[TOOL_UNKNOWN]));
			menutool.MenuItems.Add(MenuItem("Charge", (int) System.Windows.Forms.Keys.H, toolIcons[TOOL_CHARGE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('H' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Template Tool", (int) System.Windows.Forms.Keys.T, toolIcons[TOOL_TEMPLATE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('T' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Select Template", (int) System.Windows.Forms.Keys.T, toolIcons[TOOL_TEMPLATE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('T' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			System.Windows.Forms.MenuItem menuhydr = new System.Windows.Forms.MenuItem("H&ydrogen");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuhydr.setMnemonic((int) System.Windows.Forms.Keys.Y);
			chkShowHydr = new System.Windows.Forms.MenuItem("Show H&ydrogen");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// chkShowHydr.setMnemonic((int) System.Windows.Forms.Keys.Y);
			chkShowHydr.Checked = true;
			chkShowHydr.Click += new System.EventHandler(this.actionPerformed);
			SupportClass.CommandManager.CheckCommand(chkShowHydr);
			menuhydr.MenuItems.Add(chkShowHydr);
			menuhydr.MenuItems.Add(MenuItem("Set Explicit", (int) System.Windows.Forms.Keys.E));
			menuhydr.MenuItems.Add(MenuItem("Clear Explicit", (int) System.Windows.Forms.Keys.X));
			menuhydr.MenuItems.Add(MenuItem("Zero Explicit", (int) System.Windows.Forms.Keys.Z));
			menuhydr.MenuItems.Add(MenuItem("Create Actual", (int) System.Windows.Forms.Keys.C));
			menuhydr.MenuItems.Add(MenuItem("Delete Actual", (int) System.Windows.Forms.Keys.D));
			
			System.Windows.Forms.MenuItem menuster = new System.Windows.Forms.MenuItem("&Stereochemistry");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			//menuster.setMnemonic((int) System.Windows.Forms.Keys.S);
			chkShowSter = new System.Windows.Forms.MenuItem("Show Stereo&labels");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// chkShowSter.setMnemonic((int) System.Windows.Forms.Keys.L);
			chkShowSter.Checked = false;
			chkShowSter.Click += new System.EventHandler(this.actionPerformed);
			SupportClass.CommandManager.CheckCommand(chkShowSter);
			menuster.MenuItems.Add(chkShowSter);
			menuster.MenuItems.Add(MenuItem("Invert Stereochemistry", (int) System.Windows.Forms.Keys.I));
			menuster.MenuItems.Add(MenuItem("Set R/Z", (int) System.Windows.Forms.Keys.R));
			menuster.MenuItems.Add(MenuItem("Set S/E", (int) System.Windows.Forms.Keys.S));
			menuster.MenuItems.Add(MenuItem("Cycle Wedges", (int) System.Windows.Forms.Keys.C));
			menuster.MenuItems.Add(MenuItem("Remove Wedges", (int) System.Windows.Forms.Keys.W));
			
			System.Windows.Forms.MenuItem menuhelp = new System.Windows.Forms.MenuItem("&Help");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuhelp.setMnemonic((int) System.Windows.Forms.Keys.H);
			menuhelp.MenuItems.Add(MenuItem("About", (int) System.Windows.Forms.Keys.A));
			
			menubar.MenuItems.Add(menufile);
			menubar.MenuItems.Add(menuedit);
			menubar.MenuItems.Add(menuview);
			menubar.MenuItems.Add(menutool);
			menubar.MenuItems.Add(menuhydr);
			menubar.MenuItems.Add(menuster);
			//UPGRADE_ISSUE: Method 'javax.swing.Box.createHorizontalGlue' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingBox'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
            // TODO: Figure out what horizontal glue is and find equiv
            //System.Windows.Forms.Control temp_Control;
            //temp_Control = Box.createHorizontalGlue();
            //menubar.Controls.Add(temp_Control);
			menubar.MenuItems.Add(menuhelp);
			
			// molecule
			
			editor = new EditorPane(this.Width, this.Height, false);
            editor.SetMolSelectListener((MolSelectListener)this); 
            
			//UPGRADE_TODO: Class 'javax.swing.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			//UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'"
			System.Windows.Forms.ScrollableControl temp_scrollablecontrol;
			temp_scrollablecontrol = new System.Windows.Forms.ScrollableControl();
			temp_scrollablecontrol.AutoScroll = true;
			temp_scrollablecontrol.Controls.Add(editor);
			System.Windows.Forms.ScrollableControl scroll = temp_scrollablecontrol;
			
			// overall layout
			
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
			//UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
			/*
			((System.Windows.Forms.ContainerControl) this).setLayout(new BorderLayout());*/
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
			((System.Windows.Forms.ContainerControl) this).Controls.Add(scroll);
			scroll.Dock = System.Windows.Forms.DockStyle.Fill;
			scroll.BringToFront();
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
			// ((System.Windows.Forms.ContainerControl) this).Controls.Add(menubar);
			// menubar.Dock = System.Windows.Forms.DockStyle.Top;
			// menubar.SendToBack();
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
			//UPGRADE_ISSUE: Method 'java.awt.Window.pack' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtWindowpack'"
// 			pack();
			
			editor.Focus();
			
			editor.SetToolCursor();
			
			if (LoadFN != null)
			{
				try
				{
					//UPGRADE_TODO: Constructor 'java.io.FileInputStream.FileInputStream' was converted to 'System.IO.FileStream.FileStream' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioFileInputStreamFileInputStream_javalangString'"
					System.IO.FileStream istr = new System.IO.FileStream(LoadFN, System.IO.FileMode.Open, System.IO.FileAccess.Read);
					Molecule frag = MoleculeStream.ReadUnknown(istr);
					editor.AddArbitraryFragment(frag);
					istr.Close();
				}
				catch (System.IO.IOException e)
				{
					//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.toString' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
					SupportClass.OptionPaneSupport.ShowMessageDialog(null, e.ToString(), "Open Failed", (int) System.Windows.Forms.MessageBoxIcon.Error);
					return ;
				}
				
				SetFilename(LoadFN);
				editor.NotifySaved();
			}
			if (streamMode)
				ReadStream();
			
			KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed);
			KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped);
			editor.KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed);
			editor.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped);
		}
Esempio n. 27
0
        /// <summary> Constructs a minimum cycle basis of a graph.
        ///
        /// </summary>
        /// <param name="g">the graph for the cycle basis
        /// </param>
        public CycleBasis(UndirectedGraph g)
        {
            baseGraph = g;

            // We construct a simple graph out of the input (multi-)graph
            // as a subgraph with no multiedges.
            // The removed edges are collected in multiEdgeList
            // Moreover, shortest cycles through these edges are constructed and
            // collected in mulitEdgeCycles

            UndirectedGraph simpleGraph = new UndirectedSubgraph(g, null, null);

            // Iterate over the edges and discard all edges with the same source and target
            //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
            for (System.Collections.IEnumerator it = g.edgeSet().GetEnumerator(); it.MoveNext();)
            {
                //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                Edge                     edge  = (Edge)((DictionaryEntry)it.Current).Value;
                System.Object            u     = edge.Source;
                System.Object            v     = edge.Target;
                System.Collections.IList edges = simpleGraph.getAllEdges(u, v);
                if (edges.Count > 1)
                {
                    // Multiple edges between u and v.
                    // Keep the edge with the least weight


                    Edge minEdge = edge;
                    //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                    for (System.Collections.IEnumerator jt = edges.GetEnumerator(); jt.MoveNext();)
                    {
                        //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                        Edge nextEdge = (Edge)jt.Current;
                        minEdge = nextEdge.Weight < minEdge.Weight ? nextEdge : minEdge;
                    }

                    //  ...and remove the others.
                    //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                    for (System.Collections.IEnumerator jt = edges.GetEnumerator(); jt.MoveNext();)
                    {
                        //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                        Edge nextEdge = (Edge)jt.Current;
                        if (nextEdge != minEdge)
                        {
                            // Remove edge from the graph
                            simpleGraph.removeEdge(nextEdge);

                            // Create a new cycle through this edge by finding
                            // a shortest path between the vertices of the edge
                            //UPGRADE_TODO: Class 'java.util.HashSet' was converted to 'CSGraphT.SupportClass.HashSetSupport' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashSet'"
                            CSGraphT.SupportClass.SetSupport edgesOfCycle = new CSGraphT.SupportClass.HashSetSupport();
                            edgesOfCycle.Add(nextEdge);
                            edgesOfCycle.AddAll(DijkstraShortestPath.findPathBetween(simpleGraph, u, v));

                            multiEdgeList.Add(nextEdge);
                            mulitEdgeCycles.Add(new SimpleCycle(baseGraph, edgesOfCycle));
                        }
                    }
                }
            }

            System.Collections.IList biconnectedComponents = new BiconnectivityInspector(simpleGraph).biconnectedSets();

            for (IEnumerator it = biconnectedComponents.GetEnumerator(); it.MoveNext();)
            {
                CSGraphT.SupportClass.SetSupport edges = (CSGraphT.SupportClass.SetSupport)it.Current;
                //IList edges = (IList)it.Current;

                if (edges.Count > 1)
                {
                    CSGraphT.SupportClass.SetSupport vertices = new CSGraphT.SupportClass.HashSetSupport();
                    for (System.Collections.IEnumerator edgeIt = edges.GetEnumerator(); edgeIt.MoveNext();)
                    {
                        Edge edge = (Edge)((DictionaryEntry)edgeIt.Current).Value;
                        vertices.Add(edge.Source);
                        vertices.Add(edge.Target);
                    }
                    UndirectedGraph subgraph = new UndirectedSubgraph(simpleGraph, vertices, edges);

                    SimpleCycleBasis cycleBasis = new SimpleCycleBasis(subgraph);

                    subgraphBases.Add(cycleBasis);
                }
                else
                {
                    Edge edge = (Edge)((DictionaryEntry)edges.GetEnumerator().Current).Value;
                    multiEdgeList.Add(edge);
                }
            }
        }
        /// <summary>  Initialize the factory - setup all permissions
        /// load all global libraries.
        /// </summary>
        public void InitVelocimacro()
        {
            /*
             *  maybe I'm just paranoid...
             */
            lock (this)
            {
                log.Trace("initialization starting.");

                /*
                 *   allow replacements while we Add the libraries, if exist
                 */
                SetReplacementPermission(true);

                /*
                 *  Add all library macros to the global namespace
                 */

                vmManager.NamespaceUsage = false;

                /*
                 *  now, if there is a global or local libraries specified, use them.
                 *  All we have to do is Get the template. The template will be parsed;
                 *  VM's  are added during the parse phase
                 */

                object libfiles = rsvc.GetProperty(RuntimeConstants.VM_LIBRARY);

                if (libfiles == null)
                {
                    log.Debug("\"" + RuntimeConstants.VM_LIBRARY + "\" is not set.  Trying default library: " + NVelocity.Runtime.RuntimeConstants.VM_LIBRARY_DEFAULT);

                    // try the default library.
                    if (rsvc.GetLoaderNameForResource(RuntimeConstants.VM_LIBRARY_DEFAULT) != null)
                    {
                        libfiles = RuntimeConstants.VM_LIBRARY_DEFAULT;
                    }
                    else
                    {
                        log.Debug("Default library not found.");
                    }
                }

                if (libfiles != null)
                {
                    macroLibVec = new ArrayList();
                    if (libfiles is ArrayList)
                    {
                        var lbs = (ArrayList)libfiles;

                        foreach (var lb in lbs)
                        {
                            macroLibVec.Add(lb);
                        }
                    }
                    else if (libfiles is string)
                    {
                        macroLibVec.Add(libfiles);
                    }

                    for (int i = 0, is_Renamed = macroLibVec.Count; i < is_Renamed; i++)
                    {
                        string lib = (string)macroLibVec[i];

                        /*
                         * only if it's a non-empty string do we bother
                         */

                        if (!String.IsNullOrEmpty(lib))
                        {
                            /*
                             *  let the VMManager know that the following is coming
                             *  from libraries - need to know for auto-load
                             */

                            vmManager.RegisterFromLib = true;

                            log.Debug("adding VMs from VM library : " + lib);

                            try
                            {
                                Template template = rsvc.GetTemplate(lib);

                                /*
                                 *  save the template.  This depends on the assumption
                                 *  that the Template object won't change - currently
                                 *  this is how the Resource manager works
                                 */

                                Twonk twonk = new Twonk();
                                twonk.template         = template;
                                twonk.modificationTime = template.LastModified;
                                libModMap[lib]         = twonk;
                            }
                            catch (System.Exception e)
                            {
                                string msg = "Velocimacro : Error using VM library : " + lib;
                                log.Error(true, msg, e);
                            }

                            log.Trace("VM library registration complete.");

                            vmManager.RegisterFromLib = false;
                        }
                    }
                }

                /*
                 *   now, the permissions
                 */


                /*
                 *  allowinline : anything after this will be an inline macro, I think
                 *  there is the question if a #include is an inline, and I think so
                 *
                 *  default = true
                 */
                SetAddMacroPermission(true);

                if (!rsvc.GetBoolean(RuntimeConstants.VM_PERM_ALLOW_INLINE, true))
                {
                    SetAddMacroPermission(false);

                    log.Debug("allowInline = false : VMs can NOT be defined inline in templates");
                }
                else
                {
                    log.Debug("allowInline = true : VMs can be defined inline in templates");
                }

                /*
                 *  allowInlineToReplaceGlobal : allows an inline VM , if allowed at all,
                 *  to replace an existing global VM
                 *
                 *  default = false
                 */
                SetReplacementPermission(false);

                if (rsvc.GetBoolean(RuntimeConstants.VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL, false))
                {
                    SetReplacementPermission(true);

                    log.Debug("allowInlineToOverride = true : VMs " + "defined inline may replace previous VM definitions");
                }
                else
                {
                    log.Debug("allowInlineToOverride = false : VMs " + "defined inline may NOT replace previous VM definitions");
                }

                /*
                 * now turn on namespace handling as far as permissions allow in the
                 * manager, and also set it here for gating purposes
                 */
                vmManager.NamespaceUsage = true;

                /*
                 *  template-local inline VM mode : default is off
                 */
                TemplateLocalInline = rsvc.GetBoolean(Runtime.RuntimeConstants.VM_PERM_INLINE_LOCAL, false);

                if (TemplateLocalInline)
                {
                    log.Debug("allowInlineLocal = true : VMs " + "defined inline will be local to their defining template only.");
                }
                else
                {
                    log.Debug("allowInlineLocal = false : VMs " + "defined inline will be global in scope if allowed.");
                }

                vmManager.TemplateLocalInlineVM = TemplateLocalInline;

                /*
                 *  autoload VM libraries
                 */
                Autoload = rsvc.GetBoolean(RuntimeConstants.VM_LIBRARY_AUTORELOAD, false);

                if (Autoload)
                {
                    log.Debug("autoload on : VM system " + "will automatically reload global library macros");
                }
                else
                {
                    log.Debug("autoload off : VM system " + "will not automatically reload global library macros");
                }

                log.Trace("Velocimacro : initialization complete.");
            }
        }
Esempio n. 29
0
 /// <summary> .
 ///
 /// </summary>
 /// <param name="e">
 /// </param>
 public virtual void  addEdge(Edge e)
 {
     m_vertexEdges.Add(e);
 }
Esempio n. 30
0
 /// <summary> .
 ///
 /// </summary>
 /// <param name="e">
 /// </param>
 public virtual void  addOutgoingEdge(Edge e)
 {
     m_outgoing.Add(e);
 }
Esempio n. 31
0
 /// <summary> .
 ///
 /// </summary>
 /// <param name="e">
 /// </param>
 public virtual void  addIncomingEdge(Edge e)
 {
     m_incoming.Add(e);
 }
Esempio n. 32
0
        public bool ShowModal(IMapControl3 mapControl, IEngineNetworkAnalystEnvironment naEnv)
        {
            // Initialize variables
            m_okClicked = false;
            m_lstLayers = new System.Collections.ArrayList();
            this.Text = "Load Locations into " + naEnv.NAWindow.ActiveCategory.Layer.Name;

            // Loop through all the layers, adding the point feature layers to the combo box and array
            IEnumLayer layers = mapControl.Map.get_Layers(null, true);
            ILayer layer;
            layer = layers.Next();
            while (layer != null)
            {
                IFeatureLayer fLayer = layer as IFeatureLayer;
                IDisplayTable displayTable = layer as IDisplayTable;

                if ((fLayer != null) && (displayTable != null))
                {
                    IFeatureClass fClass = fLayer.FeatureClass;
                    if (fClass.ShapeType == esriGeometryType.esriGeometryPoint)
                    {
                        // Add the layer name to the combobox and the layer to the list
                        cboPointLayers.Items.Add(layer.Name);
                        m_lstLayers.Add(layer);
                    }
                }
                layer = layers.Next();
            }
            //Select the first point feature layer from the list
            if (cboPointLayers.Items.Count > 0)
                cboPointLayers.SelectedIndex = 0;

            // Show the window
            this.ShowDialog();

            // If we selected a layer and clicked OK, load the locations
            if (m_okClicked && (cboPointLayers.SelectedIndex >= 0))
            {
                // Get the NALayer and NAContext
                INALayer naLayer = naEnv.NAWindow.ActiveAnalysis;
                INAContext naContext = naLayer.Context;

                //Get the active category
                IEngineNAWindowCategory activeCategory = naEnv.NAWindow.ActiveCategory;
                INAClass naClass = activeCategory.NAClass;
                IDataset naDataset = naClass as IDataset;

                // Get a cursor to the input features (either though the selection set or table)
                // Use IDisplayTable because it accounts for joins, querydefs, etc.
                IDisplayTable displayTable = m_lstLayers[cboPointLayers.SelectedIndex] as IDisplayTable;
                ICursor cursor;
                if (chkUseSelectedFeatures.Checked)
                {
                    ISelectionSet selSet;
                    selSet = displayTable.DisplaySelectionSet;
                    selSet.Search(null, false, out cursor);
                }
                else
                {
                    cursor = displayTable.SearchDisplayTable(null, false);
                }

                // Setup NAClassLoader and Load Locations
                INAClassLoader2 naClassLoader = new NAClassLoader() as INAClassLoader2;
                naClassLoader.Initialize(naContext, naDataset.Name, cursor);
                int rowsIn = 0;
                int rowsLocated = 0;
                naClassLoader.Load(cursor, null, ref rowsIn, ref rowsLocated);

                return true;
            }
            else
            {
                return false;
            }
        }
Esempio n. 33
0
 public override SC.IEnumerable Write(SC.IEnumerable enumerableInstance, object value)
 {
     SC.IList list = (SC.IList)enumerableInstance;
     list.Add(value);
     return(list);
 }