public WebMethodAttribute(bool enableSession, System.EnterpriseServices.TransactionOption transactionOption, int cacheDuration, bool bufferResponse) { this.EnableSession = enableSession; this.transactionOption = (int)transactionOption; this.transactionOptionSpecified = true; this.CacheDuration = cacheDuration; this.BufferResponse = bufferResponse; }
public ServiceInfo(Guid clsid, System.ServiceModel.Configuration.ServiceElement service, ComCatalogObject application, ComCatalogObject classObject, System.ServiceModel.ComIntegration.HostingMode hostingMode) { this.service = service; this.clsid = clsid; this.appid = Fx.CreateGuid((string) application.GetValue("ID")); this.partitionId = Fx.CreateGuid((string) application.GetValue("AppPartitionID")); this.bitness = (System.ServiceModel.ComIntegration.Bitness) classObject.GetValue("Bitness"); this.transactionOption = (System.EnterpriseServices.TransactionOption) classObject.GetValue("Transaction"); this.hostingMode = hostingMode; this.managedType = TypeCacheManager.ResolveClsidToType(clsid); this.serviceName = application.Name + "." + classObject.Name; this.udts = new Dictionary<Guid, List<Type>>(); COMAdminIsolationLevel level = (COMAdminIsolationLevel) classObject.GetValue("TxIsolationLevel"); switch (level) { case COMAdminIsolationLevel.Any: this.isolationLevel = System.Transactions.IsolationLevel.Unspecified; break; case COMAdminIsolationLevel.ReadUncommitted: this.isolationLevel = System.Transactions.IsolationLevel.ReadUncommitted; break; case COMAdminIsolationLevel.ReadCommitted: this.isolationLevel = System.Transactions.IsolationLevel.ReadCommitted; break; case COMAdminIsolationLevel.RepeatableRead: this.isolationLevel = System.Transactions.IsolationLevel.RepeatableRead; break; case COMAdminIsolationLevel.Serializable: this.isolationLevel = System.Transactions.IsolationLevel.Serializable; break; default: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ListenerInitFailed(System.ServiceModel.SR.GetString("InvalidIsolationLevelValue", new object[] { this.clsid, level }))); } switch (((COMAdminThreadingModel) classObject.GetValue("ThreadingModel"))) { case COMAdminThreadingModel.Apartment: case COMAdminThreadingModel.Main: this.threadingModel = System.ServiceModel.ComIntegration.ThreadingModel.STA; this.objectPoolingEnabled = false; break; default: this.threadingModel = System.ServiceModel.ComIntegration.ThreadingModel.MTA; this.objectPoolingEnabled = (bool) classObject.GetValue("ObjectPoolingEnabled"); break; } if (this.objectPoolingEnabled) { this.maxPoolSize = (int) classObject.GetValue("MaxPoolSize"); } else { this.maxPoolSize = 0; } if (((bool) application.GetValue("ApplicationAccessChecksEnabled")) && ((bool) classObject.GetValue("ComponentAccessChecksEnabled"))) { this.checkRoles = true; } ComCatalogCollection collection = classObject.GetCollection("RolesForComponent"); this.componentRoleMembers = CatalogUtil.GetRoleMembers(application, collection); this.contracts = new List<ContractInfo>(); ComCatalogCollection catalogs2 = classObject.GetCollection("InterfacesForComponent"); foreach (ServiceEndpointElement element in service.Endpoints) { ContractInfo item = null; if (element.Contract != "IMetadataExchange") { Guid guid; if (DiagnosticUtility.Utility.TryCreateGuid(element.Contract, out guid)) { bool flag3 = false; foreach (ContractInfo info2 in this.contracts) { if (guid == info2.IID) { flag3 = true; break; } } if (flag3) { continue; } ComCatalogCollection.Enumerator enumerator = catalogs2.GetEnumerator(); while (enumerator.MoveNext()) { Guid guid2; ComCatalogObject current = enumerator.Current; if (DiagnosticUtility.Utility.TryCreateGuid((string) current.GetValue("IID"), out guid2) && (guid2 == guid)) { item = new ContractInfo(guid, element, current, application); break; } } } if (item == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ListenerInitFailed(System.ServiceModel.SR.GetString("EndpointNotAnIID", new object[] { clsid.ToString("B").ToUpperInvariant(), element.Contract }))); } this.contracts.Add(item); } } }
public WebMethodAttribute(bool enableSession, System.EnterpriseServices.TransactionOption transactionOption) : this() { this.EnableSession = enableSession; this.transactionOption = (int)transactionOption; this.transactionOptionSpecified = true; }