Esempio n. 1
0
 void AddSources(System.Collections.IList sources)
 {
     if (sources == null || MapView == null || MapView.Style == null)
     {
         return;
     }
     foreach (ShapeSource source in sources)
     {
         if (source.Id != null && source.Shape != null)
         {
             var shape     = ShapeFromAnnotation(source.Shape);
             var sourceId  = (NSString)("NXCustom_" + source.Id);
             var oldSource = MapView.Style?.SourceWithIdentifier(sourceId);
             if (oldSource != null && oldSource is MGLShapeSource)
             {
                 (oldSource as MGLShapeSource).Shape = shape;
             }
             else
             {
                 var mglSource = new MGLShapeSource(sourceId, shape, null);
                 MapView.Style.AddSource(mglSource);
             }
         }
     }
 }
Esempio n. 2
0
 protected internal virtual void setProjectDatabaseSession(Session paramSession, ProjectUrlTable paramProjectUrlTable)
 {
     this.projectSession = paramSession;
     this.urlTable       = paramProjectUrlTable;
     if (paramSession == null)
     {
         return;
     }
     System.Collections.IList list = paramSession.createQuery("from ProjectVariableTable as o where o.projectId = :projectId").setLong("projectId", paramProjectUrlTable.ProjectUrlId.Value).list();
     foreach (ProjectVariableTable projectVariableTable in list)
     {
         string str1 = projectVariableTable.Name;
         string str2 = null;
         if (projectVariableTable.Number.Value)
         {
             str2 = projectVariableTable.StoredValueNum;
         }
         else
         {
             str2 = projectVariableTable.StoredValue;
         }
         if (string.ReferenceEquals(str2, null))
         {
             continue;
         }
         this.projectVariableNameValueMap[str1] = str2;
     }
 }
Esempio n. 3
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. 4
0
        public virtual void sort()
        {
            this.ordered   = new List <object>();
            this.traversed = new HashSet <object>();
            null           = this.nodes.GetEnumerator();
            HashSet <object> hashSet = new HashSet <object>(this.nodes);

            while (null.hasNext())
            {
                object        @object = null.next();
                ISet <object> set     = (ISet <object>) this.inbounds[@object];
                if (set == null || set.Count == 0)
                {
                    traverse(@object);
                    hashSet.remove(@object);
                }
            }
            foreach (object @object in hashSet)
            {
                if (!this.traversed.Contains(@object))
                {
                    traverse(@object);
                }
            }
        }
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
        public void IList_Remove_WrongTypeIsIgnored()
        {
            var people = new EntitySet <Person>();

            System.Collections.IList list = people;
            list.Remove("DoesNotExist");
        }
        private IDictionary <string, IndexOperation> getIndexOperations(Session paramSession, int paramInt, string paramString1, string paramString2)
        {
            Hashtable hashMap = new Hashtable();

            if (paramInt == ProjectServerDBUtil.SQLSERVER_DBMS)
            {
                string   str                  = string.Format("WITH k AS ( SELECT *      FROM sys.dm_db_index_physical_stats      (DB_ID( N'{0}' ), OBJECT_ID( N'{1}' ), NULL, NULL, NULL) ) SELECT QUOTENAME( s.name ) as indexName,        k.avg_fragmentation_in_percent as fragmentation FROM k LEFT JOIN sys.indexes AS s ON k.index_id=s.index_id    AND s.object_id=k.object_id;", new object[] { paramString1, paramString2 });
                SQLQuery sQLQuery             = paramSession.createSQLQuery(str);
                System.Collections.IList list = sQLQuery.list();
                foreach (object[] arrayOfObject in list)
                {
                    string str1   = (string)arrayOfObject[0];
                    Number number = (Number)arrayOfObject[1];
                    if (number.intValue() > 30)
                    {
                        l.info(string.Format("Index {0} on table {1} has a fragmentation value of {2:D}. It will Rebuilded", new object[] { str1, paramString2, Convert.ToInt32(number.intValue()) }));
                        hashMap[str1] = new SqlServerRebuildIndexOperation();
                        continue;
                    }
                    if (number.intValue() > 5)
                    {
                        l.info(string.Format("Index {0} on table {1} has a fragmentation value of {2:D}. It will Reorganized", new object[] { str1, paramString2, Convert.ToInt32(number.intValue()) }));
                        hashMap[str1] = new SqlServerReorganizeIndexOperation();
                    }
                }
            }
            return(hashMap);
        }
