/// <summary> /// 将选择的向量复制到粘贴板 /// </summary> /// <param name="v3"></param> private static void CopyVec3ToClipboard(Vector3[] v3, InfoType type) { string varName = type.ToString().ToLower(); //复制的内容 string content = v3.Length == 1 ? "Vector3 " + varName + " = " : "Vector3[] " + varName + "s = new Vector3[] { "; for (int i = 0; i < v3.Length; i++) { float x = v3[i].x; float y = v3[i].y; float z = v3[i].z; content += "new Vector3(" + x + "f, " + y + "f, " + z + "f)"; if (i != v3.Length - 1) { content += ", "; } } content += v3.Length > 1 ? " };" : ";"; //复制到剪贴板 TextEditor te = new TextEditor(); te.text = content; te.OnFocus(); te.Copy(); }
/// <param name="name">Element name</param> /// <param name="description">Description for current element</param> /// <param name="type">Element type</param> /// <param name="displaying">Displays element over the 'Name' property</param> public NodeInfo(string name, string description, InfoType type = InfoType.Unspecified, string displaying = null) { Name = name; Description = description; this.type = type; this.displaying = displaying; }
public void PublishStateInfo(string stateInfo, InfoType infoType) { if (this.StateInfoReceived != null) { this.StateInfoReceived(this, new EventArgs <Tuple <InfoType, string> >(new Tuple <InfoType, string>(infoType, stateInfo))); } }
public async Task<ServiceResponse<int>> GetAddressInfoAsync(DistanceMatrixParameters parameters, InfoType info) { var result = new ServiceResponse<int>() { Success = false, Message = "Failed to get Buration data from service" }; var response = await GetResponseAsync(parameters); if (response.Success) { var json = JsonConvert.DeserializeObject<DistanceMatrixResponse>(response.Value); var elem = json.Rows[0].Elements[0]; var propName = Enum.GetName(typeof(InfoType), (int)info); var item = elem.GetType().GetProperty(propName).GetValue(elem); var value = item.GetType().GetProperty("Value").GetValue(item); result.Value = (int)value; result.Success = true; result.Message = ""; } else { throw new Exception(response.Message, new Exception(response.Value)); } return result; }
void OnPlayInfoChanged(InfoType type) { if (type == InfoType.Equip) { UpdateShow(); } }
public String GetInfo(InfoType type) { return _stream.MediaInfo.GetParameterInfo(_stream.Type, _stream.Number, _index, type); }
public ActionResult EditInfoType(Guid id) { ViewBag.InfoTypes = GetAllInfoTypes(); if (id == Guid.Empty) { return(View(new InfoType() { Active = true })); } else { InfoType infoType = null; using (var session = sessionFactory.OpenSession()) { infoType = session.Get <InfoType>(id); } if (infoType == null) { return(new HttpNotFoundResult(string.Format("InfoType with id = {0} was not found in database", id))); } return(View(infoType)); } }
public static void Log(InfoType infoType, string info) { if (LogAction != null) { LogAction(infoType, info); } }
public static void AddMessage(string[] messages, InfoType type) { foreach (String message in messages) { Information.AddMessage(message, type); } }
public static Object GetMsg(InfoType type, JToken msg) { if (type == InfoType.ConnReq || type == InfoType.GameMade || type == InfoType.JoinResult || type == InfoType.MoveReq) { return(msg.ToObject <int>()); } else if (type == InfoType.Win || type == InfoType.Lose) { return(msg.ToObject <string>()); } else if (type == InfoType.LobbyResp) { return(msg.ToObject <List <bool> >()); } else if (type == InfoType.LobbyData) { return(msg.ToObject <List <int> >()); } else if (type == InfoType.MoveResult) { return(msg.ToObject <Tuple <bool, int, int> >()); } else { return(""); } }
public SignUpInfo(InfoType type, string subtitle) { Type = type; Subtitle = subtitle; Info = new List<int>(); HidesKeyboard = true; }
void OnPlayInfoChanged(InfoType type) { if (type == InfoType.All || type == InfoType.Name || type == InfoType.HeadPortait || type == InfoType.Level || type == InfoType.Energy || type == InfoType.Toughen || type == InfoType.Coin || type == InfoType.Diamond) { UpdateShow(); } }
void OnPlayerInfoChanged(InfoType type) { if (type == InfoType.All || type == InfoType.Hp || type == InfoType.Damage || type == InfoType.Exp||type==InfoType.Equip) { UpdateShow(); } }
public void TestTriggerList() { var infoTypes = new InfoType[] { new InfoType { Name = "PERSON_NAME" } }; var triggerId = $"my-csharp-test-trigger-{Guid.NewGuid()}"; var fullTriggerId = $"projects/{Fixture.ProjectId}/jobTriggers/{triggerId}"; var displayName = $"My trigger display name {Guid.NewGuid()}"; var description = $"My trigger description {Guid.NewGuid()}"; using var randomBucketFixture = new RandomBucketFixture(); using var bucketCollector = new BucketCollector(randomBucketFixture.BucketName); var bucketName = randomBucketFixture.BucketName; var fileName = Guid.NewGuid().ToString(); var objectName = $"gs://{bucketName}/{fileName}"; bucketCollector.CopyToBucket(Path.Combine(Fixture.ResourcePath, "dates-input.csv"), fileName); var trigger = TriggersCreate.Create(Fixture.ProjectId, bucketName, Likelihood.Unlikely, 1, true, 1, infoTypes, triggerId, displayName, description); try { var triggers = TriggersList.List(Fixture.ProjectId); Assert.Contains(triggers, t => t.Name == trigger.Name); } finally { TriggersDelete.Delete(trigger.Name); } }
void OnPlayerInfoChanged(InfoType type) { if (type == InfoType.HeadPortrait || type == InfoType.Name || type == InfoType.Level || type == InfoType.Energy || type == InfoType.Toughen || type == InfoType.All) { UpdateShow(); } }//当我们的主角信息发生改变的时候,会触发这个方法
void OnPlayerInfoChanged(InfoType type) { if(type == InfoType.All || type ==InfoType.Coin || type == InfoType .Diamond) { UpdateShow(); } }
public bool IsInfoTypeRequired(InfoType infoType) { int bitNumber = (int)infoType; if (bitNumber < 64) { return((a & (1UL << bitNumber)) != 0); } else if (bitNumber < 128) { bitNumber -= 64; return((b & (1UL << bitNumber)) != 0); } else if (bitNumber < 192) { bitNumber -= 128; return((c & (1UL << bitNumber)) != 0); } else { bitNumber -= 192; return((d & (1UL << bitNumber)) != 0); } }
// Helper for writing info lines to the info stream. internal void WriteInfo(InfoType type, string infoMessage) { ConsoleColor foreground, background = ConsoleColor.Black; switch (type) { case InfoType.Default: foreground = ConsoleColor.Gray; break; case InfoType.Advice: foreground = ConsoleColor.Green; break; case InfoType.FilePath: foreground = ConsoleColor.Cyan; break; case InfoType.Issue: foreground = ConsoleColor.Yellow; break; case InfoType.Signon: foreground = ConsoleColor.White; break; default: throw new ArgumentException(); } WriteInfo(infoMessage, foreground, background); }
/// <summary> /// קבלת מידע על השימוש הנוכחי בספרייה עם הקובץ הנוכחי. /// </summary> /// <param name="t">סוג המידע להחזרה</param> /// <returns>המידע שהתבקש, או כלום אם הפעולה לא הצליחה</returns> public object GetInfo(InfoType t) { try { switch (t) { case InfoType.Seperator: return(seperator); case InfoType.Comment: return(comment); case InfoType.FileName: return(path.Split('\\')[path.Split('\\').Length].Split('.')[0]); case InfoType.FullFileName: return(path.Split('\\')[path.Split('\\').Length]); case InfoType.FileExt: return(path.Split('.')[path.Split('.').Length]); case InfoType.FullPath: return(path); case InfoType.Lines: return(File.ReadAllLines(path).Length); default: return(null); } } catch { return(null); } }
public static void GetNextLevelUp(ref InfoType infoType, ref int objectID) { switch (infoType) { case InfoType.Category: infoType = InfoType.None; break; case InfoType.CategoryCity: objectID = InfoDL.FindID(infoType, objectID); infoType = InfoType.Category; break; case InfoType.CategoryArea: objectID = InfoDL.FindID(infoType, objectID); infoType = InfoType.CategoryCity; break; case InfoType.ContractorCategory: infoType = InfoType.None; break; case InfoType.ContractorCategoryCity: objectID = InfoDL.FindID(infoType, objectID); infoType = InfoType.ContractorCategory; break; case InfoType.ContractorCategoryArea: objectID = InfoDL.FindID(infoType, objectID); infoType = InfoType.ContractorCategoryCity; break; } }
public bool ContainsInfoType(InfoType infoType) { //if (infoListHardLocked) // throw new Exception("You are not allowed to make any further changes to the infolist after it has been hardlocked."); return(infoList.ContainsKey(infoType)); }
public static string GetMessage(this InfoType type) { var enumType = type.GetType(); var description = enumType.GetCustomAttribute <EnumDescription>(); return(description?.Description); }
}//体力和历练自动恢复方法 public void OnPlayerInfoChange(InfoType infoType) { if (infoType == InfoType.Name || infoType == InfoType.Energy || infoType == InfoType.Toughen) { roleController.UpdateRole(PhotonEngine.Instance.role); } }
void OnPlayerInfoChanged(InfoType type) { if (type == InfoType.All || type == InfoType.HP || type == InfoType.Damage || type == InfoType.Exp || type == InfoType.Equip) { UpdateShow(); } }
void OnPlayerInfoChanged(InfoType type) { if(type == InfoType.All) { UpdateShow(); } }
void OnPlayerInfoChanged(InfoType type) { if (type == InfoType.All || type == InfoType.Name || type == InfoType.HeadPortrait || type == InfoType.Level || type == InfoType.Energy || type == InfoType.Toughen) { UpdateBar(); } }
void OnCharacterInfoChanged(InfoType type) { if (type == InfoType.All || type == InfoType.maxHP || type == InfoType.damageMax || type == InfoType.expcur || type == InfoType.Equip) { UpdateEquipInfo(); } }
public static DataTable GetInfo(ApplicationUninstallerEntry entry, InfoType infoType) { try { switch (infoType) { case InfoType.Overview: return(ExtractOverview(entry)); case InfoType.FileInfo: return(ExtractFileInfo(entry)); case InfoType.Registry: return(ExtractRegistryInfo(entry)); case InfoType.Certificate: return(ExtractCertificateInfo(entry)); default: throw new InvalidOperationException("Selected tab is invalid or not supported."); } } catch (Exception ex) { return(GetError(ex.Message)); } }
public static String prettyPrintInfoType(InfoType uglybuggly) { String res = "None"; switch (uglybuggly) { case InfoType.DEFIBRELLATOR: res = "Defibrellator"; break; case InfoType.FIRE_EXTINGUISHER: res = "Fire Extinguisher"; break; case InfoType.FIRST_AID_KIT: res = "First Aid Kit"; break; case InfoType.OFFICE: res = "Office"; break; case InfoType.TOILET: res = "Toilet"; break; case InfoType.FOOD: res = "Food"; break; case InfoType.LECTURE_ROOM: res = "Lecture Room"; break; default: res = "None"; break; } return res; }
public Info(InfoType type, string what, ExceptionType ex, SourcePosition where) { this.type = type; this.what = what; this.ex = ex; this.where = where; }
public Info(InfoType type, string what) { this.type = type; this.what = what; this.ex = ExceptionType.None; this.where = null; }
protected ImageSource imageFrom(InfoType type) { switch (type) { case InfoType.Component: { return(imageFrom(Icon.package)); } case InfoType.Definition: { return(imageFrom(Icon.definition)); } case InfoType.Property: { return(imageFrom(Icon.property)); } case InfoType.Method: { return(imageFrom(Icon.function)); } case InfoType.AliasToDefinition: case InfoType.AliasToComponent: { return(imageFrom(Icon.alias)); } } return(null); }
/// <summary> /// Log info about missing reference. /// </summary> /// <param name="sourceCo"> /// MonoBehaviour from which this method was called. /// </param> /// <param name="fieldName"> /// Name of the field that the reference is missing. /// </param> /// <param name="detailedInfo">Additional custom information.</param> /// <param name="type"> /// Type of the Debug.Log() used to output the message. /// </param> public static void MissingReference( MonoBehaviour sourceCo, string fieldName, string detailedInfo = "", InfoType type = InfoType.Error) { // Message to display. // todo use StringBuilder var message = "Component reference is missing in: " + sourceCo.transform.root + " / " + sourceCo.gameObject.name + " '" + sourceCo.GetType() + "'" + " / " + "Field name: " + fieldName + " / " + "Message: " + detailedInfo; switch (type) { case InfoType.Warning: UnityEngine.Debug.LogWarning(message, sourceCo.transform); break; case InfoType.Error: UnityEngine.Debug.LogError(message, sourceCo.transform); break; } }
void OnPlayerInfoChanged(InfoType type) { if (type != null) { UpdateShow(); } }
void OnPlayerInfoChanged(InfoType type) { if (type == InfoType.All || type == InfoType.Coin || type == InfoType.Diamond) { UpdateShow(); } }
void UpdateCoin(InfoType info) { if (info == InfoType.Coin) { coinText.text = PlayerInfo.Instance.Coin.ToString(); } }
//当主角信息发生改变的时候,会触发这个方法 void OnPlayerInfoChanged(InfoType type) { if(type == InfoType.All || type == InfoType.Name || type == InfoType.HeadPortrait || type == InfoType.Level || type == InfoType.Energy || type == InfoType.Toughen) { UpdateShow(); } }
private void FormShow(string msg, string locNo, InfoType infoType) { this.Dispatcher.Invoke(() => { switch (infoType) { case InfoType.dbConn: ShowDbConnStatus(msg); break; case InfoType.plcConn: ShowPlcConnStatus(msg); break; case InfoType.logInfo: ShowExecLog(msg, locNo); break; case InfoType.locStatus: ShowLocStatus(msg, locNo); break; case InfoType.taskCmd: //ShowTaskCmd(); ShowExecLog(msg, locNo); break; } }); }
public static List <EastMoneyModel> GetInfo(InfoType infoType) { List <EastMoneyModel> news = new List <EastMoneyModel>(); var result = ""; try { result = httpRequestHelper.GetHtml(getUrl((int)infoType + "")); } catch (Exception) { return(GetInfo(infoType)); } string pattern = @"defjson: {\S*},"; var content = ""; foreach (Match match in Regex.Matches(result, pattern)) { content = match.Value; } content = content.Replace("defjson: ", "").Replace(",", ""); content = content.Replace("\"\"", "\",\""); content = content.Replace("null\"", "null,\""); content = content.Replace("]\"", "],\""); content = content.Replace("}{", "},{"); string pattern2 = @":\d+"""; foreach (Match match in Regex.Matches(content, pattern2)) { if (match.Value != ":00\"") { content = content.Replace(match.Value, match.Value.Replace("\"", ",\"")); } } JObject resultObj = (JObject)JsonConvert.DeserializeObject(content); foreach (JObject jObject in resultObj["data"]) { //var t = jObject.ToString(); EastMoneyModel eastMoneyModel = new EastMoneyModel(); eastMoneyModel.code = jObject["CDSY_SECUCODES"][0]["SECURITYCODE"].ToString(); eastMoneyModel.stockName = jObject["CDSY_SECUCODES"][0]["SECURITYFULLNAME"].ToString(); eastMoneyModel.title = jObject["NOTICETITLE"].ToString(); eastMoneyModel.Date = DateTime.Parse(jObject["NOTICEDATE"].ToString()); eastMoneyModel.url = jObject["Url"].ToString(); //eastMoneyModel.url = eastMoneyModel.url; string pattern3 = @"\d{3}[A-Z]"; foreach (Match match in Regex.Matches(eastMoneyModel.url, pattern3)) { string t1 = match.Value; string t2 = match.Value.Insert(3, ","); eastMoneyModel.url = eastMoneyModel.url.Replace(t1, t2); break; } eastMoneyModel.type = infoType.ToString(); news.Add(eastMoneyModel); } return(news); }
public static int FindID(InfoType infoType, int objectID) { int newID = 0; SqlConnection conn = new SqlConnection(BWConfig.ConnectionString); string strSQL = ""; switch (infoType) { case InfoType.CategoryCity: strSQL = @"SELECT C.CategoryID FROM CategoryCity CC JOIN Category C ON (C.CategoryID = CC.CategoryID) WHERE CC.CategoryCityID = @ID"; break; case InfoType.CategoryArea: strSQL = @"SELECT CC.CategoryCityID FROM CategoryArea CA JOIN CategoryCity CC ON (CA.CategoryID = CC.CategoryID) JOIN Area A ON (CA.AreaID = A.AreaID AND CC.CityID = A.CityID) WHERE CA.CategoryAreaID = @ID"; break; case InfoType.ContractorCategoryCity: strSQL = @"SELECT CC.ContractorCategoryID FROM ContractorCategoryCity CCC JOIN ContractorCategory CC ON (CCC.ContractorCategoryID = CC.ContractorCategoryID) WHERE CCC.ContractorCategoryCityID = @ID"; break; case InfoType.ContractorCategoryArea: strSQL = @"SELECT CCC.contractorCategoryCityID FROM ContractorCategoryArea CCA JOIN ContractorCategoryCity CCC ON (CCA.ContractorCategoryID = CCC.ContractorCategoryID) JOIN Area A ON (CCA.AreaID = A.AreaID AND (CCC.CityID = A.CityID) ) WHERE (CCA.ContractorCategoryAreaID = @ID)"; break; } try { conn.Open(); SqlCommand sqlCommand = new SqlCommand(strSQL, conn); sqlCommand.CommandType = CommandType.Text; sqlCommand.Parameters.Add("ID", SqlDbType.Int).Value = objectID; newID = Convert.ToInt32(sqlCommand.ExecuteScalar()); } finally { if (conn != null) { if (conn.State == ConnectionState.Open) conn.Close(); conn.Dispose(); } } return newID; }
private string infoParsing(string str, InfoType infoType) { try { StringBuilder sb = new StringBuilder(); if (infoType == InfoType.Header) { string[] split = str.Split(';'); foreach (var item in split) { int equalCount = item.IndexOf('='); if (item != "") { sb.Append(item.Substring(0, equalCount) + ";"); } } } else if (infoType == InfoType.Value) { string[] split = str.Split(';'); foreach (var item in split) { int equalCount = item.IndexOf('='); if (item != "") { sb.Append(item.Substring(equalCount + 1, item.Length - (equalCount + 1)) + ";"); } } } else if (infoType == InfoType.Header_Value) { sb.Append(str); } else { } return sb.ToString(); } catch (Exception e) { return "add fail : " + e.Message; } }
public static string GetColumnName(InfoType t) { switch (t) { case InfoType.Category: return "CategoryID"; case InfoType.CategoryCity: return "CategoryCityID"; case InfoType.CategoryArea: return "CategoryAreaID"; case InfoType.ContractorCategory: return "ContractorCategoryID"; case InfoType.ContractorCategoryCity: return "ContractorCategoryCityID"; case InfoType.ContractorCategoryArea: return "ContractorCategoryAreaID"; default: return ""; } }
public async Task<IHttpActionResult> Get(InfoType id) { switch (id) { case InfoType.LANGUAGE: return Ok(await DB.GetUserLanguage(UserId)); case InfoType.INTEREST: return Ok(await DB.GetUserInterest(UserId)); case InfoType.FOODHABIT: return Ok(await DB.GetUserFoodHabit(UserId)); default: return BadRequest("Invalid information type."); } }
public InfoWindow(string msg, InfoType type = InfoType.Loading) { InitializeComponent(); this.infoLabel.Text = msg; switch (type) { case InfoType.Loading: infoIcon.Size = new Size(24, 24); infoIcon.Image = DTWrapper.GUI.Properties.Resources.loading; ImageAnimator.Animate(infoIcon.Image, new EventHandler(this.OnFrameChanged)); break; default: infoIcon.Size = new Size(0, 0); break; } }
/// <summary> /// Attempts to find the info record associated with the given InfoType and object ID. The first available match will /// be used... area, city, global /// </summary> /// <returns> /// Returns the Info table's DataRow object if an Info record is found /// </returns> public DataRow FindInfoRecord(InfoType infoType, int objectID, ref InfoLevel infoLevel, ref bool isPrimary) { InfoType n = infoType; string field = ""; string sql = ""; // See if this is the primary area if (n == InfoType.CategoryArea) { sql = "SELECT isprimary FROM CategoryArea WHERE (categoryareaid = @ID)"; object o = Data.ExecuteScalar(sql, new SqlParameter("@ID", objectID)); if (o != null && o.ToString() != "") isPrimary = (o.ToString().ToLower() == "true"); } else if (n == InfoType.ContractorCategoryArea) { sql = "SELECT isprimary FROM ContractorCategoryArea WHERE (contractorcategoryareaid = @ID)"; object o = Data.ExecuteScalar(sql, new SqlParameter("@ID", objectID)); if (o != null && o.ToString() != "") isPrimary = (o.ToString().ToLower() == "true"); } // Initialize table and field values SetField(infoType, ref field); while (n != InfoType.None) { sql = "SELECT * FROM Info, " + n.ToString() + " WHERE (" + field + " = @ID) AND " + "(Info.InfoID = " + n.ToString() + ".InfoID)"; // There will be no Info record if this is an add DataTable dt = Data.ExecuteDataset(sql, new SqlParameter("@ID", objectID)).Tables[0]; if (dt.Rows.Count == 1) return dt.Rows[0]; n = RevertInfoType(n, ref objectID, ref infoLevel, ref field); } return null; }
/// <summary> /// provides a simple access to an object with its attribute /// </summary> /// <param name="parentType">the parent type of the object. If the object is not static please use the AttributedObject(object, string, Attribute) constructor.</param> /// <param name="objectName">the name of the object</param> /// <param name="attribute">the attribute of the object</param> public AttributedObject(Type parentType, string objectName, Attribute attribute) { Attribute = attribute; ParentType = parentType; ObjectName = objectName; _parent = null; FieldInfo fieldInfo = parentType.GetField(ObjectName); if (fieldInfo != null) { _infoType = InfoType.FieldInfo; IsStatic = fieldInfo.IsStatic; } else { PropertyInfo propertyInfo = parentType.GetProperty(ObjectName); if (propertyInfo != null) { _infoType = InfoType.PropertyInfo; IsStatic = propertyInfo.GetGetMethod().IsStatic; } } }
public InfoChange(InfoType key, int value, int weight) { Info = key; Value = value; Weight = weight; }
public void OnPlayerInfoChange(InfoType infoType) { if(infoType == InfoType.Name || infoType == InfoType.Energy || infoType == InfoType.Toughen) { roleController.UpdateRole(PhotonEngine.Instance.role); } }
private string GridUserInfo(InfoType type) { return GridUserInfo(type, ""); }
/// <summary> /// Sets the table and field based on the InfoType /// </summary> private void SetField(InfoType t, ref string field) { switch (t) { case InfoType.Category: field = "CategoryID"; break; case InfoType.CategoryCity: field = "CategoryCityID"; break; case InfoType.CategoryArea: field = "CategoryAreaID"; break; case InfoType.ContractorCategory: field = "ContractorCategoryID"; break; case InfoType.ContractorCategoryCity: field = "ContractorCategoryCityID"; break; case InfoType.ContractorCategoryArea: field = "ContractorCategoryAreaID"; break; } }
/// <summary> /// Revert the specified InfoType to a higher level and adjust table and field accordingly /// </summary> private InfoType RevertInfoType(InfoType t, ref int refID, ref InfoLevel infoLevel, ref string field) { InfoType n = t; switch (t) { case InfoType.Category: n = InfoType.None; break; case InfoType.CategoryCity: n = InfoType.Category; infoLevel = InfoLevel.Global; refID = FindRevertedRefID(t, refID); field = "CategoryID"; break; case InfoType.CategoryArea: n = InfoType.CategoryCity; infoLevel = InfoLevel.City; refID = FindRevertedRefID(t, refID); field = "CategoryCityID"; break; case InfoType.ContractorCategory: n = InfoType.None; break; case InfoType.ContractorCategoryCity: n = InfoType.ContractorCategory; infoLevel = InfoLevel.Global; refID = FindRevertedRefID(t, refID); field = "ContractorCategoryID"; break; case InfoType.ContractorCategoryArea: n = InfoType.ContractorCategoryCity; infoLevel = InfoLevel.City; refID = FindRevertedRefID(t, refID); field = "ContractorCategoryCityID"; break; } return n; }
/// <summary> /// Finds the reference id of the object one level up from the specified InfoType /// </summary> private int FindRevertedRefID(InfoType t, int currentRefID) { string sql = ""; int refid = 0; switch (t) { case InfoType.CategoryCity: sql = "SELECT Category.CategoryID FROM CategoryCity, Category WHERE (CategoryCity.CategoryCityID = @ID) AND " + "(Category.CategoryID = CategoryCity.CategoryID)"; break; case InfoType.CategoryArea: sql = "SELECT CategoryCity.CategoryCityID FROM CategoryArea, CategoryCity, Area WHERE (CategoryArea.CategoryAreaID = @ID) AND " + "(Area.AreaID = CategoryArea.AreaID) AND (CategoryCity.CityID = Area.CityID) AND " + "(CategoryCity.CategoryID = CategoryArea.CategoryID)"; break; case InfoType.ContractorCategoryCity: sql = "SELECT ContractorCategory.ContractorCategoryID FROM ContractorCategoryCity, ContractorCategory WHERE (ContractorCategoryCity.ContractorCategoryCityID = @ID) AND " + "(ContractorCategory.ContractorCategoryID = ContractorCategoryCity.ContractorCategoryID)"; break; case InfoType.ContractorCategoryArea: sql = "SELECT ContractorCategoryCity.* FROM ContractorCategoryArea, ContractorCategoryCity, Area WHERE (ContractorCategoryArea.ContractorCategoryAreaID = @ID) AND " + "(Area.AreaID = ContractorCategoryArea.AreaID) AND (ContractorCategoryCity.CityID = Area.CityID) AND " + "(ContractorCategoryCity.ContractorCategoryID = ContractorCategoryArea.ContractorCategoryID)"; break; } object o = Data.ExecuteScalar(sql, new SqlParameter("@ID", currentRefID)); if (o != null) refid = int.Parse(o.ToString()); return refid; }
private ResponseType UpdateInfo(InfoType reason, int level) { ResponseType result = ResponseType.None; switch (reason) { case InfoType.PPFile: switch (level) { case 0: if (MySettings.Program == 0) { result = MessageBox.Show("You didn´t choose a Main Postprocessing Profile!", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Please open a Main Postprocessing Profile!"; } else if (MySettings.Program == 1) { result = MessageBox.Show("Couldn´t find XMP data!", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Please add XMP data to images!"; } else { goto default; } break; case 1: if (MySettings.Program == 0) { InfoLabel.Text = "Opened Postprocessing Profile!"; } else if (MySettings.Program == 1) { InfoLabel.Text = "Loaded XMP Data!"; } else { goto default; } break; default: goto default; } break; case InfoType.Imagecount: result = MessageBox.Show("There are not enough images opened!", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Not enough images!"; break; case InfoType.BrCalc: switch (level) { case 0: InfoLabel.Text = "Calculating (1/3)"; break; case 1: InfoLabel.Text = "Calculating (2/3)"; break; case 2: InfoLabel.Text = "Calculating (3/3)"; break; case 3: InfoLabel.Text = "Error during Calculation!"; break; case 4: InfoLabel.Text = "Calculation Cancelled!"; break; case 5: InfoLabel.Text = "Brightness Calculated!"; break; default: InfoLabel.Text = "Calculating"; break; } break; case InfoType.Wait: InfoLabel.Text = "Wait Please!"; break; case InfoType.Cancel: InfoLabel.Text = "Cancelled work!"; break; case InfoType.CorruptPPFile: if (MySettings.Program == 0) { result = MessageBox.Show("The Postprocessing Profile seems to be corrupt! (Compensation value too high or low)", MessageType.Error, ButtonsType.Ok); InfoLabel.Text = "Corrupt Postprocessing Profile!"; } else if (MySettings.Program == 1) { result = MessageBox.Show("The XMP seems to be corrupt! (Compensation value too high or low)", MessageType.Error, ButtonsType.Ok); InfoLabel.Text = "Corrupt XMP Data!"; } else { goto default; } break; case InfoType.DeleteFolderError: result = MessageBox.Show("Couldn´t remove folder!", MessageType.Error, ButtonsType.Ok); InfoLabel.Text = "Couldn´t remove folder!"; break; case InfoType.CreateFolderError: result = MessageBox.Show("Couldn´t create folder!", MessageType.Error, ButtonsType.Ok); InfoLabel.Text = "Couldn´t create folder!"; break; case InfoType.HitRoof: if (MySettings.Program == 0) { result = MessageBox.Show("One or more Corrections were higher than the Limit of Raw Therapees compensation ability!" + Environment.NewLine + "Do you want to try it anyway? (could give bad results)", "Go on?", MessageType.Warning, ButtonsType.YesNo); } else if (MySettings.Program == 1) { result = MessageBox.Show("One or more Corrections were higher than the Limit of Lightrooms compensation ability!" + Environment.NewLine + "Do you want to try it anyway? (could give bad results)", "Go on?", MessageType.Warning, ButtonsType.YesNo); } else { goto default; } break; case InfoType.OpenImgError: result = MessageBox.Show("Couldn´t Open Preview Image", MessageType.Error, ButtonsType.Ok); InfoLabel.Text = "Couldn´t Open Preview Image"; break; case InfoType.PPRemoveError: result = MessageBox.Show("Couldn´t remove PP3 File(s)!", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Couldn´t remove PP3 File(s)!"; break; case InfoType.ThumbRemoveError: result = MessageBox.Show("Couldn´t remove Thumb(s)!", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Couldn´t remove Thumb(s)!"; break; case InfoType.PPWriteError: result = MessageBox.Show("Couldn´t write new PP3 File(s)!"); InfoLabel.Text = "Couldn´t write new PP3 File(s)!"; break; case InfoType.InvalidOS: result = MessageBox.Show("Operating System is not supported!", MessageType.Error, ButtonsType.Ok); InfoLabel.Text = "Operating System is not supported!"; break; case InfoType.ProgramNotFound: switch (level) { case 0: result = MessageBox.Show("Couldn´t find Rawtherapee!" + Environment.NewLine + "Please enter path to Rawtherapee in the Settings.", MessageType.Warning, ButtonsType.Ok); InfoLabel.Text = "Couldn´t find Rawtherapee!"; break; case 1: result = MessageBox.Show("Couldn´t find Lightroom!" + Environment.NewLine + "Please enter path to Lightroom in the Settings.", MessageType.Warning, ButtonsType.Ok); InfoLabel.Text = "Couldn´t find Lightroom!"; break; case 2: result = MessageBox.Show("Couldn´t find Exiftool!" + Environment.NewLine + "Please put Exiftool into the programs folder!", MessageType.Warning, ButtonsType.Ok); InfoLabel.Text = "Couldn´t find Exiftool!"; break; default: goto default; } break; case InfoType.MoveFolderError: result = MessageBox.Show("Couldn´t move folder!", MessageType.Error, ButtonsType.Ok); InfoLabel.Text = "Couldn´t move folder!"; break; case InfoType.RTWorking: switch (level) { case 0: InfoLabel.Text = "Raw Therapee is working!"; break; case 1: InfoLabel.Text = "Raw Therapee has finished"; break; case 2: InfoLabel.Text = "Cancelled RawTherapee editing!"; break; case 3: InfoLabel.Text = "RawTherapee closed before finishing!"; break; case 4: InfoLabel.Text = "Brightness Preview rendered!"; break; default: goto default; } break; case InfoType.ExiftoolWorking: switch (level) { case 0: InfoLabel.Text = "Getting Thumbs!"; break; case 1: InfoLabel.Text = "Getting Camera Data!"; break; case 2: InfoLabel.Text = "Getting Thumbs got Cancelled!"; break; case 3: InfoLabel.Text = "Couldn´t get Thumbs!"; CalculateButton.Sensitive = false; break; case 4: InfoLabel.Text = "Got Data!"; break; default: goto default; } break; case InfoType.NewProject: InfoLabel.Text = "New Project created!"; break; case InfoType.Saving: switch (level) { case 0: InfoLabel.Text = "Saving Project!"; break; case 1: InfoLabel.Text = "Project Saved!"; break; } break; case InfoType.Opening: switch (level) { case 0: InfoLabel.Text = "Opening Project!"; break; case 1: InfoLabel.Text = "Project successfully opened!"; break; } break; case InfoType.IsBusy: switch (level) { case 0: result = MessageBox.Show("DeSERt is still busy!" + Environment.NewLine + "Do you want to quit anyway?", MessageType.Warning, ButtonsType.YesNo); InfoLabel.Text = "DeSERt is currently busy!"; break; case 1: InfoLabel.Text = "DeSERt is currently busy!"; break; } break; case InfoType.InvalidNumber: InfoLabel.Text = "Please enter a valid number!"; break; case InfoType.HighLowValue: InfoLabel.Text = "Value too high or low!"; break; case InfoType.Default: InfoLabel.Text = "Ready to do Work!"; break; case InfoType.NotCalculated: result = MessageBox.Show("The brightness of the images is not calculated yet!", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Brightness not calculated yet!"; break; case InfoType.TooDark: result = MessageBox.Show("One or more Images were too dark to calculate a brightness change!", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Brightness couldn´t get calculated!"; break; case InfoType.LongCommand: switch (level) { case 0: result = MessageBox.Show("Command is too long, RT will abort!" + Environment.NewLine + "Do you want to keep the PP3 files and start RT manually?", "Command Problem", MessageType.Question, ButtonsType.YesNo); break; case 1: result = MessageBox.Show("Command is too long, can´t start rendering preview!" + Environment.NewLine + "Select fewer images please.", "Command Problem", MessageType.Info, ButtonsType.Ok); break; } break; case InfoType.FolderExists: switch (level) { case 0: result = MessageBox.Show("There are files in the selected Folder!" + Environment.NewLine + "Do you want to delete them?", MessageType.Question, ButtonsType.YesNo); break; case 1: result = MessageBox.Show("Folder does not exist!", MessageType.Error, ButtonsType.Ok); break; } break; case InfoType.SaveQuestion: result = MessageBox.Show("Do you want to save?" + Environment.NewLine + "This Project will be lost otherwise!", "Save?", MessageType.Question, ButtonsType.YesNo, true); break; case InfoType.Filterset: switch (level) { case 0: InfoLabel.Text = "Opened Filterset!"; break; case 1: InfoLabel.Text = "Removed Filterset!"; break; } break; case InfoType.Darkframe: switch (level) { case 0: InfoLabel.Text = "Opened Darkframe!"; break; case 1: InfoLabel.Text = "Removed Darkframe!"; break; } break; case InfoType.Keyframe: switch (level) { case 0: InfoLabel.Text = "Added Keyframe!"; break; case 1: InfoLabel.Text = "Removed Keyframe!"; break; } break; case InfoType.InconsistentCurve: result = MessageBox.Show("There were different Curvetypes in the PP3-Keyframes!" + Environment.NewLine + "Please use only one type of Curve for each Value.", MessageType.Info, ButtonsType.Ok); InfoLabel.Text = "Curvetypes were inconsistent!"; break; case InfoType.PreviewCalc: InfoLabel.Text = "Rendering Brightness Preview!"; break; case InfoType.FileRemoveError: result = MessageBox.Show("Couldn´t remove file(s)!" + Environment.NewLine + "Please remove them manually.", MessageType.Error, ButtonsType.Ok); break; default: result = MessageBox.Show("Something strange, yet unknown happened!", MessageType.Warning, ButtonsType.Ok); InfoLabel.Text = "Something strange, yet unknown happened!"; break; } return result; }
public string get_underlyingGreekPositionInfo(int underCount, InfoType infoType) { try { string vba_desc = ResultVM_.Excel_greekResultViewModel_.Excel_greekUnderlyingViewModel_[underCount].vba_description_greekPositionCalc(ResultVM_.Notional_); return this.infoParsing(vba_desc, infoType); } catch (Exception e) { return "not implemented : " + e.Message; } }
public string get_cashFlowInfo(int cashFlowCount, InfoType infoType) { try { string vba_desc = ResultVM_.Excel_cashFlowsResultViewModel_.Excel_cashFlowResultViewModel_[cashFlowCount].vba_description(); return this.infoParsing(vba_desc, infoType); } catch (Exception e) { return "not implemented : " + e.Message; } }
public void SetInfoMessage(string message, InfoType type) { MainNewsContainer.Options.InfoType = type; MainNewsContainer.Options.InfoMessageText = message; }
public InfoOutputEventArgs(InfoType infoType) { InfoType = infoType; }
private string GridUserInfo(InfoType type, string key) { string retval = String.Empty; IConfigSource config = m_ScriptEngine.ConfigSource; string url = null; IConfig gridInfoConfig = config.Configs["GridInfo"]; if (gridInfoConfig != null) url = gridInfoConfig.GetString("GridInfoURI", String.Empty); if (String.IsNullOrEmpty(url)) return "Configuration Error!"; string verb ="/json_grid_info"; OSDMap json = new OSDMap(); OSDMap info = WebUtil.GetFromService(String.Format("{0}{1}",url,verb), 3000); if (info["Success"] != true) return "Get GridInfo Failed!"; json = (OSDMap)OSDParser.DeserializeJson(info["_RawResult"].AsString()); switch (type) { case InfoType.Nick: retval = json["gridnick"]; break; case InfoType.Name: retval = json["gridname"]; break; case InfoType.Login: retval = json["login"]; break; case InfoType.Home: retval = json["home"]; break; case InfoType.Custom: retval = json[key]; break; default: retval = "error"; break; } return retval; }
public string get_valueInfo(ResultSide side, InfoType infoType) { try { string vba_desc = ""; if (side == ResultSide.Pay) { vba_desc = ResultVM_.vba_description(1); } else if (side == ResultSide.Receive) { vba_desc = ResultVM_.vba_description(2); } else { vba_desc = ResultVM_.vba_description(0); } return this.infoParsing(vba_desc, infoType); } catch (Exception e) { return "not implemented : " + e.Message; } }