private void resimleriKaristir() { tokenstate.Clear(); // hamle sifirlanir - baslangic hamle = 0; label2.Text = hamle.ToString(); // hamle siniflanir - bitis this.panel1.Controls.Clear(); // paneldeki tüm elemanlar silinir. int left = 0; int top = 0; Random rnd = new Random(); ArrayList gen = new ArrayList(zorluk * zorluk); for (int i = 0; i < zorluk * zorluk; i++) { int yeniResimIndis = rnd.Next(0, zorluk * zorluk); while (gen.Contains(yeniResimIndis)) { yeniResimIndis = rnd.Next(0, zorluk * zorluk); } PictureBox pic = (PictureBox)pboxlar[yeniResimIndis]; pic.Location = new Point(left, top); this.panel1.Controls.Add(pic); tokenstate.Add(pic.Tag, i); gen.Add(yeniResimIndis); left += en / zorluk; if ((i + 1) % zorluk == 0) { left = 0; top += boy / zorluk; } } }
private static string MaxSubStringWithUniqueChars(string str) { char[] cArr = str.ToCharArray(); Hashtable h = new Hashtable(); h.Clear(); int n = cArr.Length; int begin = 0; int j = 0; string maxSub = ""; for (int i = 0; i < n; ++i) { if (!h.Contains(cArr[i])) { h.Add(cArr[i], true); j++; } else { int newSublen = j - begin; if (maxSub.Length < newSublen) { maxSub = str.Substring(begin, j); } begin = i; j = begin + 1; h.Clear(); } } return maxSub; }
public void TS_Clear() { C_MAIN_CANVAS.Children.Clear(); m_FunctionNodeModels.Clear(); m_FunctionLineModels.Clear(); m_FunctionNodeViews.Clear(); m_FunctionLineViews.Clear(); m_SelectedFunctionNodeModels.Clear(); m_FromSlot = null; m_ToSlot = null; }
public void TestClearBasic() { StringBuilder sblMsg = new StringBuilder(99); Hashtable ht1 = null; string s1 = null; string s2 = null; int i = 0; ht1 = new Hashtable(); //default constructor ht1.Clear(); Assert.Equal(0, ht1.Count); // add 100 key-val pairs ht1 = new Hashtable(); for (i = 0; i < 100; i++) { sblMsg = new StringBuilder(99); sblMsg.Append("key_"); sblMsg.Append(i); s1 = sblMsg.ToString(); sblMsg = new StringBuilder(99); sblMsg.Append("val_"); sblMsg.Append(i); s2 = sblMsg.ToString(); ht1.Add(s1, s2); } Assert.Equal(100, ht1.Count); ht1.Clear(); Assert.Equal(0, ht1.Count); //[]we will make a token call for some important methods to make sure that this is indeed clear s1 = "key_0"; Assert.False(ht1.ContainsKey(s1)); s1 = "val_0"; Assert.False(ht1.ContainsValue(s1)); //[]repeated clears of the HT. Nothing should happen for (i = 0; i < 100; i++) { ht1.Clear(); Assert.Equal(0, ht1.Count); } }
public void start_method(NClass.Core.Method method) { Indent(); stream.WriteLine(method.GetDeclarationLine()); Indent(); stream.WriteLine("{"); indent_level += 3; variables.Clear(); arrays.Clear(); arrays_2d.Clear(); strings.Clear(); current_method = method; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { acceptGuid = Request.Params["AcceptGuid"]; string adPGuid, clientPGuid, adClass = string.Empty; if (!string.IsNullOrEmpty(acceptGuid)) { Hashtable hs = new Hashtable(); hs.Add("AcceptGuid", acceptGuid); HD.Model.AcceptForm accept = HD.Model.AcceptForm.Instance.GetModelById(hs); accept.SetWebControls(this.Page); PostTime.Text = Convert.ToDateTime(accept.PostTime).ToString("yyyy-MM-dd"); adPGuid = accept.ADGuid; hs.Clear(); hs.Add("ADPGuid", adPGuid); HD.Model.AD ad = HD.Model.AD.Instance.GetModelById(hs); ad.SetWebControls(this.Page); adClass = ad.ADArea; adAreaId = ad.ADArea; StartTime.Text = Convert.ToDateTime(ad.StartTime).ToString("yyyy-MM-dd"); EndTime.Text = Convert.ToDateTime(ad.EndTime).ToString("yyyy-MM-dd"); if (!string.IsNullOrEmpty(adAreaId)) { ChooseCount = (adAreaId.Split(',').Length - 2).ToString(); } clientPGuid = accept.ClientGuid; hs.Clear(); hs.Add("ClientPGuid", clientPGuid); HD.Model.Client client = HD.Model.Client.Instance.GetModelById(hs); client.SetWebControls(this.Page); DataTable dt2 = HD.Framework.DataAccess.DataFactory.GetInstance().ExecuteTable("select wzrb_Class.ID, wzrb_Class.ClassName, (select COUNT(*) from wzrb_Terminal where ClassID=wzrb_Class.ID and Status=1) as rcount from wzrb_Class"); rptClass.DataSource = dt2; rptClass.DataBind(); DataTable dttype = HD.Framework.DataAccess.DataFactory.GetInstance().ExecuteTable("select * from wzrb_Publish where ADGuid='" + ad.ADPGuid + "'"); publishType = "<table id=\"CheckBoxList2\">"; for (int k = 0; k < dttype.Rows.Count; k++) { publishType += "<tr><td>" + GetPublishName(dttype.Rows[k]["PublishType"].ToString()); publishType += " -- 数量:" + dttype.Rows[k]["PublishQuantity"]; publishType += "</td></tr>"; } publishType += "</table>"; } } }
public void Dispose() { _stamper.close(); _reader.close(); _hTable.Clear(); _reader = null; }
/// <summary> /// "放入购物车"按钮单击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ButtonAdd2Cart_Click(object sender, System.EventArgs e) { if (Session["user_id"] == null) Page.Response.Redirect("Login.aspx?in=1"); Cart cart = new Cart(); Hashtable ht = new Hashtable(); ArrayList selectedBooks = this.GetSelected(); //如果用户没有选择,就单击该按钮,则给出警告 if (selectedBooks.Count == 0) { Response.Write("<Script Language=JavaScript>alert('请选择图书!');</Script>"); return; } //循环将选择的图书加入到购物篮中 foreach (int bookId in selectedBooks) { ht.Clear(); ht.Add("UserId", Session["user_id"].ToString()); ht.Add("BookId", bookId); ht.Add("Amount", TextBoxAmount.Text.Trim()); cart.Add(ht); } Response.Redirect("CartView.aspx"); }
public bool login(string username, string password, string catpcha) { HttpRequest request = HttpRequest.getInstance(); string result = ""; string url = ""; Hashtable param = new Hashtable(); url = "http://192.168.0.12:8080/ibts/j_spring_security_check"; param.Clear(); param.Add("j_organization_code", "10000201"); param.Add("j_username", username); param.Add("j_password", password); param.Add("j_verifycode", catpcha); result = request.doPost(url, param); //url = "http://192.168.0.12:8080/ibts/user_authSuccess.action"; //param.Clear(); //result = request.doPost(url, param); //url = "http://192.168.0.12:8080/ibts/main.action"; //param.Clear(); //result = request.doPost(url, param); return true; }
//Main_7_9_5 public static void Main_7_9_5() { Hashtable ht = new Hashtable(); //��Ӽ���Ԫ�� ht.Add("Name", "С��"); ht.Add("Age", 27); ht.Add("Degree", "˶ʿ"); //�Լ�ֵ���Ҽ��� Console.WriteLine("{0}��������{1}", ht["Name"], ht["Age"]); //���ϱ��� foreach (DictionaryEntry de in ht) { Console.WriteLine("{0}--{1}", de.Key.ToString(), de.Value.ToString()); } //ɾ������Ԫ�� ht.Remove("Age"); //�������� ArrayList als = new ArrayList(ht.Keys); als.Sort(); foreach (string key in als) { Console.WriteLine("{0}--{1}", key, ht[key].ToString()); } //������� ht.Clear(); }
/// <summary> /// 輸入變數兜成HashTable /// </summary> /// <param name="ParameterList">變數集</param> /// <returns>回傳HashTable</returns> private Hashtable GetInputValues(ArrayList ParameterList) { #region Hashtable htTemp = new Hashtable(); htTemp.Clear(); htTemp.Add("ChanFrom", ParameterList[0].ToString().Trim() == "" ? null : ParameterList[0].ToString().Trim()); htTemp.Add("ChanTo", ParameterList[1].ToString().Trim() == "" ? null : ParameterList[1].ToString().Trim()); htTemp.Add("DateFrom", ParameterList[2].ToString().Trim() == "" ? null : ParameterList[2].ToString().Trim()); htTemp.Add("DateTo", ParameterList[3].ToString().Trim() == "" ? null : ParameterList[3].ToString().Trim()); htTemp.Add("RankCode", ParameterList[4].ToString().Trim() == "" ? null : ParameterList[4].ToString().Trim()); htTemp.Add("UserID", ParameterList[5].ToString()); htTemp.Add("ProcNo", ParameterList[6].ToString()); Int32 iTopRownum; Int32.TryParse(ParameterList[7].ToString(), out iTopRownum); htTemp.Add("TopRownum", iTopRownum); htTemp.Add("StoreFrom", ParameterList[8].ToString().Trim() == "" ? null : ParameterList[8].ToString().Trim()); htTemp.Add("StoreTo", ParameterList[9].ToString().Trim() == "" ? null : ParameterList[9].ToString().Trim()); htTemp.Add("RootNo", ParameterList[10].ToString().Trim() == "" ? null : ParameterList[10].ToString().Trim()); htTemp.Add("PMAFrom", ParameterList[11].ToString().Trim() == "" ? null : ParameterList[11].ToString().Trim()); htTemp.Add("PMATo", ParameterList[12].ToString().Trim() == "" ? null : ParameterList[12].ToString().Trim()); htTemp.Add("PatternFrom", ParameterList[13].ToString().Trim() == "" ? null : ParameterList[13].ToString().Trim()); htTemp.Add("PatternTo", ParameterList[14].ToString().Trim() == "" ? null : ParameterList[14].ToString().Trim()); return htTemp; #endregion }
public void Start_Method(string name) { if (name != "Main") { Indent(); stream.Write(" void " + name); if (Procedures[name].arg_names != null && Procedures[name].arg_names.Length > 0) { stream.WriteLine(" ("); } indent_level += 3; } else { Indent(); stream.WriteLine("int main()"); Indent(); stream.WriteLine("{"); indent_level += 3; } variables.Clear(); arrays.Clear(); arrays_2d.Clear(); strings.Clear(); current_method = name; }
private void ARPopulateComboWithMapLayers(ComboBox Layers, System.Collections.Hashtable LayersIndex) { //In case cboLayers is already populated Layers.Items.Clear(); LayersIndex.Clear(); ARLayer arLayer; ARLayer arGroupLayer; // Get the focus map ARMap arMap = axArcReaderControl1.ARPageLayout.FocusARMap; // Loop through each layer in the focus map for (int i = 0; i <= arMap.ARLayerCount - 1; i++) { // Get the layer name and add to combo arLayer = arMap.get_ARLayer(i); if (arLayer.IsGroupLayer == true) { //If a GroupLayer add the ARChildLayers to the combo and HashTable for (int g = 0; g <= arLayer.ARLayerCount - 1; g++) { arGroupLayer = arMap.get_ARLayer(i).get_ChildARLayer(g); Layers.Items.Add(arGroupLayer.Name); LayersIndex.Add(Layers.Items.Count - 1, arGroupLayer); } } else if (arLayer.Searchable == true) { Layers.Items.Add(arLayer.Name); LayersIndex.Add(Layers.Items.Count - 1, arLayer); } } }
public void TestCtorDictionarySingle() { // No exception var hash = new Hashtable(new Hashtable(), 1f); // No exception hash = new Hashtable(new Hashtable(new Hashtable(new Hashtable(new Hashtable(new Hashtable()), 1f), 1f), 1f), 1f); // []test to see if elements really get copied from old dictionary to new hashtable Hashtable tempHash = new Hashtable(); // this for assumes that MinValue is a negative! for (long i = long.MinValue; i < long.MinValue + 100; i++) { tempHash.Add(i, i); } hash = new Hashtable(tempHash, 1f); // make sure that new hashtable has the elements in it that old hashtable had for (long i = long.MinValue; i < long.MinValue + 100; i++) { Assert.True(hash.ContainsKey(i)); Assert.True(hash.ContainsValue(i)); } //[]make sure that there are no connections with the old and the new hashtable tempHash.Clear(); for (long i = long.MinValue; i < long.MinValue + 100; i++) { Assert.True(hash.ContainsKey(i)); Assert.True(hash.ContainsValue(i)); } }
private void PopulateComboWithMapLayers(ComboBox Layers, bool bLayer, System.Collections.Hashtable LayersIndex) { Layers.Items.Clear(); LayersIndex.Clear(); ILayer aLayer; AxMapControl axMap = pMainFrm.getMapControl(); for (int i = 0; i <= axMap.LayerCount - 1; i++) { // Get the layer name and add to combo aLayer = axMap.get_Layer(i); if (aLayer.Valid == true) { if (bLayer == true) { if (aLayer is IFeatureLayer) { Layers.Items.Add(aLayer.Name); LayersIndex.Add(Layers.Items.Count - 1, aLayer); } } else { if (aLayer is IRasterLayer) { Layers.Items.Add(aLayer.Name); LayersIndex.Add(Layers.Items.Count - 1, aLayer); } } } } }
static void Main(string[] args) { Hashtable seen = new Hashtable(); int max = 0; int maxD = 0; for (int i = 1; i < 1000; i++) { seen.Clear(); int r = 1; int count = 0; int result = 0; bool found = false; while(!found) { if (seen.ContainsKey(r)) { found = true; result = count - (int)seen[r]; } else { seen.Add(r, count); r = r % i; if (r == 0) { found = true; } else { r = r * 10; } } count++; } if(max < result) { max = result; maxD = i; } } Console.WriteLine(maxD + " " + max); Console.ReadLine(); }
public Hashtable GpsCarFilterToHashTable(int int_0) { SqlParameter[] parameterArray = new SqlParameter[] { new SqlParameter("@workId", int_0) }; DataTable table = new SqlDataAccess().getDataBySP("WebGpsClient_GetCarFilter", parameterArray); Hashtable hashtable = new Hashtable(); if (hashtable.Count > 0) { hashtable.Clear(); } CarFilterInfo info = null; foreach (DataRow row in table.Rows) { if (row["simNum"] != DBNull.Value) { info = new CarFilterInfo { SimNum = Convert.ToString(row["simNum"]), CarInfoData = CarDataInfoBuffer.GetDataCarInfoBySimNum(info.SimNum) }; if (info.CarInfoData != null) { info.PosReadTime = info.CarInfoData.IsNewPosTime; info.PicReadTime = info.CarInfoData.IsNewPicTime; hashtable.Add(info.SimNum, info); } } } return hashtable; }
public Hashtable GetMissingDefinitions() { MissingDefinition definition; Hashtable hashtable = new Hashtable(); try { if (!this.TableExists("KindOfMissing")) { throw new Exception(); } DataTable table1 = this._data.Tables["KindOfMissing"]; foreach (DataRow row in this._data.Tables["KindOfMissing"].Rows) { int key = Convert.ToInt32((string)row["Key"]); string text = (string)row["Text"]; bool capturable = ((string)row["Capturable"]).ToUpper() != "NO"; definition = new MissingDefinition(key, text, capturable); key = definition.Key; if (!hashtable.ContainsKey(key)) { hashtable.Add(key, definition); } } return hashtable; } catch { hashtable.Clear(); definition = new MissingDefinition(0, "Missing", false); hashtable.Add(0, definition); definition = new MissingDefinition(1, "Available", true); hashtable.Add(1, definition); } return hashtable; }
public static object GetPostValue(string ReqUrl, Dictionary <string, string> Paras) { try { //webservice地址和方法名 string url = ReqUrl; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; SetWebRequest(ref request); System.Collections.Hashtable parameters = new System.Collections.Hashtable(); //--------参数的传递------------ if (Paras != null) { foreach (KeyValuePair <string, string> KeyValuePairins in Paras) { parameters.Add(KeyValuePairins.Key, KeyValuePairins.Value); } } // ------------------------------------------------------- Byte[] data = EncodePars(parameters); WriteRequestData(ref request, data); object retstr = ReadResponse((HttpWebResponse)request.GetResponse()); parameters.Clear(); parameters = null; return(retstr); } catch (Exception ex) { throw ex; } }
public void Start_Method(string name) { if (name == "Main") { // I'm not sure how to work globals into the output. This appears to be an abstract class that is // called by other methods in Martin's code. I'll proceed with all local variables for now . . . Indent(); stream.WriteLine("public static void main(String[] args)"); Indent(); stream.WriteLine("{"); } else { Indent(); // Without globals, we can't use static, or class methods; we can only use instance methods // Class methods can only act on global (static) variables MethodInformation mi = Procedures[name]; if (hasReturnValue(mi, name)) { stream.Write("public static ??" ); // finish writing method name with parameters if has return value // have to test for array return, cannot do here } else { stream.Write("public static void " + name+"(" ); } } variables.Clear(); arrays.Clear(); arrays_2d.Clear(); strings.Clear(); current_method = name; indent_level += 3; }
public static Task<Hashtable> Execute(string method, Hashtable parms,ref Int64 requestid ) { string strParams=""; IEnumerator enu = parms.Keys.GetEnumerator(); while (enu.MoveNext()) { string parm = enu.Current.ToString() + "=" + Convert.ToString(parms[enu.Current.ToString()]); strParams = strParams + parm + "&"; } strParams = strParams + "requestid=" + requestid.ToString()+"&"; var result = Task<Hashtable>.Factory.StartNew(() => { Hashtable ReturnData = new Hashtable(); try { Encoding encoding = Encoding.UTF8; string strurl = strBaseUrl + strExecutePage; string strJason = PostHttpResponse.GetStream(PostHttpResponse.CreatePostHttpResponseJson(strurl, "", "method=" + method + "&"+strParams + "clienttype=mobile", 300*1000, "", encoding, "", ref m_CookieContainer, true), encoding); ReturnData = (Hashtable)MiniUiAppCode.JSON.Decode(strJason); } catch (Exception ex) { ReturnData.Clear(); ReturnData.Add("error", "-1"); ReturnData.Add("message", "client error:" + ex.Message.ToString()); } return ReturnData; }); return result; }
public Hashtable GetSiteDetails() { Hashtable _SiteDetails = new Hashtable(); try { Logger.Debug("Refreshing Site details:GetSiteDetails"); ISingleResult<rsp_EventTransmitter_GetSiteDetailsResult> ResultSet = _ExchangeContext.rsp_EventTransmitter_GetSiteDetails(); foreach (rsp_EventTransmitter_GetSiteDetailsResult oInst in ResultSet) { _SiteDetails.Add("Area", oInst.sub_company_area_name); _SiteDetails.Add("Company", oInst.Company_name); _SiteDetails.Add("District", oInst.sub_company_District_Name); _SiteDetails.Add("Region", oInst.Sub_Company_Region_Name); _SiteDetails.Add("Sub_Company", oInst.sub_company_Name); } } catch (Exception Ex) { Logger.Error("DataAdapter", "GetSiteDetails()", Ex); _SiteDetails.Clear(); _SiteDetails.Add("Area", string.Empty); _SiteDetails.Add("Company", string.Empty); _SiteDetails.Add("District", string.Empty); _SiteDetails.Add("Region", string.Empty); _SiteDetails.Add("Sub_Company", string.Empty); } return _SiteDetails; }
public static Task<Hashtable> Login(string user, string upass) { var result = Task<Hashtable>.Factory.StartNew(() => { Hashtable loginReturnData = new Hashtable() ; try { Encoding encoding = Encoding.UTF8; string strurl = strBaseUrl + strLoginPage; string strJason = PostHttpResponse.GetStream(PostHttpResponse.CreatePostHttpResponseJson(strurl, "", "user="******"&upass="******"&clienttype=mobile", null, "", encoding, "", ref m_CookieContainer, true), encoding); loginReturnData = (Hashtable)MiniUiAppCode.JSON.Decode(strJason); } catch (Exception ex) { loginReturnData.Clear(); loginReturnData.Add("error", "-1"); loginReturnData.Add("message", "client error:"+ex.Message.ToString()); } return loginReturnData; }); return result; }
public void Initialize(Framework.Interfaces.ICore core) { _core = core; _availableWaypoints = new Hashtable(); try { _dbcon = new Utils.DBConComSqlite(Path.Combine(core.PluginDataPath,"gcvote.db3")); object o = _dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='votes'"); if (o == null || o.GetType() == typeof(DBNull)) { _dbcon.ExecuteNonQuery("create table 'votes' (Waypoint text, VoteMedian float, VoteAvg float, VoteCnt integer, VoteUser double)"); _dbcon.ExecuteNonQuery("create unique index idx_votess on votes (Waypoint)"); } DbDataReader dr = _dbcon.ExecuteReader("select Waypoint from votes"); while (dr.Read()) { _availableWaypoints.Add(dr[0], true); } } catch { _dbcon = null; _availableWaypoints.Clear(); } }
public void Reset() { xObjects.Clear(); EventList.Clear(); Time = 0; stop = false; }
public static void CountObjects_OnCommand(CommandEventArgs e) { using (StreamWriter op = new StreamWriter("objects.log")) { Hashtable table = new Hashtable(); foreach (Item item in World.Items.Values) { Type type = item.GetType(); object o = (object)table[type]; if (o == null) table[type] = 1; else table[type] = 1 + (int)o; } ArrayList items = new ArrayList(table); table.Clear(); foreach (Mobile m in World.Mobiles.Values) { Type type = m.GetType(); object o = (object)table[type]; if (o == null) table[type] = 1; else table[type] = 1 + (int)o; } ArrayList mobiles = new ArrayList(table); items.Sort(new CountSorter()); mobiles.Sort(new CountSorter()); op.WriteLine("# Object count table generated on {0}", DateTime.Now); op.WriteLine(); op.WriteLine(); op.WriteLine("# Items:"); foreach (DictionaryEntry de in items) op.WriteLine("{0}\t{1:F2}%\t{2}", de.Value, (100 * (int)de.Value) / (double)World.Items.Count, de.Key); op.WriteLine(); op.WriteLine(); op.WriteLine("#Mobiles:"); foreach (DictionaryEntry de in mobiles) op.WriteLine("{0}\t{1:F2}%\t{2}", de.Value, (100 * (int)de.Value) / (double)World.Mobiles.Count, de.Key); } e.Mobile.SendMessage("Object table has been generated. See the file : <runuo root>/objects.log"); }
public static void Run() { // ExStart:SaveVisioShapeInOtherFormats // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Shapes(); // Call a Diagram class constructor to load the VSDX diagram Diagram srcVisio = new Diagram(dataDir + "Drawing1.vsdx"); double shapeWidth = 0; double shapeHeight = 0; // Get Visio page Aspose.Diagram.Page srcPage = srcVisio.Pages.GetPage("Page-3"); // Remove background page srcPage.BackPage = null; // Get hash table of shapes, it holds id and name Hashtable remShapes = new Hashtable(); // Hashtable<Long, String> remShapes = new Hashtable<Long, String>(); foreach (Aspose.Diagram.Shape shape in srcPage.Shapes) // For the normal shape remShapes.Add(shape.ID, shape.Name); // Iterate through the hash table foreach (DictionaryEntry shapeEntry in remShapes) { long key = (long)shapeEntry.Key; string val = (string)shapeEntry.Value; Aspose.Diagram.Shape shape = srcPage.Shapes.GetShape(key); // Check of the shape name if (val.Equals("GroupShape1")) { // Move shape to the origin corner shapeWidth = shape.XForm.Width.Value; shapeHeight = shape.XForm.Height.Value; shape.MoveTo(shapeWidth * 0.5, shapeHeight * 0.5); // Trim page size srcPage.PageSheet.PageProps.PageWidth.Value = shapeWidth; srcPage.PageSheet.PageProps.PageHeight.Value = shapeHeight; } else { // Remove shape from the Visio page and hash table srcPage.Shapes.Remove(shape); } } remShapes.Clear(); // Specify saving options Aspose.Diagram.Saving.PdfSaveOptions opts = new Aspose.Diagram.Saving.PdfSaveOptions(); // Set page count to save opts.PageCount = 1; // Set starting index of the page opts.PageIndex = 1; // Save it srcVisio.Save(dataDir + "SaveVisioShapeInOtherFormats_out.pdf", opts); // ExEnd:SaveVisioShapeInOtherFormats }
public void TerDelete(Model.Terminal terminal, Model.Source source) { Hashtable ht = new Hashtable(); ht.Add("Guid", terminal.Guid); terminal.Delete(ht); ht.Clear(); ht.Add("TerGuid", terminal.Guid); source.Delete(ht); }
private static void FlushDictionary(Hashtable d) { foreach (var key in d.Keys) { var disposeItem = d[key] as IDisposable; if (disposeItem != null) disposeItem.Dispose(); } d.Clear(); }
public void ApplyDelete(Model.Application appli,Model.SCW scw, Model.BulkFreight bulk) { Hashtable ht = new Hashtable(); ht.Add("Guid", appli.Guid); appli.Delete(ht); ht.Clear(); ht.Add("AppGuid", appli.Guid); scw.Delete(ht); bulk.Delete(ht); }
/* general */ public static void CheckForUpdate(ref Hashtable data) { data.Clear(); if (ConfigManager.Instance.CommonConfiguration.PROFILES_UseProfiles) data = CheckForUpdate_profile(); else data.Add(0, CheckForUpdate_single()); //return data; }
/// <summary> /// 拷贝hash表内容,string类型 /// </summary> /// <param name="src"></param> /// <param name="dst"></param> public static void CopyHashTableString(Hashtable src, Hashtable dst) { dst.Clear(); foreach (var obj in src.Keys) { var nodename = (string) obj; var lst = (string) src[nodename]; dst.Add(nodename, lst); } }
public WWQK_MDB() { pmTableName = "WWQK_WF"; formatPmTableName = "WWQK"; doneTable = "WWQK_DONE" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm"); title = "外文期刊"; Rec = new Hashtable(); Rec.Clear(); }
public virtual void reset() { lock (msgs.SyncRoot) { msgs.Clear(); } // moved out of sync scope: Retransmitter.reset()/add()/remove() are sync'ed anyway // Bela Jan 15 2003 retransmitter.reset(); }
static public int Clear(IntPtr l) { try { System.Collections.Hashtable self = (System.Collections.Hashtable)checkSelf(l); self.Clear(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
/// <summary> /// 根据当前分类ID,往下找两级子分类 /// </summary> /// <param name="catalogId"></param> /// <returns></returns> public IList<S_Catalog> GetSubList(int catalogId) { Hashtable p = new Hashtable(); p.Add("Pid",catalogId); IList<S_Catalog> sublist = GetList(p, null, null, null); sublist.ToList().ForEach(c => { p.Clear(); p.Add("Pid",c.CatalogId); c.SubCatalog = GetList(p, null, null, null); }); return sublist; }
/// <summary> /// Ensure that Rtp is properly installed on each run, attempting to make ".NET File Copy Deployment" a reality. /// /// This mostly works, but two problems arise from "File Copy Deployment". First, there's a large delay upon first run while setup executes. /// Second, uninstall is never run if the files are just deleted so niggling things like registry entries, performance counters, event logs, /// etc. get left around. /// /// Because of this, we still deploy the application to the clients using MSIs which call custom actions that run the Installer classes on both /// setup and when Add/Remove Programs -> Remove is called. /// /// This Dll knows whether to self-install by checking a registry entry that is set upon installation. If you delete the files without calling /// uninstall, be sure to delete HKLM\SOFTWARE\Microsoft Research\RtpInstalled before reinstalling Rtp in another location. The clean way to /// uninstall without MSIs or Add/Remove Programs is to call "installutil /u MSR.LST.Net.Rtp.dll" before deleting the file or by having your /// app call Installer.Uninstall on the MSR.LST.Net.Rtp assembly programatically. See Installation.cs for an example of how to programmatically /// install/uninstall an assembly dependency. /// </summary> private static void Install() { if (!Installation.Installed) { // Install myself IDictionary state = new Hashtable(); state.Clear(); Installation inst = new Installation(); inst.Install(state); inst.Commit(state); } }
/// <summary> /// 拷贝hash表内容,List<string>类型 /// </summary> /// <param name="src"></param> /// <param name="dst"></param> public static void CopyHashTableStringList(Hashtable src, Hashtable dst) { dst.Clear(); foreach (var obj in src.Keys) { var nodename = (string) obj; var lst = (List<string>) src[nodename]; var newlst = new List<string>(lst.Capacity); newlst.AddRange(lst); dst.Add(nodename, newlst); } }
public static void ReLoad() { table.Clear(); #if WINCE lock (FileSystem.fileLockObj) { LoadXml(); } #else LoadXml(); #endif }
public static void echoResponse(HttpContext context, Hashtable inputData, Object outputData, Boolean ok) { context.Response.ClearContent(); string strOut = ""; Hashtable hResponse = new Hashtable(); if (ok) { hResponse.Add(DATA, outputData); } else { hResponse.Add(ERR, outputData); } Object oCallback = inputData[CALLBACK]; //adjust out string if (oCallback != null) { string sCallback = "" + oCallback; if ("window.name".Equals(sCallback)) { context.Response.ContentType = "text/html"; strOut = "<script type='text' id='json'>" + JsonConvert.ExportToString(hResponse) + "</script><script type='text/javascript'>window.name=document.getElementById('json').innerHTML;</script>"; } else if (sCallback.IndexOf(":") != -1){ context.Response.ContentType = "text/html"; strOut = "<script type='text' id='json'>" + JsonConvert.ExportToString(hResponse) + "</script><script type='text/javascript'>parent.postMessage(document.getElementById('json').innerHTML,'" + sCallback + "'.replace( /([^:]+://[^/]+).*/, '$1'));</script>"; } else { context.Response.ContentType = "text/plain"; strOut = sCallback + "(" + JsonConvert.ExportToString(hResponse) + ")"; } } else { context.Response.ContentType = "text/plain"; strOut = JsonConvert.ExportToString(hResponse); } if (inputData != null) inputData.Clear(); context.Response.Write(strOut); context.Response.End(); }
private void StopServer() { foreach (DictionaryEntry de in hosts) { string KeyName = de.Key.ToString(); ServiceHost sh = de.Value as ServiceHost; WriteTestLog("服务停止......" + KeyName); sh.Abort(); sh.Close(); WriteTestLog("服务停止......" + KeyName + " OK"); } hosts.Clear(); }
/// <summary> /// Ensure that ArchiveService is properly installed on each run, attempting to make ".NET File Copy Deployment" a reality. /// </summary> /// <remarks> /// This was stolen from MSR.LST.Net.Rtp. See Notes on bugs in this design in MSR.LST.Net.Rtp.RtpSession.Install /// </remarks> private static void Install() { // Get the installed state out of the registry -- if we're already installed, we don't have to reinstall if (Installation.Installed == false) { // Install myself IDictionary state = new Hashtable(); state.Clear(); Installation inst = new Installation(); inst.Install(state); inst.Commit(state); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string guid = Request.Params["Guid"]; if (!string.IsNullOrEmpty(guid)) { Hashtable hs = new Hashtable(); hs.Add("Guid", guid); HD.Model.Repair repair = HD.Model.Repair.Instance.GetModelById(hs); repair.SetWebControls(this.Page); RepairTime.Text = Convert.ToDateTime(repair.RepairTime).ToString("yyyy-MM-dd"); hs.Clear(); hs.Add("RepairGuid", guid); HD.Model.Reply reply = HD.Model.Reply.Instance.GetModelById(hs); reply.SetWebControls(this.Page); ReplyRepairTime.Text = Convert.ToDateTime(reply.ReplyRepairTime).ToString("yyyy-MM-dd"); Response.Write(repair.Status); if (repair.Status == 0) { RepairStatus.Text = "未受理"; } if (repair.Status == 1) { RepairStatus.Text = "已受理"; } if (repair.Status == 2) { RepairStatus.Text = "已解决"; } hs.Clear(); hs.Add("ID", repair.TerminalId); HD.Model.Terminal ternimal = HD.Model.Terminal.Instance.GetModelById(hs); ternimal.SetWebControls(this.Page); } } }
protected override void OnStop() { foreach (DictionaryEntry de in hosts) { string KeyName = de.Key.ToString(); ServiceHost sh = de.Value as ServiceHost; WriteTestLog("服务停止......" + KeyName); sh.Abort(); sh.Close(); WriteTestLog("服务停止......" + KeyName + " OK"); } hosts.Clear(); thread.Abort(); }
static int Clear(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); System.Collections.Hashtable obj = (System.Collections.Hashtable)ToLua.CheckObject(L, 1, typeof(System.Collections.Hashtable)); obj.Clear(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// This method is called when user changed the selection in the drop down /// </summary> /// <param name="sender">This will contains sender information</param> /// <param name="e">This will contain evnt argument information</param> protected void Hppfield_list_SelectedIndexChanged(object sender, EventArgs e) { if (hppfield_list.SelectedIndex != 0) { Hashtable hppFieldsHashtable = new Hashtable(); hppFieldsHashtable["hpp_id"] = hppfield_list.SelectedValue.ToString(); HppFields objHppFields = new HppFields(); DataTable dthppFields = objHppFields.GetHppFields(hppFieldsHashtable); foreach (DataRow hppFieldRow in dthppFields.Rows) { field_id.Text = hppFieldRow["hpp_id"].ToString(); filed_name.Text = hppFieldRow["hpp_field_name"].ToString(); filed_description.Text = hppFieldRow["hpp_field_desc"].ToString(); if (hppFieldRow["hppfield_mapped"].ToString() == "0") { filed_name.Enabled = true; filed_description.Enabled = true; save.Enabled = true; } else { filed_name.Enabled = false; filed_description.Enabled = false; save.Enabled = false; } } hppFieldsHashtable.Clear(); } else { // get identity value Hashtable hppFieldshashtable = new Hashtable(); hppFieldshashtable["identity_value"] = 1; HppFields objHppFields = new HppFields(); fieldID = objHppFields.GetHppFields(hppFieldshashtable).Rows[0][0].ToString(); field_id.Text = fieldID; filed_name.Text = string.Empty; filed_description.Text = string.Empty; filed_name.Enabled = true; filed_description.Enabled = true; save.Enabled = true; } lb_fieldname_error_invalid.Visible = false; lb_field_error.Visible = false; }
private void caricaTitolariRegistro() { //distruggo l'albero precedente. Titolario.Nodes.Clear(); string codClassifica; codClassifica = this.txt_RicTit.Text; if (codClassifica.Equals("")) { codClassifica = null; } //cosi' nuovo hash nella stessa locazione di mem. if (TheHash != null) { TheHash.Clear(); } else { TheHash = new Hashtable(); } indexH = 0; //Recupero elenco titolari associati al registro selezionato DocsPaWR.FascicolazioneClassificazione[] FascClass = FascicoliManager.fascicolazioneGetTitolario(this, codClassifica, true); for (int k = 0; k < FascClass.Length; k++) { //costruisco nodo root dell'albero Microsoft.Web.UI.WebControls.TreeNode RootAppo = new Microsoft.Web.UI.WebControls.TreeNode(); RootAppo.Target = "centrale"; RootAppo.Text = FascClass[k].codice + "-" + FascClass[k].descrizione; indexH = indexH + 1; TheHash.Add(indexH, FascClass[k]); RootAppo.ID = indexH.ToString(); RootAppo.NavigateUrl = "tabrisultatiRicfasc.aspx?idClass=" + indexH.ToString(); RootAppo.Target = "iFrame_dx"; //lo aggiungo all'albero Titolario.Nodes.Add(RootAppo); this.CreateTree(RootAppo, FascClass[k]); FascicoliManager.setTheHash(this, TheHash); } }
/// <summary> Properly shut down the generator, right now /// this is simply flushing and closing the file /// writers that we have been holding on to. /// </summary> public virtual void shutdown() { IEnumerator iterator = writers.Values.GetEnumerator(); while (iterator.MoveNext()) { StreamWriter writer = (StreamWriter)iterator.Current; try { writer.Flush(); writer.Close(); } catch (System.Exception) { /* do nothing */ } } // clear the file writers cache writers.Clear(); }
internal void Clear() { trapStartIndex = 0; rootObject = null; if (underlyingList != null) { underlyingList.Clear(); } if (stringKeys != null) { stringKeys.Clear(); } #if !CF && !PORTABLE if (objectKeys != null) { objectKeys.Clear(); } #endif }
private void Terminate() { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyLoad -= new AssemblyLoadEventHandler(OnAssemblyLoad); currentDomain.AssemblyResolve -= new ResolveEventHandler(OnAssemblyResolve); currentDomain.ProcessExit -= new EventHandler(OnDomainUnload); IDictionaryEnumerator i = mExtensionApps.GetEnumerator(); while (i.MoveNext()) { var app = i.Value as IExtensionApplication; if (null != app) { app.ShutDown(); } } mExtensionApps.Clear(); mAssemblies.Clear(); }
/// <summary> /// 清除集合内的所有列。 /// </summary> public void Clear() { ColumnsHashTable.Clear(); Items.Clear(); }
/// <summary> /// 清除所有数据 /// </summary> public void Clear() { ht.Clear(); }
public override void Clear() { lock (host.SyncRoot) { host.Clear(); } }
private void ReloadTransactionsByMonth() { var filteredBudgetListByMonth = GetBudgetByMonth(MonthTransactions); var filteredTransactionsByMonth = GetTransactionByMonth(MonthTransactions); //obtaining the total spend by month and category TotalAmountSpendByCategory.Clear(); //insert categories TotalAmountSpendByCategory.Add("Car", 0.00); TotalAmountSpendByCategory.Add("Entertainment", 0.00); TotalAmountSpendByCategory.Add("Food", 0.00); TotalAmountSpendByCategory.Add("Misc", 0.00); TotalAmountSpendByCategory.Add("Shopping", 0.00); TotalAmountSpendByCategory.Add("Rent", 0.00); TotalSpend = 0; TotalBudget = 0; var carGroup = new GroupedTransactionModel() { CategoryName = "CAR", CategoryInitial = "C" }; var entertainmentGroup = new GroupedTransactionModel() { CategoryName = "ENTERTAINMENT", CategoryInitial = "E" }; var foodGroup = new GroupedTransactionModel() { CategoryName = "FOOD", CategoryInitial = "F" }; var miscGroup = new GroupedTransactionModel() { CategoryName = "MISC", CategoryInitial = "M" }; var shoppingGroup = new GroupedTransactionModel() { CategoryName = "SHOPPING", CategoryInitial = "S" }; var rentGroup = new GroupedTransactionModel() { CategoryName = "RENT", CategoryInitial = "R" }; foreach (var c in filteredTransactionsByMonth.Where(t => t.Type == TransactionType.Car).ToList()) { carGroup.Add(new TransactionModel() { Name = c.Date.ToShortDateString() + " " + c.Name, Amount = String.Format("{0:C2}", c.Amount), FileName = c.FileName }); TotalAmountSpendByCategory["Car"] = (double)TotalAmountSpendByCategory["Car"] + c.Amount; } foreach (var e in filteredTransactionsByMonth.Where(t => t.Type == TransactionType.Entertainment).ToList()) { entertainmentGroup.Add(new TransactionModel() { Name = e.Date.ToShortDateString() + " " + e.Name, Amount = String.Format("{0:C2}", e.Amount), FileName = e.FileName }); TotalAmountSpendByCategory["Entertainment"] = (double)TotalAmountSpendByCategory["Entertainment"] + e.Amount; } foreach (var f in filteredTransactionsByMonth.Where(t => t.Type == TransactionType.Food).ToList()) { foodGroup.Add(new TransactionModel() { Name = f.Date.ToShortDateString() + " " + f.Name, Amount = String.Format("{0:C2}", f.Amount), FileName = f.FileName }); TotalAmountSpendByCategory["Food"] = (double)TotalAmountSpendByCategory["Food"] + f.Amount; } foreach (var m in filteredTransactionsByMonth.Where(t => t.Type == TransactionType.Misc).ToList()) { miscGroup.Add(new TransactionModel() { Name = m.Date.ToShortDateString() + " " + m.Name, Amount = String.Format("{0:C2}", m.Amount), FileName = m.FileName }); TotalAmountSpendByCategory["Misc"] = (double)TotalAmountSpendByCategory["Misc"] + m.Amount; } foreach (var s in filteredTransactionsByMonth.Where(t => t.Type == TransactionType.Shopping).ToList()) { shoppingGroup.Add(new TransactionModel() { Name = s.Date.ToShortDateString() + " " + s.Name, Amount = String.Format("{0:C2}", s.Amount), FileName = s.FileName }); TotalAmountSpendByCategory["Shopping"] = (double)TotalAmountSpendByCategory["Shopping"] + s.Amount; } foreach (var r in filteredTransactionsByMonth.Where(t => t.Type == TransactionType.Rent).ToList()) { rentGroup.Add(new TransactionModel() { Name = r.Date.ToShortDateString() + " " + r.Name, Amount = String.Format("{0:C2}", r.Amount), FileName = r.FileName }); TotalAmountSpendByCategory["Rent"] = (double)TotalAmountSpendByCategory["Rent"] + r.Amount; } GroupedTransactions.Clear(); carGroup.AmountByCategory = "CAR " + String.Format("{0:C2}", TotalAmountSpendByCategory["Car"]); entertainmentGroup.AmountByCategory = "ENTERTAINMENT " + String.Format("{0:C2}", TotalAmountSpendByCategory["Entertainment"]); foodGroup.AmountByCategory = "FOOD " + String.Format("{0:C2}", TotalAmountSpendByCategory["Food"]); miscGroup.AmountByCategory = "MISC " + String.Format("{0:C2}", TotalAmountSpendByCategory["Misc"]); shoppingGroup.AmountByCategory = "SHOPPING " + String.Format("{0:C2}", TotalAmountSpendByCategory["Shopping"]); rentGroup.AmountByCategory = "RENT " + String.Format("{0:C2}", TotalAmountSpendByCategory["Rent"]); GroupedTransactions.Add(carGroup); GroupedTransactions.Add(entertainmentGroup); GroupedTransactions.Add(foodGroup); GroupedTransactions.Add(miscGroup); GroupedTransactions.Add(shoppingGroup); GroupedTransactions.Add(rentGroup); lstView.ItemsSource = GroupedTransactions; foreach (var t in filteredTransactionsByMonth) { TotalAmountSpendByCategory[t.Type.ToString()] = t.Amount + (double)TotalAmountSpendByCategory[t.Type.ToString()]; TotalSpend += t.Amount; } foreach (var b in filteredBudgetListByMonth) { TotalBudget += b.TotalBudget; } TotalsLabel.Text = String.Format("{0:C2}", TotalSpend) + " | " + String.Format("{0:C2}", TotalBudget - TotalSpend); }
/// <summary> /// 初始化UC窗体(from xml) /// </summary> private void initialUC() { if (File.Exists(Neusoft.FrameWork.WinForms.Classes.Function.CurrentPath + Neusoft.FrameWork.WinForms.Classes.Function.TempPath + @"\EprDisease.xml")) { XmlDocument dt = new XmlDocument(); StreamReader sr = File.OpenText(Neusoft.FrameWork.WinForms.Classes.Function.CurrentPath + Neusoft.FrameWork.WinForms.Classes.Function.TempPath + @"\EprDisease.xml"); string str = sr.ReadToEnd(); sr.Close(); if (str == "") { return; } try { dt.LoadXml(str); }catch (Exception em) { MessageBox.Show(em.Message); } XmlNodeList nodeList = dt.SelectNodes(@"//病程记录//PatientInfo"); ht.Clear(); Container tempC = new Container(); foreach (XmlNode xNode in nodeList) { FarsiLibrary.Win.FATabStripItem ft = new FarsiLibrary.Win.FATabStripItem(); ucDiseaseInputOne contrOne = new ucDiseaseInputOne(); contrOne.DateTimePickerChange += new ucDiseaseInputOne.DateTimePickerChanged(control_DateTimePickerChange); contrOne.Size = new Size(569, 480); ft.Title = xNode.Attributes ["Title"].Value; ft.Controls.Add(contrOne); this.TabControl1.AddTab(ft); #region 给各控件赋值 foreach (Control c in contrOne.Controls) { int a = Neusoft.FrameWork.Function.NConvert.ToInt32(c.Tag); if (c.GetType() == typeof(Neusoft.FrameWork.EPRControl.emrMultiLineTextBox)) { c.Font = f; tempC.Add(c); } if (a == 1) { ((DateTimePicker)c).Text = xNode.Attributes ["Date"].Value; } else if (a == 2) { ((TextBox)c).Text = xNode.Attributes["DocUpName"].Value; } else if (a == 3) { ((ComboBox )c).Text = xNode.Attributes["DocUpType"].Value; } else if (a == 4) { //if (tr)//false副主任,主任。true主治 //{ // ((Neusoft.FrameWork.EPRControl.emrMultiLineTextBox)c).IsShowModify = false ; //} //else //{ // ((Neusoft.FrameWork.EPRControl.emrMultiLineTextBox)c).IsShowModify = true ; //} ((RichTextBox)c).Rtf = xNode.InnerText; } else if (a == 5) { ((TextBox)c).Text = xNode.Attributes["DocSign"].Value; } else if (a == 6) { ((TextBox)c).Text = xNode.Attributes ["DocUpSign"].Value; } } #endregion //if (tr) //{ // if (xNode.Attributes["IsUpSubMission"].Value == "1") // { // contrOne.Enabled = false; // } //} contrOne.IsUpDocSign = xNode.Attributes["IsUpDocSign"].Value; contrOne.IsUpSubmission = xNode.Attributes["IsUpSubMission"].Value; int tmpName = Neusoft.FrameWork.Function.NConvert.ToInt32(ft.Title.LastIndexOf('(')); string tt = ft.Title.Substring(tmpName + 1).Replace(')', ' '); ht.Add(Neusoft.FrameWork.Function.NConvert.ToInt32(tt), ft); } this.ucUserText1.SetControl(tempC); this.TabControl1.AlwaysShowClose = false; this.TabControl1.Refresh(); } }
private static void Do_Compilation_OO(Oval start, GeneratorAda.OO_Interface gil, TabControl.TabPageCollection tpc) { _tpc = tpc; foreach (NClass.Core.IEntity ie in Runtime.parent.projectCore.Entities) { if (ie is NClass.Core.InterfaceType) { gil.start_interface(ie as NClass.Core.InterfaceType); foreach (NClass.Core.Operation o in (ie as NClass.Core.InterfaceType).Operations) { if (o is NClass.Core.Method) { gil.declare_interface_method(o as NClass.Core.Method); } } gil.done_interface(ie as NClass.Core.InterfaceType); } } foreach (ClassTabPage ctp in allClasses(tpc)) { gil.declare_class(ctp.ct); foreach (Procedure_Chart pc in allMethods(ctp)) { NClass.Core.Method method = pc.method; gil.declare_method(method); } } foreach (ClassTabPage ctp in allClasses(tpc)) { NClass.Core.ClassType ct = ctp.ct; gil.start_class(ct); foreach (NClass.Core.Field f in ct.Fields) { gil.declare_field(f); } foreach (NClass.Core.Operation o in ct.Operations) { if ((o is NClass.Core.Method) && o.IsAbstract) { gil.declare_abstract_method(o as NClass.Core.Method); } } foreach (Procedure_Chart pc in allMethods(ctp)) { NClass.Core.Method method = pc.method; gil.start_method(method); declarations.Clear(); pc.Start.compile_pass1(gil); gil.Done_Variable_Declarations(); pc.Start.Emit_Code(gil); gil.Done_Method(); } gil.done_class(ctp.ct); } gil.Start_Method("Main"); declarations.Clear(); start.compile_pass1(gil); gil.Done_Variable_Declarations(); start.Emit_Code(gil); gil.Done_Method(); gil.Finish(); }
public void Clear() { OnClear(); table.Clear(); OnClearComplete(); }
public void Clear() { container.Clear(); }
internal virtual void ClearTypeSystemBindings() { _annotations.Clear(); }
public void stopProcessing() { _threadRunning = false; queue.Clear(); ftpObject.stopProcess(true); }