Esempio n. 8
0
        public static string SerializeToJson <T>(T t)
        {
            using (MemoryStream ms = new MemoryStream())
            {
                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T));
                ser.WriteObject(ms, t);

                string         jsonString     = Encoding.UTF8.GetString(ms.ToArray());
                string         p              = @"\\/Date\((\d+)\+\d+\)\\/";
                MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertJsonDateToDateString);
                Regex          reg            = new Regex(p);
                jsonString = reg.Replace(jsonString, matchEvaluator);
                //如果是数组

                if (jsonString.StartsWith("[") && jsonString.EndsWith("]"))
                {
                    string name = t.GetType().Name;
                    if (t is System.Collections.ArrayList)
                    {
                        string[] arr = name.Split(new string[] { "[]" }, StringSplitOptions.None);
                        if (arr.Length > 0)
                        {
                            name = arr[0] + "s";
                        }
                    }
                    else if (t is System.Collections.IList)
                    {
                        System.Collections.IList list = (System.Collections.IList)t;
                        name = list[0].GetType().Name + "s";
                    }
                    jsonString = "{\"" + name + "\":" + jsonString + "}";
                }
                return(jsonString);
            }
        }
Esempio n. 9
0
 void AddLayers(System.Collections.IList layers)
 {
     if (layers == null)
     {
         return;
     }
     foreach (Layer layer in layers)
     {
         if (string.IsNullOrEmpty(layer.Id))
         {
             continue;
         }
         NSString id       = layer.Id.ToCustomId();
         var      oldLayer = MapView.Style.LayerWithIdentifier(id);
         if (oldLayer != null)
         {
             MapView.Style.RemoveLayer(oldLayer);
         }
         if (layer is StyleLayer sl)
         {
             var newLayer = GetStyleLayer(sl, id);
             if (newLayer != null)
             {
                 MapView.Style.AddLayer(newLayer);
             }
         }
     }
 }
Esempio n. 10
0
 private void AddContact()
 {
     System.Collections.IList list = this.lstStaff.SelectedItems;
     foreach (ListBoxItem lbi in list)
     {
         Staff staff = lbi.DataContext as Staff;
         if (staff != null)
         {
             bool exist = false;
             foreach (ListBoxItem i in (System.Collections.IEnumerable) this.lstMember.Items)
             {
                 Staff v = i.DataContext as Staff;
                 if (v != null && v.Uid == staff.Uid)
                 {
                     exist = true;
                     break;
                 }
             }
             if (!exist)
             {
                 ListBoxItem lb = new ListBoxItem();
                 lb.Content     = staff.Name;
                 lb.DataContext = staff;
                 this.lstMember.Items.Add(lb);
             }
         }
     }
 }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <Song.Entities.Course> cour = Business.Do <ICourse>().CourseAll(-1, -1, -1, true);

            Song.Entities.Course[] arr = cour.ToArray();


            object value = cour;

            //Type type = value.GetType();
            //Array array = (Array)value;
            //for (int i = 0; i < array.Length; i++)
            //{
            //    int ii = i;
            //    object o = array.GetValue(i);

            //    Song.Entities.Course c = (Song.Entities.Course)o;
            //}

            System.Collections.IList list = (System.Collections.IList)value;
            for (int i = 0; i < list.Count; i++)
            {
                object o = list[i];
                Song.Entities.Course c = (Song.Entities.Course)o;
            }
        }
Esempio n. 12
0
 public static void AddAll(System.Collections.IList list, System.Collections.IEnumerable added)
 {
     foreach (object o in added)
     {
         list.Add(o);
     }
 }
        private static BimModelMetadata gatherMetadata(Session paramSession, long?paramLong1, long?paramLong2)
        {
            SQLQuery sQLQuery = paramSession.createSQLQuery("SELECT NAME, GLOBALID, PROJECT_ID from BC_MODEL where ID = :id");

            sQLQuery.setLong("id", paramLong1.Value);
            System.Collections.IList list = sQLQuery.list();
            if (list.Count == 0)
            {
                return(null);
            }
            object[]         arrayOfObject    = (object[])list[0];
            string           str1             = (string)arrayOfObject[0];
            string           str2             = (string)arrayOfObject[1];
            Number           number           = (Number)arrayOfObject[2];
            BimModelMetadata bimModelMetadata = new BimModelMetadata();

            bimModelMetadata.GlobalId   = str2;
            bimModelMetadata.Id         = paramLong2;
            bimModelMetadata.Name       = str1;
            bimModelMetadata.OriginalId = paramLong1;
            if (number != null)
            {
                bimModelMetadata.Project = gatherProjectMetadata(paramSession, number.longValue());
            }
            return(bimModelMetadata);
        }
Esempio n. 14
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. 15
0
        public static int serialVersion(Session paramSession)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.Version == 2)
                {
                    if (paramSession.Open)
                    {
                        paramSession.flush();
                        paramSession.close();
                    }
                    return(2);
                }
            }
            if (paramSession.Open)
            {
                paramSession.flush();
                paramSession.close();
            }
            return(1);
        }
