本文整理汇总了C#中Util类的典型用法代码示例。如果您正苦于以下问题:C# Util类的具体用法?C# Util怎么用?C# Util使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Util类属于命名空间,在下文中一共展示了Util类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: pickerType_SelectedIndexChanged
protected void pickerType_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
Util util = new Util();
if (util.CheckSessionTimeout(State, Response, "../Default.aspx")) return;
pickerType.SelectedValue = e.Value;
SectionMessage.Visible = true;
section_names.Visible = true;
switch (e.Value)
{
case "time":
case "date":
SectionMessage.Visible = false;
section_names.Visible = false;
SectionPages.SelectedIndex = 0;
break;
case "1_section":
SectionMessage.Text = "Enter the Section Name";
SectionPages.SelectedIndex = 1;
break;
case "2_sections":
SectionMessage.Text = "Enter 2 Section Names separated by a comma";
SectionPages.SelectedIndex = 2;
break;
case "3_sections":
SectionMessage.Text = "Enter 3 Section Names separated by commas";
SectionPages.SelectedIndex = 3;
break;
case "4_sections":
SectionMessage.Text = "Enter 4 Section Names separated by commas";
SectionPages.SelectedIndex = 4;
break;
}
}
示例2: Page_Load
// Util util = new Util(SecretConstants.BASE_URL);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Util util = new Util(SecretConstants.BASE_URL);
if (Session["token"] == null)
{
string token = util.GetAccessToken(SecretConstants.CLIENT_ID,
SecretConstants.CLIENT_SECRET).access_token;
if (token == string.Empty)
{
//LogExtensions.Log("Authentication error");
}
Session["token"] = token;
}
bool bucketExist = util.IsBucketExist(SecretConstants.DEFAULT_BUCKET_KEY, Session["token"].ToString());
if (!bucketExist)
{
util.CreateBucket(SecretConstants.DEFAULT_BUCKET_KEY, Session["token"].ToString());
}
}
}
示例3: CopyApplicationButton_Click
protected void CopyApplicationButton_Click(object sender, EventArgs e)
{
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (util.CheckSessionTimeout(State, Response, "../Default.aspx")) return;
if (Applications.Text.IndexOf("->") > 0)
{
Message.Text = "Select Application.";
return;
}
if (ToAccounts.Text.IndexOf("->") > 0)
{
Message.Text = "Select Destination Account.";
return;
}
if (ToAccounts.Text == FromAccounts.Text)
{
Message.Text = "Select a Different Destination Account.";
return;
}
string app_name = Applications.SelectedItem.Text;
//copy application
util.CopyAppToAccount(State, app_name);
Message.Text = "Application Copy is Successful.";
}
示例4: Add
/// <summary>
/// This adds a LinkedList of objects
/// </summary>
/// <param name="actorList">The list of objects</param>
public void Add(Util.LinkedList actorList)
{
foreach(DXMAN.Physics.xVolume obj in m_xObjects)
{
Add(obj);
}
}
示例5: GetDetailsList
//трава
public static Grass[] GetDetailsList(Util.Map.Location map)
{
Grass[] textures = new Grass[0];
switch (map) {
case Util.Map.Location.Lorencia: textures = new Grass[]{
new Grass(){ file = "TileGrass01", dry = Color.yellow, healthy = Color.green, minHeight = 100, maxHeight = 120 }
}; break;
case Util.Map.Location.Devias: textures = new Grass[]{
new Grass(){ file = "TileGrass02", dry = Color.white, healthy = Color.white, minHeight = 50, maxHeight = 100 },
new Grass(){ file = "TileGrass02", dry = Color.white, healthy = Color.white, minHeight = 50, maxHeight = 100 }
}; break;
case Util.Map.Location.Noria: textures = new Grass[]{
new Grass(){ file = "TileGrass01", dry = Color.yellow, healthy = Color.green, minHeight = 150, maxHeight = 200 },
null,
new Grass(){ file = "TileGrass03", dry = Color.yellow, healthy = Color.yellow, minHeight = 200, maxHeight = 300 }
}; break;
case Util.Map.Location.DareDevil: textures = new Grass[]{
new Grass(){ file = "TileGrass01", dry = Color.yellow, healthy = Color.yellow, minHeight = 150, maxHeight = 200 },
new Grass(){ file = "TileGrass02", dry = Color.white, healthy = Color.white, minHeight = 150, maxHeight = 200 },
new Grass(){ file = "TileGrass03", dry = Color.yellow, healthy = Color.yellow, minHeight = 200, maxHeight = 300 }
}; break;
case Util.Map.Location.Stadium: textures = new Grass[]{
new Grass(){ file = "TileGrass01", dry = Color.yellow, healthy = Color.yellow, minHeight = 100, maxHeight = 150 }
}; break;
case Util.Map.Location.Tarcan: textures = new Grass[]{
new Grass(){ file = "TileGrass01", dry = Color.gray, healthy = Color.gray, minHeight = 200, maxHeight = 300 },
null,
new Grass(){ file = "TileGrass03", dry = Color.yellow, healthy = Color.yellow, minHeight = 200, maxHeight = 300 }
}; break;
}
return textures;
}
示例6: ResetDataResponseMap_Click
public void ResetDataResponseMap_Click(object sender, EventArgs e)
{
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;
ClearMessages();
XmlDocument doc = util.GetStagingAppXml(State);
XmlNode web_service_data_responses = doc.SelectSingleNode("//web_service_data_responses");
if (web_service_data_responses != null)
{
web_service_data_responses.RemoveAll();
}
XmlNode phone_data_requests = doc.SelectSingleNode("//phone_data_requests");
if (phone_data_requests == null)
return;
XmlNodeList event_fields = phone_data_requests.SelectNodes("phone_data_request/event_field");
foreach (XmlNode event_field in event_fields)
{
XmlNode phone_data_request = event_field.ParentNode;
XmlNodeList output_mappings = phone_data_request.SelectNodes("output_mapping");
foreach (XmlNode output_mapping in output_mappings)
{
phone_data_request.RemoveChild(output_mapping);
}
}
util.UpdateStagingAppXml(State);
BuildWebServiceDataTrees(WebServiceEvents.SelectedItem.Text);
ResponseMessage.Text = "Response Map Reset.";
ResponseTreeEdits.Text = "";
}
示例7: Save_Click
protected void Save_Click(object sender, EventArgs e)
{
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (util.CheckSessionTimeout(State, Response, "../../Default.aspx")) return;
string name = UrlAccountIdentifier.Value.Trim();
if (name.Length == 0)
{
Message.Text = "Enter Account Identifier Name";
return;
}
if (!IsStringAlphaNumericPeriod(name) || name == ".")
{
Message.Text = "Domain Name should only use alphanumeric characters or '.'";
return;
}
if (util.DoesUrlAccountIdentifierExist((Hashtable)HttpRuntime.Cache[Session.SessionID], name))
Message.Text = "Account Identifier " + name + " is not Available.";
else
{
UrlAccountIdentifier.Value = name;
util.SaveUrlAccountIdentifier((Hashtable)HttpRuntime.Cache[Session.SessionID], name);
State["UrlAccountIdentifier"] = name;
Message.Text = "Account Identifier " + name + " has been saved. ";
}
}
示例8: Main
static void Main(string[] args)
{
Util u = new Util();
Console.WriteLine(u.x);
Thread t = new Thread(new ThreadStart(u.Incrementar));
t.Start();
Thread.Sleep(500);
t = new Thread(new ThreadStart(u.Atribuir));
t.Start();
Thread.Sleep(500);
t = new Thread(new ThreadStart(u.AtribuirSe));
t.Start();
Thread.Sleep(500);
t = new Thread(new ThreadStart(u.Decrementar));
t.Start();
Thread.Sleep(500);
t = new Thread(new ThreadStart(u.Somar));
t.Start();
Thread.Sleep(500);
Console.WriteLine(u.x);
Console.ReadKey();
}
示例9: ZedGraphWrapper_DoubleClick
public void ZedGraphWrapper_DoubleClick(Util.Variable.DataPoint point)
{
if (captureSwitch)
{
AddBasePoint(point);
}
}
示例10: AddFiltered
// The base class gathers mouse events and calls AnalyzeGesture()
protected override bool AddFiltered(Util.WinForms.DragState state_, DragPoint dp)
{
DragState state = (DragState)state_;
if (state.ClickedShape != null && state.ClickedShape.AllowsDrag)
return false; // gesture recognition is off
return base.AddFiltered(state, dp);
}
示例11: FilteredChatBoxMessageEventProvider
public FilteredChatBoxMessageEventProvider(IDecalEventsProxy decalEventsProxy, Util.ChatFlags chatFilter, Util.ChatChannels channelFilter)
{
this._decalEventsProxy = decalEventsProxy;
this._chatFilter = chatFilter;
this._channelFilter = channelFilter;
this._decalEventsProxy.ChatBoxMessage += this.DecalEventsProxy_ChatBoxMessage;
}
示例12: hud
//*********************************************************
//*********************************************************
// Constructor
public hud(frmTerminal term)
{
InitializeComponent();
m_term = term;
m_util = new Util();
}
示例13: DeleteImageFile
public string DeleteImageFile(Hashtable State, string url)
{
string AWSAccessKey = ConfigurationManager.AppSettings["AWSAccessKey"];
string AWSSecretKey = ConfigurationManager.AppSettings["AWSSecretKey"];
string Bucket = ConfigurationManager.AppSettings["ImageBucket"];
TransferUtility transferUtility = new TransferUtility(AWSAccessKey, AWSSecretKey);
try
{
DeleteObjectRequest request = new DeleteObjectRequest();
string file_name = url.Substring(url.LastIndexOf("/") + 1);
string key = State["Username"].ToString() + "/" + file_name;
request.WithBucketName(Bucket)
.WithKey(key);
using (DeleteObjectResponse response = transferUtility.S3Client.DeleteObject(request))
{
WebHeaderCollection headers = response.Headers;
}
}
catch (AmazonS3Exception ex)
{
Util util = new Util();
util.LogError(State, ex);
return ex.Message + ": " + ex.StackTrace;
}
return "OK";
}
示例14: Applications_SelectedIndexChanged
protected void Applications_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
ClearMessages();
//get initial values
if (e.Text.IndexOf("->") > 0)
{
HideForApplications();
return;
}
ShowForApplications();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
string customer_id = State["ServerAdminCustomerID"].ToString();
Util util = new Util();
State["SelectedAdminApp"] = e.Text;
string sql = "SELECT * FROM applications WHERE customer_id='" + customer_id + "' AND application_name='" + e.Text + "'";
DB db = new DB();
DataRow[] rows = db.ViziAppsExecuteSql(State, sql);
string status = "";
DataRow row = rows[0];
string application_id = row["application_id"].ToString();
State["application_id"] = application_id;
status = row["status"].ToString();
ApplicationStatus.Text = status;
db.CloseViziAppsDatabase(State);
}
示例15: GetSpreadsheets_Click
protected void GetSpreadsheets_Click(object sender, EventArgs e)
{
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
Util util = new Util();
if (util.CheckSessionTimeout(State, Response, "../Default.aspx")) return;
ClearMessages();
if (! State["AccountType"].ToString().Contains("google_apps"))
{
if (Username.Text.Length == 0)
{
SaveGoogleDocsInfoMessage.Text = "Enter your Google Docs account username.";
return;
}
if (Password.Text.Length == 0)
{
SaveGoogleDocsInfoMessage.Text = "Enter your Google Docs account password.";
return;
}
else
State["GDocsPassword"] = Password.Text.Trim();
}
GDocs gDocs = new GDocs();
String ret = gDocs.GetSpreadsheets(State, AccountSpreadsheets, Username.Text.Trim(),Password.Text.Trim());
if (ret != "OK")
SaveGoogleDocsInfoMessage.Text = "Either the username or password was not valid. "+ ret;
}