本文整理汇总了C#中Util类的典型用法代码示例。如果您正苦于以下问题:C# Util类的具体用法?C# Util怎么用?C# Util使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Util类属于命名空间,在下文中一共展示了Util类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:35,代码来源:InsertWebAppPicker.aspx.cs
示例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());
}
}
}
开发者ID:khoaho,项目名称:workflow-aspnet-webform-view.and.data.api,代码行数:30,代码来源:Default.aspx.cs
示例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.";
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:28,代码来源:CopyApplication.aspx.cs
示例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);
}
}
开发者ID:andrewgbliss,项目名称:CS_DXMAN,代码行数:11,代码来源:xPhysicsManager.cs
示例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;
}
开发者ID:cyanpunk,项目名称:muonline,代码行数:33,代码来源:WorldConfig.cs
示例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 = "";
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:34,代码来源:ManageData.aspx.cs
示例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. ";
}
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:27,代码来源:AccountIdentifier.aspx.cs
示例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();
}
开发者ID:50minutos,项目名称:VS2010,代码行数:30,代码来源:Program.cs
示例9: ZedGraphWrapper_DoubleClick
public void ZedGraphWrapper_DoubleClick(Util.Variable.DataPoint point)
{
if (captureSwitch)
{
AddBasePoint(point);
}
}
开发者ID:buaaqlyj,项目名称:CurvePane,代码行数:7,代码来源:CurveManager.cs
示例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);
}
开发者ID:qwertie,项目名称:ecsharp,代码行数:9,代码来源:DiagramGestureAnalyzer.cs
示例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;
}
开发者ID:mrvoorhe,项目名称:redox-extensions,代码行数:7,代码来源:FilteredChatBoxMessageEventProvider.cs
示例12: hud
//*********************************************************
//*********************************************************
// Constructor
public hud(frmTerminal term)
{
InitializeComponent();
m_term = term;
m_util = new Util();
}
开发者ID:bigwookiee,项目名称:Mission-Control,代码行数:10,代码来源:hud.cs
示例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";
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:27,代码来源:AmazonS3.cs
示例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);
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:29,代码来源:Admin.aspx.cs
示例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;
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:27,代码来源:GoogleSpreadsheetDataSource.aspx.cs
示例16: ZedGraphWrapper_MouseMove
public void ZedGraphWrapper_MouseMove(Util.Variable.DataPoint point)
{
if (captureSwitch)
{
DisplayBasePointEvent(point);
}
}
开发者ID:buaaqlyj,项目名称:CurvePane,代码行数:7,代码来源:CurveManager.cs
示例17: ManageDataApps_SelectedIndexChanged
/***************************************** Common Functions *******************************/
public void ManageDataApps_SelectedIndexChanged(object sender, EventArgs e)
{
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;
ClearMessages();
State["ManageDataType"] = null;
string app_name = Request.Form.Get("ManageDataApps");
if (!app_name.Contains("->"))
{
State["SelectedApp"] = app_name;
ManageDataApps.SelectedValue = app_name;
InitDataTrees(app_name);
ViewStoryBoard.Style.Value = "";
ManageDataType.Style.Value = "";
ManageDataTypeLabel.Style.Value = "";
}
else
{
ManageDataType.Style.Value = "display:none";
ManageDataTypeLabel.Style.Value = "display:none";
ViewStoryBoard.Style.Value = "display:none";
util.ResetAppStateVariables(State);
ContentMultiPage.SelectedIndex = 0;
ShouldRefreshStoryBoard.Text = "close";
Init init = new Init();
init.InitManageDataAppsList(State);
DataMultiPage.SelectedIndex = 3;
}
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:33,代码来源:ManageData.aspx.cs
示例18: GetInstance
public static Util GetInstance()
{
if(_instance ==null)
_instance = new Util();
return _instance;
}
开发者ID:ESearcy,项目名称:PVE-AI-Drones-Drone-Conquest,代码行数:7,代码来源:Util.cs
示例19: ProcessRequest
public void ProcessRequest(HttpContext context)
{
string respJson = string.Empty;
Util util = new Util(SecretConstants.BASE_URL);
AccessToken token = util.GetAccessToken(SecretConstants.CLIENT_ID,
SecretConstants.CLIENT_SECRET);
if (context.Session["token"] == null)
{
string accessToken = token.access_token;
if (accessToken == string.Empty)
{
//LogExtensions.Log("Authentication error");
}
context.Session["token"] = accessToken;
}
respJson = Newtonsoft.Json.JsonConvert.SerializeObject(token);
context.Response.ContentType = "application/json";
context.Response.Write(respJson);
}
开发者ID:khoaho,项目名称:workflow-aspnet-webform-view.and.data.api,代码行数:25,代码来源:GetAccessToken.ashx.cs
示例20: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
HelpClick.Attributes.Add("onclick", PopupHelper.GeneratePopupScript(
"../../Help/Design/AppTypeHelp.htm", 260, 530, false, false, false, false));
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;
XmlUtil x_util = new XmlUtil();
AppType.Items.Clear();
AppType.Items.Add(new RadComboBoxItem("Select ->", "->"));
switch (State["SelectedAppType"].ToString())
{
case Constants.NATIVE_APP_TYPE:
AppType.Items.Add(new RadComboBoxItem("Web App Type (no accecss to native device resources)", Constants.WEB_APP_TYPE));
AppType.Items.Add(new RadComboBoxItem("Hybrid App Type", Constants.HYBRID_APP_TYPE));
break;
case Constants.WEB_APP_TYPE:
AppType.Items.Add(new RadComboBoxItem("Native App Type", Constants.NATIVE_APP_TYPE));
AppType.Items.Add(new RadComboBoxItem("Hybrid App Type", Constants.HYBRID_APP_TYPE));
break;
case Constants.HYBRID_APP_TYPE:
AppType.Items.Add(new RadComboBoxItem("Web App Type (no accecss to native device resources)", Constants.WEB_APP_TYPE));
AppType.Items.Add(new RadComboBoxItem("Native App Type", Constants.NATIVE_APP_TYPE));
break;
}
}
}
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:29,代码来源:ConvertApp.aspx.cs
注:本文中的Util类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论