Esempio n. 16
0
        public static void decrementTrialDays(Session paramSession)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.Version == 2 && licenseRowItem.IsTrial)
                {
                    if (licenseRowItem.TrialDays < -1)
                    {
                        licenseRowItem.TrialDays = -1;
                    }
                    if (licenseRowItem.TrialDays != -1 && licenseRowItem.TrialDays != 0)
                    {
                        licenseRowItem.TrialDays = licenseRowItem.TrialDays - 10;
                        string str = xStream.toXML(licenseRowItem);
                        concLicenseTable.HashKey = str;
                        paramSession.update(concLicenseTable);
                    }
                }
            }
            if (paramSession.Open)
            {
                paramSession.flush();
                paramSession.close();
            }
        }
Esempio n. 17
0
        public static bool?unRegisterUserBySerial(Session paramSession, string paramString1, string paramString2, string paramString3)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            bool? @bool = Convert.ToBoolean(false);

            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();
            License license = new License();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.hasSameSerial(paramString3).Value&& licenseRowItem.CheckedIn)
                {
                    LicenseRowItem licenseRowItem1 = createRow("NULL", "NULL", paramString3, licenseRowItem, Convert.ToBoolean(false), "NULL");
                    string         str             = xStream.toXML(licenseRowItem1);
                    concLicenseTable.HashKey = str;
                    paramSession.update(concLicenseTable);
                    paramSession.flush();
                    @bool = Convert.ToBoolean(true);
                }
            }
            if (paramSession.Open)
            {
                paramSession.flush();
            }
            return(@bool);
        }
Esempio n. 18
0
            private void OnItemAdded(int newIndex, IList items)
            {
                InternalLogger.Info($"OnItemAdded( newIndex: {newIndex}, itemCount: {items.Count} )");
                using (var h = new Handler(Looper.MainLooper))
                {
                    h.Post(
                        () =>
                    {
                        if (_isDisposed)
                        {
                            return;
                        }

                        _dataSource.InsertRange(newIndex, items.Cast <object>());
                        if (items.Count == 1)
                        {
                            NotifyItemInserted(newIndex);
                        }
                        else
                        {
                            NotifyItemRangeInserted(newIndex, items.Count);
                        }
                    });
                }
            }
Esempio n. 19
0
            /// <seealso cref="Graph.getAllEdges(Object, Object)">
            /// </seealso>
            public override System.Collections.IList getAllEdges(System.Object sourceVertex, System.Object targetVertex)
            {
                System.Collections.IList edges = null;

                if (Enclosing_Instance.containsVertex(sourceVertex) && Enclosing_Instance.containsVertex(targetVertex))
                {
                    edges = new System.Collections.ArrayList();

                    DirectedEdgeContainer ec = getEdgeContainer(sourceVertex);

                    System.Collections.IEnumerator iter = ec.m_outgoing.GetEnumerator();

                    //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'"
                    while (iter.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 e = (Edge)iter.Current;

                        if (e.Target.Equals(targetVertex))
                        {
                            edges.Add(e);
                        }
                    }
                }

                return(edges);
            }
Esempio n. 20
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.util.List<nomitech.common.db.local.FunctionArgumentTable> getReferringVariablesForStatement(String paramString) throws java.io.IOException, org.boris.expr.ExprException
        public virtual IList <FunctionArgumentTable> getReferringVariablesForStatement(string paramString)
        {
            this.refArgsIns = new List <object>();
            ExprParser exprParser = new ExprParser();

            exprParser.ParserVisitor = this;
            exprParser.parse(new ExprLexer(paramString));
            System.Collections.IList list = this.refArgsIns;
            this.refArgsIns = null;
            List <object> arrayList1 = new List <object>();
            List <object> arrayList2 = new List <object>();

            foreach (FunctionArgumentTable functionArgumentTable in list)
            {
                arrayList1.Add(functionArgumentTable);
                if (functionArgumentTable.Type.Equals("datatype.calcvalue") && !arrayList2.Contains(functionArgumentTable.ValidationStatement))
                {
                    arrayList2.Add(functionArgumentTable.ValidationStatement);
                }
            }
            foreach (string str in arrayList2)
            {
                list = getReferringVariablesForStatement(str);
                foreach (FunctionArgumentTable functionArgumentTable in list)
                {
                    if (!arrayList1.Contains(functionArgumentTable))
                    {
                        arrayList1.Add(functionArgumentTable);
                    }
                }
            }
            return(list);
        }
Esempio n. 21
0
            /// <seealso cref="UndirectedGraph.degree(Object)">
            /// </seealso>
            public override int degreeOf(System.Object vertex)
            {
                if (Enclosing_Instance.m_allowingLoops)
                {
                    // then we must count, and add loops twice

                    int degree = 0;
                    System.Collections.IList edges = getEdgeContainer(vertex).m_vertexEdges;

                    //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 iter = edges.GetEnumerator(); iter.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 e = (Edge)iter.Current;

                        if (e.Source.Equals(e.Target))
                        {
                            degree += 2;
                        }
                        else
                        {
                            degree += 1;
                        }
                    }

                    return(degree);
                }
                else
                {
                    return(getEdgeContainer(vertex).edgeCount());
                }
            }
