DeterministicGuid( string input) { // ref: http://geekswithblogs.net/EltonStoneman/archive/2008/06/26/generating-deterministic-guids.aspx // use MD5 hash to get a 16-byte hash of the string var provider = new System.Security.Cryptography.MD5CryptoServiceProvider(); var inputBytes = System.Text.Encoding.Default.GetBytes(input); var hashBytes = provider.ComputeHash(inputBytes); // generate a guid from the hash var hashGuid = new System.Guid(hashBytes); this.Guid = hashGuid; }
/// <summary> /// Constructor. /// </summary> /// <param name="source">Source.</param> /// <param name="displayName">Display name.</param> public SearchSource(SearchSourceEnum source, string displayName) { this.Source = source; this.DisplayName = displayName; this.id = System.Guid.NewGuid(); }
private void frame_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { // Warning!!: Keep these values in sync with the .vsct file const string guidVSPackageContextMenuCmdSet = "c1a3a312-e25a-4cd1-b557-011428323a99"; const int MyContextMenuId = 0x0200; System.IServiceProvider serviceProvider; IVsUIShell uiShell; System.Guid contextMenuGuid = new System.Guid(guidVSPackageContextMenuCmdSet); System.Windows.Point relativePoint; System.Windows.Point screenPoint; POINTS point; POINTS[] points; if (e.ChangedButton == System.Windows.Input.MouseButton.Right) { serviceProvider = (System.IServiceProvider)m_package; uiShell = serviceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell; if (uiShell != null) { relativePoint = e.GetPosition(this); screenPoint = this.PointToScreen(relativePoint); point = new POINTS(); point.x = (short)screenPoint.X; point.y = (short)screenPoint.Y; points = new[] { point }; // TODO: error handling uiShell.ShowContextMenu(0, ref contextMenuGuid, MyContextMenuId, points, null); } } }
/// <summary> /// Constructor. /// </summary> /// <param name="criteria">Criteria.</param> /// <param name="displayName">Display name.</param> public SearchCriteria(SearchCriteriaEnum criteria, string displayName) { this.Criteria = criteria; this.DisplayName = displayName; this.id = System.Guid.NewGuid(); }
public CSBuildProject( string moduleName, string projectPathName, Bam.Core.PackageIdentifier packageId, Bam.Core.ProxyModulePath proxyPath) { this.ProjectName = moduleName; this.PathName = projectPathName; this.PackageDirectory = packageId.Location; if (null != proxyPath) { this.PackageDirectory = proxyPath.Combine(packageId.Location); } var packagePath = this.PackageDirectory.GetLocations()[0].AbsolutePath; var isPackageDirAbsolute = Bam.Core.RelativePathUtilities.IsPathAbsolute(packagePath); var kind = isPackageDirAbsolute ? System.UriKind.Absolute : System.UriKind.Relative; if (packagePath[packagePath.Length - 1] == System.IO.Path.DirectorySeparatorChar) { this.PackageUri = new System.Uri(packagePath, kind); } else { this.PackageUri = new System.Uri(packagePath + System.IO.Path.DirectorySeparatorChar, kind); } this.ProjectGuid = new DeterministicGuid(this.PathName).Guid; }
public ClusterConditions(double clusterRadius, float MaxDistanceFromBot, int MinimumUnitCount, bool IgnoreNonTargetableUnits, double DotDPSRatio=0.00) { ClusterDistance=clusterRadius; MaximumDistance=MaxDistanceFromBot; MinimumUnits=MinimumUnitCount; IgnoreNonTargetable=IgnoreNonTargetableUnits; DOTDPSRatio=DotDPSRatio; GUID=System.Guid.NewGuid(); }
public ClusterConditions(double clusterRadius, float MaxDistanceFromBot, int MinimumUnitCount, bool IgnoreNonTargetableUnits, double DotDPSRatio = 0.00, ClusterProperties clusterflags = ClusterProperties.None, float minDistance = 0f, bool useRadiusDistance = false) { ClusterDistance = clusterRadius; MaximumDistance = MaxDistanceFromBot; MinimumUnits = MinimumUnitCount; IgnoreNonTargetable = IgnoreNonTargetableUnits; DOTDPSRatio = DotDPSRatio; ClusterFlags = clusterflags; MinimumDistance = minDistance; UseRadiusDistance = useRadiusDistance; GUID = System.Guid.NewGuid(); }
public void Should_UpdateProduct_Test() { var productId = new System.Guid("85C2B3A5-117B-8BD2-AA78-39D8D7E7B218"); var model = "Model_01"; using (var _productAppService = IocManager.Instance.Resolve<IProductAppService>()) { var product = _productAppService.Get(productId); product.Model = model; _productAppService.Update(product); var productNew = _productAppService.Get(productId); Assert.IsTrue(productNew.Model == model); } }
public VSong(Song song) { Artist = song.Artist; Extension = song.Extension; Genre = song.Genre; Language = song.Language; SongID = song.SongID; SongName = song.SongName; Intonation = song.SongIntonation; Tone = song.SongTone; Rhythm = song.SongRhythm; FliePath = song.SongPath; SongArtistID = song.SongArtistID; SongLanguageID = song.SongLanguageID; SongGenreID = song.SongGenreID; SongExtensionID = song.SongExtensionID; }
// delete a row in table based on primary key // links: // docLink: http://sql2x.org/documentationLink/8513f38a-4552-4020-95b2-78c872a82ffe public void Delete(System.Guid airportLinkId) { base.Channel.Delete(airportLinkId); }
/// <summary> /// This method is called during deserialization to convert a given value to a specific typed value. /// </summary> /// <param name="serializationContext">The current serialization context instance.</param> /// <param name="modelELement">ModdelElement, to which the property belongs to.</param> /// <param name="propertyName">The Property name, which value is to be converted.</param> /// <param name="value">Value to convert.</param> /// <param name="targetType">Type, the object is to be converted to.</param> /// <param name="isRequired">True if this property is marked as required in the domain model. Can be null.</param> /// <returns>Converted value.</returns> public virtual object ConvertTypedObjectFrom(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement modelELement, string propertyName, object value, System.Type targetType, bool? isRequired) { if (targetType == typeof(global::System.Boolean?) && value is string) { if (System.String.IsNullOrEmpty(value as string)) return null; if (System.String.IsNullOrWhiteSpace(value as string)) return null; try { System.Boolean? d = System.Convert.ToBoolean(value, System.Globalization.CultureInfo.InvariantCulture); return d; } catch (System.Exception ex) { serializationContext.Result.AddMessage(new DslModeling::SerializationMessage( DslModeling::SerializationMessageKind.Error, "Couldnt convert " + value + " to Boolean: " + ex.ToString(), "", 0, 0, null)); } } if (targetType == typeof(global::System.Guid?) && value is string) { if (System.String.IsNullOrEmpty(value as string)) return null; if (System.String.IsNullOrWhiteSpace(value as string)) return null; try { System.Guid? d = new System.Guid(value as string); return d; } catch (System.Exception ex) { serializationContext.Result.AddMessage(new DslModeling::SerializationMessage( DslModeling::SerializationMessageKind.Error, "Couldnt convert " + value + " to Guid: " + ex.ToString(), "", 0, 0, null)); } } if (targetType == typeof(global::System.Int32?)) { return ConvertTypedObjectInt32From(serializationContext, modelELement, propertyName, value, targetType, isRequired); } if (targetType == typeof(global::System.Double?)) { return ConvertTypedObjectDoubleFrom(serializationContext, modelELement, propertyName, value, targetType, isRequired); } if( targetType == typeof(global::Tum.FamilyTreeDSL.Gender?) && value != null ) { string strValue = value.ToString(); switch(strValue) { case "Male": return global::Tum.FamilyTreeDSL.Gender.Male; case "Female": return global::Tum.FamilyTreeDSL.Gender.Female; default: //throw new System.NotSupportedException("Can not convert " + strValue + " to type Gender"); return null; } } return value; }
public System.Threading.Tasks.Task <ApiService.MSubscriberDetailOutput> SelectSubscriberDetailAsync(ApiService.MAuthToken token, System.Guid subscriberId) { return(base.Channel.SelectSubscriberDetailAsync(token, subscriberId)); }
public void WriteString(string propertyName, System.Guid value, bool escape = true) { }
Solution() { // try the VS Express version first, since it's free var registryKey = @"Microsoft\VCExpress\9.0\Projects"; if (Bam.Core.Win32RegistryUtilities.Does32BitLMSoftwareKeyExist(registryKey)) { vsEdition = "Express"; } else { registryKey = @"Microsoft\VisualStudio\9.0\Projects"; if (Bam.Core.Win32RegistryUtilities.Does32BitLMSoftwareKeyExist(registryKey)) { vsEdition = "Professional"; } else { throw new Bam.Core.Exception("VisualStudio C++ 2008 (Express or Professional) was not installed"); } } using (var key = Bam.Core.Win32RegistryUtilities.Open32BitLMSoftwareKey(registryKey)) { if (null == key) { throw new Bam.Core.Exception("VisualStudio C++ {0} 2008 was not installed", vsEdition); } var subKeyNames = key.GetSubKeyNames(); foreach (var subKeyName in subKeyNames) { using (var subKey = key.OpenSubKey(subKeyName)) { var projectExtension = subKey.GetValue("DefaultProjectExtension") as string; if (null != projectExtension) { if (projectExtension == "vcproj") { ProjectTypeGuid = new System.Guid(subKeyName); break; } } var defaultValue = subKey.GetValue("") as string; if (null != defaultValue) { if ("Solution Folder Project" == defaultValue) { SolutionFolderTypeGuid = new System.Guid(subKeyName); } } } } } if (0 == ProjectTypeGuid.CompareTo(System.Guid.Empty)) { throw new Bam.Core.Exception("Unable to locate VisualC project GUID for VisualStudio 2008 {0}", vsEdition); } #if false // Note: do this instead of (null == Guid) to satify the Mono compiler // see CS0472, and something about struct comparisons if ((System.Nullable<System.Guid>)null == (System.Nullable<System.Guid>)ProjectTypeGuid) { throw new Bam.Core.Exception("Unable to locate VisualC project GUID for VisualStudio 2008"); } #endif }
public System.Threading.Tasks.Task <ApiService.MResult> UpdateSubscriberPriceByIdandDateAsync(ApiService.MAuthToken token, System.Guid serviceSubscriberId, System.DateTime validFrom, double newPrice, string description) { return(base.Channel.UpdateSubscriberPriceByIdandDateAsync(token, serviceSubscriberId, validFrom, newPrice, description)); }
public CustomizeFileNameOrc(System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession session, Microsoft.BizTalk.XLANGs.BTXEngine.BTXEvents tracker) : base(instanceId, session, "CustomizeFileNameOrc", tracker) { ConstructorHelper(); }
/// <summary> /// Gets the crypto. /// </summary> private void GetCrypto() { this.LogTaskMessage("Getting Cryptographically Secure GUID"); byte[] data = new byte[16]; using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider()) { rng.GetBytes(data); this.internalGuid = new System.Guid(data); } }
public override string Run(ArrayList arguments) { //if (arguments.Count != 2) return "Wrong number of arguments"; string sourceName = (string)arguments [0]; string targetName = (string)arguments [1]; //also targetStartName string actionName = (string)arguments [2]; string targetEndName = (string)arguments [3]; // Get the appropriate agent and gameobject OCActionController actionController = null; OCActionController[] actionControllers = Object.FindObjectsOfType(typeof(OCActionController)) as OCActionController[]; foreach (OCActionController ac in actionControllers) { if (ac.gameObject.name == sourceName) { actionController = ac; } } if (actionController == null) { return("No Action Controller script on agent \"" + sourceName + "\"."); } if (actionController.gameObject.tag == "Player") { return("Agent \"" + sourceName + "\" is controlled by the player!"); } OCID sourceID = actionController.ID; // Get the object // if objectName is "self" then assume the script is on the agent OCID targetStartID; if (targetName != null && targetName != "self") { GameObject target = GameObject.Find(targetName); if (target == null) { return("No object called " + targetName); } targetStartID = target.GetComponent <OCActionController>().ID; } else { targetStartID = actionController.ID; } OCID targetEndID; if (targetEndName != null && targetEndName != "self") { GameObject targetEnd = GameObject.Find(targetEndName); if (targetEnd == null) { return("No object called " + targetEndName); } targetEndID = targetEnd.GetComponent <OCActionController>().ID; } else { targetEndID = actionController.ID; } // Get the action from the Action Controller OCAction action = actionController.GetComponentsInChildren <OCAction>() .Where(a => a.name == actionName) .Cast <OCAction>() .FirstOrDefault() ; if (action == null) { return("No action called \"" + actionName + "\"."); } actionController.StartAction(action, sourceID, targetStartID, targetEndID); // System.Reflection.ParameterInfo[] pinfo = action.pinfo; //getFreeArguments(); // // if (pinfo.Length > 0) { // ArrayList args = new ArrayList (); // int i = 0; // int jmod = 3; // if (action.componentType == typeof(Avatar)) { // // Check we don't have too many arguments // if (pinfo.Length < arguments.Count - 3) // return "Expected " + pinfo.Length + " arguments, got " + (arguments.Count - 3) + "."; // } else { // // Check we don't have too many arguments, we don't need to // // provide the avatar // if (pinfo.Length - 1 < arguments.Count - 3) // return "Expected " + (pinfo.Length - 1) + " arguments, got " + (arguments.Count - 3) + "."; // i = 1; // jmod = 2; // } // // ignore last parameter if action uses a callback // int lengthModififer = 0; // if (action.usesCallback) // lengthModififer = 1; // for (; i < pinfo.Length-lengthModififer; i++) { // // do type checking and conversion from strings to the expected type // // ignore 3 console arguments: the action name, avatar name, // // and the object with the action (from console arguments) // int j = i + jmod; // if (j >= arguments.Count) { // // Not enough arguments, so must be a default argument // if (!pinfo [i].IsOptional) // return "Missing parameter " + pinfo [i].Name + " is not optional."; // args.Add (pinfo [i].DefaultValue); // } else { // arguments [j] = ((string)arguments [j]).Replace ("\"", ""); // // Depending on the expected type we convert it differently // if (pinfo [i].ParameterType == typeof(GameObject)) { // // Parameters that are gameobjects... we just search for // // the name. // args.Add (GameObject.Find ((string)arguments [j])); // if (((GameObject)args [i]) == null) { // return "No game object called \"" + (string)arguments [j] + "\"."; // } // } else if (pinfo [i].ParameterType == typeof(Avatar)) { // // Parameters that are Avatars... we just search for // // the name. // args.Add (OCARepository.GetOCA ((string)arguments [j]).GetComponent ("Avatar") as Avatar); // if ((Avatar)args [i] == null) { // return "No Avatar called \"" + (string)arguments [j] + "\"."; // } // } else if (pinfo [i].ParameterType == typeof(int)) { // try { // args.Add (System.Int32.Parse ((string)arguments [j])); // } catch (System.FormatException ex) { // return "Error parsing string as int32: " + (string)arguments [j]; // } // } else if (pinfo [i].ParameterType == typeof(float)) { // try { // args.Add (float.Parse ((string)arguments [j])); // } catch (System.FormatException ex) { // return "Error parsing string as float: " + (string)arguments [j]; // } // } else if (pinfo [i].ParameterType == typeof(string)) { // args.Add ((string)arguments [j]); // } else { // return "Method " + actionName + " at slot " + i + " has argument of unsupported type \"" + pinfo [i].ParameterType + // "\". Ask Joel how to implement support or ask him nicely to do it ;-)."; // } // } // } // // even if this action supports callbacks, we don't pass our actionComplete callback because // // it's already called by the global event (which the Console class listens for). // AM.doAction (actionObjectID, actionName, args); // } return("Told avatar \"" + sourceName + "\" to do action \"" + actionName + "\""); }
public System.Data.DataTable? GetOleDbSchemaTable(System.Guid schema, object?[]? restrictions) { throw null; }
public Product_details(int callIndex, System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXService parent) : base(callIndex, instanceId, parent, "Product_details") { ConstructorHelper(); }
public Product_details(System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession session, Microsoft.BizTalk.XLANGs.BTXEngine.BTXEvents tracker) : base(instanceId, session, "Product_details", tracker) { ConstructorHelper(); }
public void WriteStringValue(System.Guid value) { }
public RunningObject(string name, object obj, System.Guid classid) { this._display_name = name; this._object = obj; this._classid = classid; }
public CustomizeFileNameOrc(int callIndex, System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXService parent) : base(callIndex, instanceId, parent, "CustomizeFileNameOrc") { ConstructorHelper(); }
// fetch all rows matching foreign key: UserId // links: // docLink: http://sql2x.org/documentationLink/7f3c31d9-2d99-4f93-b9b1-b866fa1c64dc public List <SolutionNorSolutionPort.BusinessLogicLayer.CrudeAirportLinkContract> FetchByUserId(System.Guid userId) { return(base.Channel.FetchByUserId(userId)); }
// fetch all from table into new List of class instances, filtered by any column // links: // docLink: http://sql2x.org/documentationLink/db27658d-4d23-46d7-9970-7bbaef8634b0 public List <CrudeFinancialBankAccountNumberTypeRefModel> FetchWithFilter(string financialBankAccountNumberTypeRcd, string financialBankAccountNumberTypeName, System.Guid userId, System.DateTime dateTime) { var list = new List <CrudeFinancialBankAccountNumberTypeRefModel>(); List <CrudeFinancialBankAccountNumberTypeRefData> dataList = CrudeFinancialBankAccountNumberTypeRefData.FetchWithFilter(financialBankAccountNumberTypeRcd, financialBankAccountNumberTypeName, userId, dateTime); foreach (CrudeFinancialBankAccountNumberTypeRefData data in dataList) { var crudeFinancialBankAccountNumberTypeRefBusinessModel = new CrudeFinancialBankAccountNumberTypeRefModel(); DataToModel(data, crudeFinancialBankAccountNumberTypeRefBusinessModel); list.Add(crudeFinancialBankAccountNumberTypeRefBusinessModel); } return(list); }
/** Deserializes all graphs and also user connections */ public void DeserializeGraphsPart(AstarSerializer serializer) { if (serializer.error != AstarSerializer.SerializerError.Nothing) { data_backup = (serializer.readerStream.BaseStream as System.IO.MemoryStream).ToArray (); Debug.Log ("Error encountered : "+serializer.error+"\nWriting data to AstarData.data_backup"); graphs = new NavGraph[0]; return; } try { int count1 = serializer.readerStream.ReadInt32 (); int count2 = serializer.readerStream.ReadInt32 (); if (count1 != count2) { Debug.LogError ("Data is corrupt ("+count1 +" != "+count2+")"); graphs = new NavGraph[0]; return; } NavGraph[] _graphs = new NavGraph[count1]; //graphs = new NavGraph[count1]; for (int i=0;i<_graphs.Length;i++) { if (!serializer.MoveToAnchor ("Graph"+i)) { Debug.LogError ("Couldn't find graph "+i+" in the data"); Debug.Log ("Logging... "+serializer.anchors.Count); foreach (KeyValuePair<string,int> value in serializer.anchors) { Debug.Log ("KeyValuePair "+value.Key); } _graphs[i] = null; continue; } string graphType = serializer.readerStream.ReadString (); System.Guid guid = new System.Guid (serializer.readerStream.ReadString ()); //Search for existing graphs with the same GUID. If one is found, that means that we are loading another version of that graph //Use that graph then and just load it with some new settings NavGraph existingGraph = GuidToGraph (guid); if (existingGraph != null) { _graphs[i] = existingGraph; //Replace //graph.guid = new System.Guid (); //serializer.loadedGraphGuids[i] = graph.guid.ToString (); } else { _graphs[i] = CreateGraph (graphType); } NavGraph graph = _graphs[i]; if (graph == null) { Debug.LogError ("One of the graphs saved was of an unknown type, the graph was of type '"+graphType+"'"); data_backup = data; graphs = new NavGraph[0]; return; } _graphs[i].guid = guid; //Set an unique prefix for all variables in this graph serializer.sPrefix = i.ToString (); serializer.DeSerializeSettings (graph,active); } serializer.SetUpGraphRefs (_graphs); for (int i=0;i<_graphs.Length;i++) { NavGraph graph = _graphs[i]; if (serializer.MoveToAnchor ("GraphNodes_Graph"+i)) { serializer.mask = serializer.readerStream.ReadInt32 (); serializer.sPrefix = i.ToString ()+"N"; serializer.DeserializeNodes (graph,_graphs,i,active); serializer.sPrefix = ""; } //Debug.Log ("Graph "+i+" has loaded "+(graph.nodes != null ? graph.nodes.Length.ToString () : "null")+" nodes"); } userConnections = serializer.DeserializeUserConnections (); //Remove null graphs List<NavGraph> tmp = new List<NavGraph>(_graphs); for (int i=0;i<_graphs.Length;i++) { if (_graphs[i] == null) { tmp.Remove (_graphs[i]); } } graphs = tmp.ToArray (); } catch (System.Exception e) { data_backup = (serializer.readerStream.BaseStream as System.IO.MemoryStream).ToArray (); Debug.LogWarning ("Deserializing Error Encountered - Writing data to AstarData.data_backup:\n"+e.ToString ()); graphs = new NavGraph[0]; return; } }
// fetch by Search key into current object // links: // crud definition: https://en.wikipedia.org/wiki/Create,_read,_update_and_delete // docLink: http://sql2x.org/documentationLink/87368fa6-b618-4f0c-acbb-1fc4e273bb2d // parameters: // UserId: key of table CrudeFinancialBankAccountNumberTypeRefData public List <CrudeFinancialBankAccountNumberTypeRefModel> FetchByUserId(System.Guid userId) { return(DataListToModelList(CrudeFinancialBankAccountNumberTypeRefData.FetchByUserId(userId))); }
// fetch one row by the tables primary key // links: // docLink: http://sql2x.org/documentationLink/0bf226bb-0d8e-4930-90b9-d0e53a1f9c2a public SolutionNorSolutionPort.BusinessLogicLayer.CrudeAirportLinkContract FetchByAirportLinkId(System.Guid airportLinkId) { return(base.Channel.FetchByAirportLinkId(airportLinkId)); }
public string GetMainDocument(int idDocumentSeriesItem, System.Guid idDoc, bool pdf) { return(base.Channel.GetMainDocument(idDocumentSeriesItem, idDoc, pdf)); }
/// <summary> /// This method is called during deserialization to convert a given value to a specific typed value. /// </summary> /// <param name="serializationContext">The current serialization context instance.</param> /// <param name="modelELement">ModdelElement, to which the property belongs to.</param> /// <param name="propertyName">The Property name, which value is to be converted.</param> /// <param name="value">Value to convert.</param> /// <param name="targetType">Type, the object is to be converted to.</param> /// <param name="isRequired">True if this property is marked as required in the domain model. Can be null.</param> /// <returns>Converted value.</returns> public virtual object ConvertTypedObjectFrom(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement modelELement, string propertyName, object value, System.Type targetType, bool? isRequired) { if (targetType == typeof(global::System.Boolean?) && value is string) { if (System.String.IsNullOrEmpty(value as string)) return null; if (System.String.IsNullOrWhiteSpace(value as string)) return null; try { System.Boolean? d = System.Convert.ToBoolean(value, System.Globalization.CultureInfo.InvariantCulture); return d; } catch (System.Exception ex) { serializationContext.Result.AddMessage(new DslModeling::SerializationMessage( DslModeling::SerializationMessageKind.Error, "Couldnt convert " + value + " to Boolean: " + ex.ToString(), "", 0, 0, null)); } } if (targetType == typeof(global::System.Guid?) && value is string) { if (System.String.IsNullOrEmpty(value as string)) return null; if (System.String.IsNullOrWhiteSpace(value as string)) return null; try { System.Guid? d = new System.Guid(value as string); return d; } catch (System.Exception ex) { serializationContext.Result.AddMessage(new DslModeling::SerializationMessage( DslModeling::SerializationMessageKind.Error, "Couldnt convert " + value + " to Guid: " + ex.ToString(), "", 0, 0, null)); } } if (targetType == typeof(global::System.Int32?)) { return ConvertTypedObjectInt32From(serializationContext, modelELement, propertyName, value, targetType, isRequired); } if (targetType == typeof(global::Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Html.Html)) { return ConvertTypedObjectHtmlFrom(serializationContext, modelELement, propertyName, value, targetType, isRequired); } if( targetType == typeof(global::Tum.VModellXT.TypStandard?) && value != null ) { string strValue = value.ToString(); switch(strValue) { case "ja": return global::Tum.VModellXT.TypStandard.Ja; case "nein": return global::Tum.VModellXT.TypStandard.Nein; default: //throw new System.NotSupportedException("Can not convert " + strValue + " to type TypStandard"); return null; } } if (targetType == typeof(global::System.Double?)) { return ConvertTypedObjectDoubleFrom(serializationContext, modelELement, propertyName, value, targetType, isRequired); } if( targetType == typeof(global::Tum.VModellXT.DomainEnumeration1?) && value != null ) { string strValue = value.ToString(); switch(strValue) { case "EnumerationLiteral1": return global::Tum.VModellXT.DomainEnumeration1.EnumerationLiteral1; case "EnumerationLiteral2": return global::Tum.VModellXT.DomainEnumeration1.EnumerationLiteral2; default: //throw new System.NotSupportedException("Can not convert " + strValue + " to type DomainEnumeration1"); return null; } } return value; }
public string GetAnnexed(int idDocumentSeriesItem, System.Guid idAnnexed, bool pdf) { return(base.Channel.GetAnnexed(idDocumentSeriesItem, idAnnexed, pdf)); }
private IPAddress Func4(long p1, IntPtr p2, IPAddress p3, Guid p4) { return IPAddress.None; }
public HEU_Task() { _guid = System.Guid.NewGuid(); }
public Document(string/*!*/ name, int lineNumber, DocumentText text, System.Guid documentType, System.Guid language, System.Guid languageVendor) { this.DocumentType = documentType; this.Language = language; this.LanguageVendor = languageVendor; this.LineNumber = lineNumber; this.Name = name; this.Text = text; //^ base(); }
private void OnPowershellGuidReported(object src, System.EventArgs args) { _cmdId = (System.Guid)src; _serverTransportMgr.ReportTransportMgrForCmd(_cmdId, this); this.PowerShellGuidObserver -= this.OnPowershellGuidReported; }
public void GetClassID(out System.Guid classID) { classID = new System.Guid("6B076AA7-4F32-4E70-9C48-8D0B682F7D56"); }
void SendToPlayer(System.Guid msgId, byte[] data) { editorConnection.Send(msgId, data); }
/// <summary> /// This method is called during deserialization to convert a given value to a specific typed value. /// </summary> /// <param name="serializationContext">The current serialization context instance.</param> /// <param name="modelELement">ModdelElement, to which the property belongs to.</param> /// <param name="propertyName">The Property name, which value is to be converted.</param> /// <param name="value">Value to convert.</param> /// <param name="targetType">Type, the object is to be converted to.</param> /// <param name="isRequired">True if this property is marked as required in the domain model. Can be null.</param> /// <returns>Converted value.</returns> public virtual object ConvertTypedObjectFrom(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement modelELement, string propertyName, object value, System.Type targetType, bool? isRequired) { if (targetType == typeof(global::System.Boolean?) && value is string) { if (System.String.IsNullOrEmpty(value as string)) return null; if (System.String.IsNullOrWhiteSpace(value as string)) return null; try { System.Boolean? d = System.Convert.ToBoolean(value, System.Globalization.CultureInfo.InvariantCulture); return d; } catch (System.Exception ex) { serializationContext.Result.AddMessage(new DslModeling::SerializationMessage( DslModeling::SerializationMessageKind.Error, "Couldnt convert " + value + " to Boolean: " + ex.ToString(), "", 0, 0, null)); } } if (targetType == typeof(global::System.Guid?) && value is string) { if (System.String.IsNullOrEmpty(value as string)) return null; if (System.String.IsNullOrWhiteSpace(value as string)) return null; try { System.Guid? d = new System.Guid(value as string); return d; } catch (System.Exception ex) { serializationContext.Result.AddMessage(new DslModeling::SerializationMessage( DslModeling::SerializationMessageKind.Error, "Couldnt convert " + value + " to Guid: " + ex.ToString(), "", 0, 0, null)); } } if (targetType == typeof(global::System.Int32?)) { return ConvertTypedObjectInt32From(serializationContext, modelELement, propertyName, value, targetType, isRequired); } if (targetType == typeof(global::System.Double?)) { return ConvertTypedObjectDoubleFrom(serializationContext, modelELement, propertyName, value, targetType, isRequired); } return value; }
public void SendToPlayer(System.Guid msgId, object serializableObject) { byte[] arrayToSend = serializableObject.SerializeToByteArray(); SendToPlayer(msgId, arrayToSend); }
public void GetGuid(byte[] targetBytes) { System.Guid target = new System.Guid(targetBytes); TestRandom rand = new TestRandom(); rand.ByteArrayQueue.Enqueue(targetBytes); Assert.AreEqual(target, rand.GetGuid()); }
public void Transfer(double pAmount, int pFromAcctNumber, int pToAcctNumber, System.Guid pOrderNumber, string pReturnAddress) { base.Channel.Transfer(pAmount, pFromAcctNumber, pToAcctNumber, pOrderNumber, pReturnAddress); }
public ChildContentProjection(IPageContent pageContent, IChildContent content, IContentAccessor contentAccessor, IEnumerable<ChildContentProjection> childProjections = null, IEnumerable<PageContentProjection> childRegionContentProjections = null) : base(pageContent, content.ChildContent, contentAccessor, childProjections, childRegionContentProjections) { assignmentIdentifier = content.AssignmentIdentifier; }
public System.Transactions.Enlistment EnlistDurable(System.Guid resourceManagerIdentifier, System.Transactions.ISinglePhaseNotification singlePhaseNotification, System.Transactions.EnlistmentOptions enlistmentOptions) { throw null; }
/// <summary> /// Gets this instance. /// </summary> private void Get() { this.LogTaskMessage("Getting random GUID"); this.internalGuid = System.Guid.NewGuid(); }
public bool EnlistPromotableSinglePhase(System.Transactions.IPromotableSinglePhaseNotification promotableSinglePhaseNotification, System.Guid promoterType) { throw null; }
/// <summary> /// Creates the SystemImageList /// </summary> private void create() { // forget last image list if any: hIml = System.IntPtr.Zero; if (isXpOrAbove()) { // Get the System IImageList object from the Shell: System.Guid iidImageList = new System.Guid("46EB5926-582E-4017-9FDF-E8998DAA0950"); int ret = SHGetImageList( (int) size, ref iidImageList, ref iImageList ); // the image list handle is the IUnknown pointer, but // using Marshal.GetIUnknownForObject doesn't return // the right value. It really doesn't hurt to make // a second call to get the handle: SHGetImageListHandle((int) size, ref iidImageList, ref hIml); } else { // Prepare flags: SHGetFileInfoConstants dwFlags = SHGetFileInfoConstants.SHGFI_USEFILEATTRIBUTES | SHGetFileInfoConstants.SHGFI_SYSICONINDEX; if (size == SystemImageListSize.SmallIcons) { dwFlags |= SHGetFileInfoConstants.SHGFI_SMALLICON; } // Get image list SHFILEINFO shfi = new SHFILEINFO(); uint shfiSize = (uint) System.Runtime.InteropServices.Marshal.SizeOf(shfi.GetType()); // Call SHGetFileInfo to get the image list handle // using an arbitrary file: hIml = SHGetFileInfo( ".txt", FILE_ATTRIBUTE_NORMAL, ref shfi, shfiSize, (uint) dwFlags); System.Diagnostics.Debug.Assert((hIml != System.IntPtr.Zero), "Failed to create Image List"); } }
public System.Transactions.Enlistment PromoteAndEnlistDurable(System.Guid resourceManagerIdentifier, System.Transactions.IPromotableSinglePhaseNotification promotableNotification, System.Transactions.ISinglePhaseNotification enlistmentNotification, System.Transactions.EnlistmentOptions enlistmentOptions) { throw null; }
public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // path = /wifi/... //m_log.DebugFormat("[Wifi]: path = {0}", path); //m_log.DebugFormat("[Wifi]: ip address = {0}", httpRequest.RemoteIPEndPoint); //foreach (object o in httpRequest.Query.Keys) // m_log.DebugFormat(" >> {0}={1}", o, httpRequest.Query[o]); httpResponse.ContentType = "text/html"; string resource = GetParam(path); //m_log.DebugFormat("[INVENTORY HANDLER POST]: resource {0}", resource); Request request = RequestFactory.CreateRequest(string.Empty, httpRequest, Localization.GetLanguageInfo(httpRequest.Headers.Get("accept-language"))); Environment env = new Environment(request); string result = string.Empty; if (resource.Equals("/") || resource.Equals(string.Empty)) { StreamReader sr = new StreamReader(requestData); string body = sr.ReadToEnd(); sr.Close(); body = body.Trim(); Dictionary<string, object> postdata = ServerUtils.ParseQueryString(body); string action = postdata.Keys.FirstOrDefault(key => key.StartsWith("action-")); if (action == null) action = string.Empty; else action = action.Substring("action-".Length); string folder = string.Empty; string newFolderName = string.Empty; List<string> nodes = new List<string>(); List<string> types = new List<string>(); if (postdata.ContainsKey("folder")) folder = postdata["folder"].ToString(); if (postdata.ContainsKey("newFolderName")) newFolderName = postdata["newFolderName"].ToString(); foreach (KeyValuePair<string, object> kvp in postdata) { if (kvp.Key.StartsWith("inv-")) { nodes.Add(kvp.Key.Substring(4)); types.Add(kvp.Value.ToString()); } } result = m_WebApp.Services.InventoryPostRequest(env, action, folder, newFolderName, nodes, types); } else if (resource.StartsWith("/upload")) { HttpMultipartParser parser = new HttpMultipartParser(requestData, "datafile"); if (parser.Success) { //string user = HttpUtility.UrlDecode(parser.Parameters["user"]); if (!Directory.Exists(WebAppUtils.UploadPath)) Directory.CreateDirectory(WebAppUtils.UploadPath); string filename = new Guid().ToString().Substring(0, 8) + ".iar"; string pathToFile = System.IO.Path.Combine(WebAppUtils.UploadPath, filename); if (File.Exists(pathToFile)) File.Delete(pathToFile); using (FileStream w = new FileStream(pathToFile, FileMode.CreateNew)) { w.Write(parser.FileContents, 0, parser.FileContents.Length); } result = m_WebApp.Services.InventoryUploadRequest(env, pathToFile); File.Delete(pathToFile); } } return WebAppUtils.StringToBytes(result); }
public System.Threading.Tasks.Task <ApiService.MOperationOutput> DeleteSubscriberAsync(ApiService.MAuthToken token, System.Guid subscriberId) { return(base.Channel.DeleteSubscriberAsync(token, subscriberId)); }
private void MainForm_Load(object sender, System.EventArgs e) { DAL.UnitOfWork unitOfWork = null; try { unitOfWork = new DAL.UnitOfWork(); Models.User user = null; System.Guid sId = new System.Guid ("a1a57f49-51fc-4c4b-8f06-19cd117d5c9e"); // ************************************************** // Get Data // ************************************************** //var users = // unitOfWork.UserRepository // .Get() // .ToList() // ; //var users = // unitOfWork.UserRepository // .Get() // .Where(current => current.IsActive) // .ToList() // ; //var users = // unitOfWork.UserRepository // .GetActiveUsers() // .ToList() // ; var users = unitOfWork.UserRepository .GetActiveUsers() ; // ************************************************** // /Get Data // ************************************************** // ************************************************** // Add New User // ************************************************** unitOfWork = new DAL.UnitOfWork(); user = new Models.User(); user.Id = sId; user.IsActive = true; user.Username = "******"; unitOfWork.UserRepository.Insert(user); unitOfWork.Save(); unitOfWork.Dispose(); unitOfWork = null; // ************************************************** // /Add New User // ************************************************** // ************************************************** // Get And Update // ************************************************** unitOfWork = new DAL.UnitOfWork(); user = unitOfWork.UserRepository .GetById(sId); if (user != null) { user.IsActive = !user.IsActive; unitOfWork.UserRepository.Update(user); unitOfWork.Save(); } unitOfWork.Dispose(); unitOfWork = null; // ************************************************** // /Get And Update // ************************************************** // ************************************************** // Just Update // ************************************************** unitOfWork = new DAL.UnitOfWork(); user = new Models.User(); user.Id = sId; user.Username = "******"; user.IsActive = !user.IsActive; unitOfWork.UserRepository.Update(user); unitOfWork.Save(); unitOfWork.Dispose(); unitOfWork = null; // ************************************************** // /Just Update // ************************************************** // ************************************************** // Get And Delete // ************************************************** unitOfWork = new DAL.UnitOfWork(); user = unitOfWork.UserRepository .GetById(sId); if (user != null) { unitOfWork.UserRepository.Delete(user); unitOfWork.Save(); } unitOfWork.Dispose(); unitOfWork = null; // ************************************************** // /Get And Delete // ************************************************** // ************************************************** // Add Again New User // ************************************************** unitOfWork = new DAL.UnitOfWork(); user = new Models.User(); user.Id = sId; user.IsActive = true; user.Username = "******"; unitOfWork.UserRepository.Insert(user); unitOfWork.Save(); unitOfWork.Dispose(); unitOfWork = null; // ************************************************** // Add New User // ************************************************** // ************************************************** // Just Delete // ************************************************** unitOfWork = new DAL.UnitOfWork(); user = new Models.User(); user.Id = sId; unitOfWork.UserRepository.Delete(user); unitOfWork.Save(); unitOfWork.Dispose(); unitOfWork = null; // ************************************************** // /Just Delete // ************************************************** } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } finally { if (unitOfWork != null) { unitOfWork.Dispose(); unitOfWork = null; } } }
/// <summary> /// Gets the item images by image id of any of the images in the item's collection of images. /// </summary> /// <param name="imageId">The image id.</param> /// <returns></returns> public static List<Commerce.Image> GetImagesByImageId(string imageId) { System.Guid imgId = new System.Guid(imageId); Commerce.Image img = Main.Site.ItemImages.List.Find(delegate(Commerce.Image _img) { return _img.Id == imgId; }); return Commerce.Item.GetItem(img.ItemNumber).Images; }
// ============================================================================================================ #region internal public DiaQGraph() { _ident = System.Guid.NewGuid(); savedIdent = _ident.ToString("N"); }
private void OnPowershellGuidReported(object src, System.EventArgs args) { _cmdId = (System.Guid)src; _serverTransportMgr.ReportTransportMgrForCmd(_cmdId, this); this.PowerShellGuidObserver -= new System.EventHandler(this.OnPowershellGuidReported); }
public void GetClassID(out System.Guid classID) { classID = new System.Guid("3CAE6FA5-A55C-4609-8891-651B577FDA19"); }
// fetch all from table into new List of class instances, filtered by any column // links: // docLink: http://sql2x.org/documentationLink/c10bac90-d91e-47a6-bd52-f537c96471cd public List <SolutionNorSolutionPort.BusinessLogicLayer.CrudeAirportLinkContract> FetchWithFilter(System.Guid airportLinkId, System.Guid airportId, string linkTypeRcd, System.Guid userId, System.DateTime dateTime) { return(base.Channel.FetchWithFilter( airportLinkId: airportLinkId, airportId: airportId, linkTypeRcd: linkTypeRcd, userId: userId, dateTime: dateTime )); }
private void Action4(long p1, IntPtr p2, IPAddress p3, Guid p4) { }
static Solution() { // TODO: this path is for VCSExpress - what about the professional version? using (var key = Bam.Core.Win32RegistryUtilities.Open32BitLMSoftwareKey(@"Microsoft\VCSExpress\8.0\Projects")) { if (null == key) { throw new Bam.Core.Exception("VisualStudio C# Express 2005 was not installed"); } var subKeyNames = key.GetSubKeyNames(); foreach (var subKeyName in subKeyNames) { using (var subKey = key.OpenSubKey(subKeyName)) { var projectExtension = subKey.GetValue("DefaultProjectExtension") as string; if (null != projectExtension) { if (projectExtension == "csproj") { ProjectTypeGuid = new System.Guid(subKeyName); break; } } var defaultValue = subKey.GetValue("") as string; if (null != defaultValue) { if ("Solution Folder Project" == defaultValue) { SolutionFolderTypeGuid = new System.Guid(subKeyName); } } } } } if (0 == ProjectTypeGuid.CompareTo(System.Guid.Empty)) { throw new Bam.Core.Exception("Unable to locate C# project GUID for VisualStudio 2005"); } #if false // Note: do this instead of (null == Guid) to satify the Mono compiler // see CS0472, and something about struct comparisons if ((System.Nullable<System.Guid>)null == (System.Nullable<System.Guid>)ProjectTypeGuid) { throw new Bam.Core.Exception("Unable to locate VisualC project GUID for VisualStudio 2005"); } #endif }
public System.Threading.Tasks.Task <LinkKS.DTO.DTO_LINK_LOG[]> GetListLogAsync(System.Guid linkId) { return(base.Channel.GetListLogAsync(linkId)); }
public void WriteString(System.ReadOnlySpan <char> propertyName, System.Guid value, bool escape = true) { }