// Generates a new receipt number based on the receipt number // stored by the Shared Property Manager (SPM) public int GetNextReceiptNumber() { bool groupExists, propertyExists; int nextReceiptNumber = 0; PropertyLockMode lockMode = PropertyLockMode.SetGet; PropertyReleaseMode releaseMode = PropertyReleaseMode.Standard; // <snippet1> // Create a shared property group manager. SharedPropertyGroupManager groupManager = new SharedPropertyGroupManager(); // </snippet1> // <snippet21> // <snippet2> // Create a shared property group. SharedPropertyGroup group = groupManager.CreatePropertyGroup("Receipts", ref lockMode, ref releaseMode, out groupExists); // </snippet2> // Create a shared property. SharedProperty ReceiptNumber; ReceiptNumber = group.CreateProperty("ReceiptNumber", out propertyExists); // </snippet21> // <snippet3> // Retrieve the value from shared property, and increment the shared // property value. nextReceiptNumber = (int)ReceiptNumber.Value; ReceiptNumber.Value = nextReceiptNumber + 1; // </snippet3> // Return nextReceiptNumber return(nextReceiptNumber); }
/// <include file='doc\SharedProperties.uex' path='docs/doc[@for="SharedPropertyGroupManager.CreatePropertyGroup"]/*' /> public SharedPropertyGroup CreatePropertyGroup(String name, ref PropertyLockMode dwIsoMode, ref PropertyReleaseMode dwRelMode, out bool fExist) { return(new SharedPropertyGroup(_ex.CreatePropertyGroup(name, ref dwIsoMode, ref dwRelMode, out fExist))); }
// Find or create a shared property group. public SharedPropertyGroup CreatePropertyGroup (String name, ref PropertyLockMode dwIsoMode, ref PropertyReleaseMode dwRelMode, out bool fExist) { SharedPropertyGroup group; group = (SharedPropertyGroup)(table[name]); if(group != null) { fExist = true; return group; } group = new SharedPropertyGroup(); table[name] = group; fExist = false; return group; }
// Find or create a shared property group. public SharedPropertyGroup CreatePropertyGroup (String name, ref PropertyLockMode dwIsoMode, ref PropertyReleaseMode dwRelMode, out bool fExist) { SharedPropertyGroup group; group = (SharedPropertyGroup)(table[name]); if (group != null) { fExist = true; return(group); } group = new SharedPropertyGroup(); table[name] = group; fExist = false; return(group); }
public SharedPropertyGroup CreatePropertyGroup (string name, ref PropertyLockMode dwIsoMode, ref PropertyReleaseMode dwRelMode, out bool fExist) { throw new NotImplementedException (); }
// Methods public SharedPropertyGroup CreatePropertyGroup(string name, PropertyLockMode& dwIsoMode, PropertyReleaseMode& dwRelModeout , System.Boolean& fExist) { }
// Methods public SharedPropertyGroup CreatePropertyGroup(string name, PropertyLockMode& dwIsoMode, PropertyReleaseMode& dwRelModeout, System.Boolean& fExist) { }