Esempio n. 22
0
 /// <summary>
 /// Replaces the elements of the specified list with the specified element.
 /// </summary>
 /// <param name="List">The list to be filled with the specified element.</param>
 /// <param name="Element">The element with which to fill the specified list.</param>
 public static void Fill(System.Collections.IList List, System.Object Element)
 {
     for (int i = 0; i < List.Count; i++)
     {
         List[i] = Element;
     }
 }
Esempio n. 23
0
        /// <summary>
        /// Sorts an IList collections
        /// </summary>
        /// <param name="list">The System.Collections.IList instance that will be sorted</param>
        /// <param name="Comparator">The Comparator criteria, null to use natural comparator.</param>
        public static void Sort(System.Collections.IList list, System.Collections.IComparer Comparator)
        {
            if (((System.Collections.ArrayList)list).IsReadOnly)
            {
                throw new System.NotSupportedException();
            }

            if ((Comparator == null) || (Comparator is System.Collections.Comparer))
            {
                try
                {
                    ((System.Collections.ArrayList)list).Sort();
                }
                catch (System.InvalidOperationException e)
                {
                    throw new System.InvalidCastException(e.Message);
                }
            }
            else
            {
                try
                {
                    ((System.Collections.ArrayList)list).Sort(Comparator);
                }
                catch (System.InvalidOperationException e)
                {
                    throw new System.InvalidCastException(e.Message);
                }
            }
        }
Esempio n. 24
0
        /// <seealso cref="org._3pq.jgrapht.Graph.addEdge(Object, Object)">
        /// </seealso>
        public override Edge addEdge(System.Object sourceVertex, System.Object targetVertex)
        {
            assertVertexExist(sourceVertex);
            assertVertexExist(targetVertex);

            if (!m_base.containsEdge(sourceVertex, targetVertex))
            {
                throw new System.ArgumentException(NO_SUCH_EDGE_IN_BASE);
            }

            System.Collections.IList edges = m_base.getAllEdges(sourceVertex, targetVertex);

            //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 i = edges.GetEnumerator(); i.MoveNext();)
            {
                Edge e = (Edge)i.Current;

                if (!containsEdge(e))
                {
                    m_edgeSet.Add(e);

                    return(e);
                }
            }

            return(null);
        }
Esempio n. 25
0
 /// <summary>
 /// Copies the IList to other IList.
 /// </summary>
 /// <param name="SourceList">IList source.</param>
 /// <param name="TargetList">IList target.</param>
 public static void Copy(System.Collections.IList SourceList, System.Collections.IList TargetList)
 {
     for (int i = 0; i < SourceList.Count; i++)
     {
         TargetList[i] = SourceList[i];
     }
 }
Esempio n. 26
0
        public override System.Collections.IList[] ToList(params Type[] types)
        {
            System.Collections.IList[] results = new System.Collections.IList[types.Length];

            if (types.Length > 0)
            {
                this.ExecuteReader(new SQLReaderHandler((ISQLDbReader reader) =>
                {
                    for (int idx = 0; idx < types.Length; idx++)
                    {
                        Type type = types[idx];
                        if (reader.HasRows)
                        {
                            results[idx] = ToList(reader, type);
                        }

                        if (reader.NextResult() == false)
                        {
                            break;
                        }
                    }

                    return(true);
                }));
            }

            return(results);
        }
Esempio n. 27
0
        /// <seealso cref="org._3pq.jgrapht.Graph.getAllEdges(Object, Object)">
        /// </seealso>
        public override System.Collections.IList getAllEdges(System.Object sourceVertex, System.Object targetVertex)
        {
            System.Collections.IList edges = null;

            if (containsVertex(sourceVertex) && containsVertex(targetVertex))
            {
                edges = new System.Collections.ArrayList();

                System.Collections.IList baseEdges = m_base.getAllEdges(sourceVertex, targetVertex);

                //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 i = baseEdges.GetEnumerator(); i.MoveNext();)
                {
                    Edge e = (Edge)i.Current;

                    if (m_edgeSet.Contains(e))
                    {
                        // add if subgraph also contains it
                        edges.Add(e);
                    }
                }
            }

            return(edges);
        }
Esempio n. 28
0
            /// <seealso cref="Graph.edgesOf(Object)">
            /// </seealso>
            public override System.Collections.IList edgesOf(System.Object vertex)
            {
                System.Collections.ArrayList inAndOut = new System.Collections.ArrayList(getEdgeContainer(vertex).m_incoming);
                inAndOut.AddRange(getEdgeContainer(vertex).m_outgoing);

                // we have two copies for each self-loop - remove one of them.
                if (Enclosing_Instance.m_allowingLoops)
                {
                    System.Collections.IList loops = getAllEdges(vertex, vertex);

                    for (int i = 0; i < inAndOut.Count;)
                    {
                        System.Object e = inAndOut[i];

                        if (loops.Contains(e))
                        {
                            inAndOut.RemoveAt(i);
                            loops.Remove(e);                             // so we remove it only once
                        }
                        else
                        {
                            i++;
                        }
                    }
                }

                return(inAndOut);
            }
Esempio n. 29
0
 private void btnAddAll_Click(object sender, RoutedEventArgs e)
 {
     System.Collections.IList list = this.lstStaff.Items;
     foreach (ListBoxItem lbi in list)
     {
         Staff vo    = lbi.DataContext as Staff;
         bool  exist = false;
         foreach (ListBoxItem i in (System.Collections.IEnumerable) this.lstMember.Items)
         {
             Staff v = i.DataContext as Staff;
             if (v.Uid == vo.Uid)
             {
                 exist = true;
                 break;
             }
         }
         if (!exist)
         {
             ListBoxItem lb = new ListBoxItem();
             lb.Content     = vo.Name;
             lb.DataContext = vo;
             this.lstMember.Items.Add(lb);
         }
     }
 }
Esempio n. 30
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. 31
0
 private void InitBlock()
 {
     alreadyReceived = new List<Object>();
 }
        /// <summary>
        /// Imports the channels.
        /// </summary>
        /// <param name="delay">The delay in ms between each record.</param>
        /// <returns></returns>
        public int ImportChannels(int delay)
        {
            ClearCache();

             ImportStats stats = new ImportStats();

             if (_lineupHasChanged && _remapChannelsOnLineupChange)
            VerifyChannelMapping(delay);

             // Refresh the channel cache
             _mpChannelCache = (IList)Channel.ListAll();

             foreach (SchedulesDirect.SoapEntities.TVLineup lineup in _results.Data.Lineups.List)
             {
            Log.WriteFile("Processing lineup {0} [id={1} type={2} postcode={3}]", lineup.Name, lineup.ID, lineup.Type, lineup.PostalCode);
            foreach (SchedulesDirect.SoapEntities.TVStationMap tvStationMap in lineup.StationMap)
            {
               if (ShowProgress != null)
                  ShowProgress(this, stats);

               SchedulesDirect.SoapEntities.TVStation tvStation = _results.Data.Stations.StationById(tvStationMap.StationId);
               if (tvStation == null)
               {
                  Log.WriteFile("Unable to find stationId #{0} specified in lineup", tvStationMap.StationId);
                  continue;
               }

               if (tvStationMap.ChannelMajor < 0)
               {
                  Log.WriteFile("TVStationMap ChannelMajor Not Valid. StationID: {3} ChannelMajor: {0} ChannelMinor: {1} SchedulesDirectChannel: {2}", tvStationMap.ChannelMajor, tvStationMap.ChannelMinor, tvStationMap.SchedulesDirectChannel, tvStationMap.StationId);
                  continue;
               }

               Channel mpChannel = FindTVChannel(tvStation, tvStationMap, lineup.IsLocalBroadcast());
               // Update the channel and map it
               if (mpChannel != null)
               {
                  mpChannel.GrabEpg = false;
                  mpChannel.LastGrabTime = DateTime.Now;
                  mpChannel.ExternalId = BuildXmlTvId(lineup.IsLocalBroadcast(), tvStation, tvStationMap);  //tvStation.ID + XMLTVID;
                  if (_renameChannels)
                  {
                     string oldName = mpChannel.DisplayName;
                     mpChannel.DisplayName = BuildChannelName(tvStation, tvStationMap);
                     mpChannel.DisplayName = BuildChannelName(tvStation, tvStationMap);
                     RenameLogo(oldName, mpChannel.DisplayName);
                  }
                  stats._iChannels++;

                  mpChannel.Persist();

                  Log.WriteFile("Updated channel {1} [id={0} xmlid={2}]", mpChannel.IdChannel, mpChannel.DisplayName, mpChannel.ExternalId);
               }
               else if ((_createChannels == true && lineup.IsAnalogue() == false)
                  || (_createChannels == true && _createAnalogChannels == true && lineup.IsAnalogue() == true))
               {
                  // Create the channel
                  string cname = BuildChannelName(tvStation, tvStationMap);
                  string xId   = BuildXmlTvId(lineup.IsLocalBroadcast(), tvStation, tvStationMap);

                  mpChannel = new Channel(false, true, 0, Schedule.MinSchedule, false, Schedule.MinSchedule, 10000, true, xId, cname);
                  mpChannel.Persist();

                  TvLibrary.Implementations.AnalogChannel tuningDetail = new TvLibrary.Implementations.AnalogChannel();

                  tuningDetail.IsRadio = false;
                  tuningDetail.IsTv = true;
                  tuningDetail.Name = cname;
                  tuningDetail.Frequency = 0;
                  tuningDetail.ChannelNumber = tvStationMap.ChannelMajor;

                  //(int)PluginSettings.ExternalInput;
                  //tuningDetail.VideoSource = PluginSettings.ExternalInput;
                  tuningDetail.VideoSource = _ExternalInput; // PluginSettings.ExternalInput;

                  // Too much overhead using settings directly for country
                  if (_ExternalInputCountry != null)
                     tuningDetail.Country = _ExternalInputCountry; // PluginSettings.ExternalInputCountry;

                  if (lineup.IsLocalBroadcast())
                     tuningDetail.TunerSource = DirectShowLib.TunerInputType.Antenna;
                  else
                     tuningDetail.TunerSource = DirectShowLib.TunerInputType.Cable;

                  //mpChannel.XMLId                  = tvStation.ID + XMLTVID;
                  //mpChannel.Name                   = BuildChannelName(tvStation, tvStationMap);
                  //mpChannel.AutoGrabEpg            = false;
                  //mpChannel.LastDateTimeEpgGrabbed = DateTime.Now;
                  //mpChannel.External               = true; // This may change with cablecard support one day
                  //mpChannel.ExternalTunerChannel   = tvStationMap.ChannelMajor.ToString();
                  //mpChannel.Frequency              = 0;
                  //mpChannel.Number                 = (int)PluginSettings.ExternalInput;

                  tvLayer.AddTuningDetails(mpChannel, tuningDetail);

                  Log.WriteFile("Added channel {1} [id={0} xmlid={2}]", mpChannel.IdChannel, mpChannel.DisplayName, mpChannel.ExternalId);
                  stats._iChannels++;
               }
               else
               {
                  Log.WriteFile("Could not find a match for {0}/{1}", tvStation.CallSign, tvStationMap.Channel);
               }
               System.Threading.Thread.Sleep(delay);
            }
             }

             if (_lineupHasChanged && _remapChannelsOnLineupChange)
             {
            if (_mpUnMappedChannelCache != null)
            {
               foreach (Channel ch in _mpUnMappedChannelCache)
               {
                  ch.ExternalId = String.Empty;
                  ch.Persist();
               }
            }
             }

             if (_sortChannels)
            SortTVChannels();

             return stats._iChannels;
        }
Esempio n. 33
0
			internal DirectedEdgeContainer(EdgeListFactory edgeListFactory, System.Object vertex)
			{
				m_incoming = edgeListFactory.createEdgeList(vertex);
				m_outgoing = edgeListFactory.createEdgeList(vertex);
			}
Esempio n. 34
0
 public P5NetArray(System.Collections.IList _array, System.Type _type)
 {
     array = _array;
     type = _type;
 }
Esempio n. 35
0
 IList _cp;      // incoming list of context properties
 internal RemotePropertyHolderAttribute(IList cp)
 {
     _cp = cp;
     BCLDebug.Assert(cp != null && cp.Count > 0,"Bad _cp?");
 }
Esempio n. 36
0
    /// <summary>
    /// Return a map from token index to operation.
    /// </summary>
    /// <remarks>We need to combine operations and report invalid operations (like
    /// overlapping replaces that are not completed nested).  Inserts to
    /// same index need to be combined etc...   Here are the cases:
    ///
    /// I.i.u I.j.v								leave alone, nonoverlapping
    /// I.i.u I.i.v								combine: Iivu
    ///
    /// R.i-j.u R.x-y.v	| i-j in x-y			delete first R
    /// R.i-j.u R.i-j.v							delete first R
    /// R.i-j.u R.x-y.v	| x-y in i-j			ERROR
    /// R.i-j.u R.x-y.v	| boundaries overlap	ERROR
    ///
    /// I.i.u R.x-y.v | i in x-y				delete I
    /// I.i.u R.x-y.v | i not in x-y			leave alone, nonoverlapping
    /// R.x-y.v I.i.u | i in x-y				ERROR
    /// R.x-y.v I.x.u 							R.x-y.uv (combine, delete I)
    /// R.x-y.v I.i.u | i not in x-y			leave alone, nonoverlapping
    ///
    /// I.i.u = insert u before op @ index i
    /// R.x-y.u = replace x-y indexed tokens with u
    ///
    /// First we need to examine replaces.  For any replace op:
    ///
    ///		1. wipe out any insertions before op within that range.
    ///		2. Drop any replace op before that is contained completely within
    ///        that range.
    ///		3. Throw exception upon boundary overlap with any previous replace.
    ///
    /// Then we can deal with inserts:
    ///
    ///		1. for any inserts to same index, combine even if not adjacent.
    ///		2. for any prior replace with same left boundary, combine this
    ///        insert with replace and delete this replace.
    ///		3. throw exception if index in same range as previous replace
    ///
    /// Don't actually delete; make op null in list. Easier to walk list.
    /// Later we can throw as we add to index -> op map.
    ///
    /// Note that I.2 R.2-2 will wipe out I.2 even though, technically, the
    /// inserted stuff would be before the replace range.  But, if you
    /// add tokens in front of a method body '{' and then delete the method
    /// body, I think the stuff before the '{' you added should disappear too.
    /// </remarks>
    protected IDictionary ReduceToSingleOperationPerIndex(IList rewrites)
        {

        // WALK REPLACES
        for (int i = 0; i < rewrites.Count; i++)
            {
            RewriteOperation op = (RewriteOperation)rewrites[i];
            if (op == null) continue;
            if (!(op is ReplaceOp)) continue;
            ReplaceOp rop = (ReplaceOp)rewrites[i];
            // Wipe prior inserts within range
            IList inserts = GetKindOfOps(rewrites, typeof(InsertBeforeOp), i);
            for (int j = 0; j < inserts.Count; j++)
                {
                InsertBeforeOp iop = (InsertBeforeOp)inserts[j];
                if (iop.index >= rop.index && iop.index <= rop.lastIndex)
                    {
                    // delete insert as it's a no-op.
                    rewrites[iop.instructionIndex] = null;
                    }
                }
            // Drop any prior replaces contained within
            IList prevReplaces = GetKindOfOps(rewrites, typeof(ReplaceOp), i);
            for (int j = 0; j < prevReplaces.Count; j++)
                {
                ReplaceOp prevRop = (ReplaceOp)prevReplaces[j];
                if (prevRop.index >= rop.index && prevRop.lastIndex <= rop.lastIndex)
                    {
                    // delete replace as it's a no-op.
                    rewrites[prevRop.instructionIndex] = null;
                    continue;
                    }
                // throw exception unless disjoint or identical
                bool disjoint =
                    prevRop.lastIndex < rop.index || prevRop.index > rop.lastIndex;
                bool same =
                    prevRop.index == rop.index && prevRop.lastIndex == rop.lastIndex;
                if (!disjoint && !same)
                    {
                    throw new ArgumentOutOfRangeException("replace op boundaries of " + rop +
                                                       " overlap with previous " + prevRop);
                    }
                }
            }

        // WALK INSERTS
        for (int i = 0; i < rewrites.Count; i++)
            {
            RewriteOperation op = (RewriteOperation)rewrites[i];
            if (op == null) continue;
            if (!(op is InsertBeforeOp)) continue;
            InsertBeforeOp iop = (InsertBeforeOp)rewrites[i];
            // combine current insert with prior if any at same index
            IList prevInserts = GetKindOfOps(rewrites, typeof(InsertBeforeOp), i);
            for (int j = 0; j < prevInserts.Count; j++)
                {
                InsertBeforeOp prevIop = (InsertBeforeOp)prevInserts[j];
                if (prevIop.index == iop.index)
                    { // combine objects
                    // convert to strings...we're in process of toString'ing
                    // whole token buffer so no lazy eval issue with any templates
                    iop.text = CatOpText(iop.text, prevIop.text);
                    // delete redundant prior insert
                    rewrites[prevIop.instructionIndex] = null;
                    }
                }
            // look for replaces where iop.index is in range; error
            IList prevReplaces = GetKindOfOps(rewrites, typeof(ReplaceOp), i);
            for (int j = 0; j < prevReplaces.Count; j++)
                {
                ReplaceOp rop = (ReplaceOp)prevReplaces[j];
                if (iop.index == rop.index)
                    {
                    rop.text = CatOpText(iop.text, rop.text);
                    rewrites[i] = null;  // delete current insert
                    continue;
                    }
                if (iop.index >= rop.index && iop.index <= rop.lastIndex)
                    {
                    throw new ArgumentOutOfRangeException("insert op " + iop +
                                                       " within boundaries of previous " + rop);
                    }
                }
            }
        // System.out.println("rewrites after="+rewrites);
        IDictionary m = new Hashtable();
        for (int i = 0; i < rewrites.Count; i++)
            {
            RewriteOperation op = (RewriteOperation)rewrites[i];
            if (op == null) continue; // ignore deleted ops
            if (m[op.index] != null)
                {
                throw new Exception("should only be one op per index");
                }
            m[op.index] = op;
            }
        //System.out.println("index to op: "+m);
        return m;
        }
Esempio n. 37
0
 internal Parser(HParser parser)
 {
     wrapped = parser;
       pins = new System.Collections.ArrayList();
 }
Esempio n. 38
0
 public P5NetArrayItemBody(System.Collections.IList _array,
                           System.Type _type, int _index)
 {
     array = _array;
     type = _type;
     index = _index;
 }
Esempio n. 39
0
		private void  ResetMergeExceptions()
		{
			lock (this)
			{
				mergeExceptions = new System.Collections.ArrayList();
				mergeGen++;
			}
		}
Esempio n. 40
0
 internal ListCustomPropertyProviderProxy(System.Collections.IList target)
 {
     m_target = target;
 }
Esempio n. 41
0
 protected IList GetKindOfOps(IList rewrites, Type kind)
     {
     return GetKindOfOps(rewrites, kind, rewrites.Count);
     }
Esempio n. 42
0
 public RewriteRuleNodeStream(ITreeAdaptor adaptor, string elementDescription, IList elements)            : base(adaptor, elementDescription, elements) { }
Esempio n. 43
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. 44
0
 /// <summary>
 /// Get all operations before an index of a particular kind
 /// </summary>
 protected IList GetKindOfOps(IList rewrites, Type kind, int before)
     {
     IList ops = new ArrayList();
     for (int i = 0; i < before && i < rewrites.Count; i++)
         {
         RewriteOperation op = (RewriteOperation)rewrites[i];
         if (op == null) continue; // ignore deleted
         if (op.GetType() == kind) ops.Add(op);
         }
     return ops;
     }
        /// <summary>
        /// Sorts the TV channels.
        /// </summary>
        protected void SortTVChannels()
        {
            // Get a fresh list of channels
             _mpChannelCache = (IList)Channel.ListAll();

             if (_mpChannelCache == null)
            return;

             if (_mpChannelCache.Count <= 0)
            return;

             List<ChannelInfo> listChannels = new List<ChannelInfo>();
             foreach (Channel mpChannel in _mpChannelCache)
             {
            ChannelInfo chi;
            ATSCChannel atscCh = new ATSCChannel();
            if (GetATSCChannel(mpChannel, ref atscCh))
            {
               chi = new ChannelInfo(mpChannel.IdChannel, atscCh.MajorChannel, atscCh.MinorChannel, mpChannel.DisplayName);
            }
            else
            {
              System.Collections.IList chDetailList = (System.Collections.IList)mpChannel.ReferringTuningDetail();
               if (chDetailList.Count <= 0)
                  continue;
               TuningDetail chDetail = (TuningDetail)chDetailList[0];

               chi = new ChannelInfo(mpChannel.IdChannel, chDetail.ChannelNumber, 0, mpChannel.DisplayName);
            }

            listChannels.Add(chi);
             }

             ChannelSorter sorter = new ChannelSorter(listChannels, new ChannelNumberComparer());

             for (int i = 0; i < listChannels.Count; i++)
             {
            ChannelInfo sChi = listChannels[i];
            foreach (Channel mpChannel in _mpChannelCache)
            {
               if (sChi.ID != mpChannel.IdChannel)
                  continue;

               if (mpChannel.SortOrder != i)
               {
                  mpChannel.SortOrder = i;
                  mpChannel.Persist();
               }
            }
             }
        }
Esempio n. 46
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. 47
0
			internal UndirectedEdgeContainer(EdgeListFactory edgeListFactory, System.Object vertex)
			{
				m_vertexEdges = edgeListFactory.createEdgeList(vertex);
			}
		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. 49
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:InTheHand.Net.Bluetooth.ServiceElement"/> class.
 /// </summary>
 public ServiceElement(ElementType type, IList_ServiceElement childElements)
     : this(type, (object)childElements)
 { }
        /// <summary>
        /// Provides a cached wrapper for getting the EPG mapping for a SchedulesDirect.SoapEntities.TVSchedule.Station
        /// </summary>
        /// <param name="stationString">The SchedulesDirect.SoapEntities.TVSchedule.Station</param>
        /// <returns>List of idChannels for the Station, use GetChannelEPGMapping to get the Mapping</returns>
        protected List<Channel> GetStationChannels(string stationString)
        {
            if (_mpChannelCache == null || _mpChannelCache.Count <= 0)
               _mpChannelCache = (IList)Channel.ListAll();

             List<Channel> stList = new List<Channel>();
             foreach (Channel ch in _mpChannelCache)
             {
            if (!String.IsNullOrEmpty(ch.ExternalId))
            {
               if (ch.ExternalId.ToLower().StartsWith(stationString.ToLower().Trim() + "."))
                  stList.Add(ch);
            }
             }

             return stList;
        }
		/*
		public List hopcroftTarjanKnuthFindBiconnectedSets() {
		Map rank;
		Map parent;
		Map untagged;
		Map link;
		Stack activeStack;
		Map min;
		
		int nn;
		
		
		
		
		
		return biconnectedSets;
		}
		*/
		
		
		private void  init()
		{
			biconnectedSets_Renamed_Field = null;
		}