コード例 #1
0
        [TestMethod] public void CurrenciesInUseTest()
        {
            Assert.IsInstanceOfType(obj.CurrenciesInUse, typeof(List <CurrencyViewModel>));
            var name = GetMember.Name <CountryViewModel>(x => x.CurrenciesInUse);

            Assert.IsTrue(IsReadOnly.Property <CountryViewModel>(name));
        }
コード例 #2
0
        public void UsedInMedicinesTest()
        {
            Assert.IsInstanceOfType(obj.UsedInMedicines, typeof(List <MedicineViewModel>));
            var name = GetMember.Name <EffectViewModel>(x => x.UsedInMedicines);

            Assert.IsTrue(IsReadOnly.Property <EffectViewModel>(name));
        }
コード例 #3
0
        internal protected virtual bool OnIsReadOnly(Type type, ModifiableEntity entity)
        {
            EntitySettings es = EntitySettings.TryGetC(type);

            if (es != null)
            {
                if (es.OnIsReadonly())
                {
                    return(true);
                }
            }

            if (IsReadOnly != null)
            {
                foreach (var isReadOnly in IsReadOnly.GetInvocationListTyped())
                {
                    if (isReadOnly(type, entity))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #4
0
        public void InProfilesTest()
        {
            Assert.IsInstanceOfType(obj.InProfiles, typeof(List <ProfileViewModel>));
            var name = GetMember.Name <EventViewModel>(x => x.InProfiles);

            Assert.IsTrue(IsReadOnly.Property <EventViewModel>(name));
        }
コード例 #5
0
        public void RegisteredInAddressesTest()
        {
            Assert.IsInstanceOfType(obj.RegisteredInAddresses, typeof(List <GeographicAddressViewModel>));
            var name = GetMember.Name <TelecomAddressViewModel>(x => x.RegisteredInAddresses);

            Assert.IsTrue(IsReadOnly.Property <TelecomAddressViewModel>(name));
        }
コード例 #6
0
        public void UsedInCountriesTest()
        {
            Assert.IsInstanceOfType(obj.UsedInCountries, typeof(List <CountryViewModel>));
            var name = GetMember.Name <CurrencyViewModel>(x => x.UsedInCountries);

            Assert.IsTrue(IsReadOnly.Property <CurrencyViewModel>(name));
        }
コード例 #7
0
        public void ProductsInCatalogueTest()
        {
            Assert.IsInstanceOfType(obj.ProductsInCatalogue, typeof(List <EffectViewModel>));
            var name = GetMember.Name <MedicineViewModel>(x => x.ProductsInCatalogue);

            Assert.IsTrue(IsReadOnly.Property <MedicineViewModel>(name));
        }
コード例 #8
0
ファイル: ByteBuffer.cs プロジェクト: wangweinjcn/Pelco-Media
        public override int GetHashCode()
        {
            // Auto-generated by Visual Studio

            var hashCode = -871570897;

            hashCode = hashCode * -1521134295 + EqualityComparer <byte[]> .Default.GetHashCode(_buffer);

            hashCode = hashCode * -1521134295 + _isOpen.GetHashCode();
            hashCode = hashCode * -1521134295 + _readOnly.GetHashCode();
            hashCode = hashCode * -1521134295 + _length.GetHashCode();
            hashCode = hashCode * -1521134295 + _capacity.GetHashCode();
            hashCode = hashCode * -1521134295 + _position.GetHashCode();
            hashCode = hashCode * -1521134295 + _startIndex.GetHashCode();
            hashCode = hashCode * -1521134295 + _isExpandable.GetHashCode();
            hashCode = hashCode * -1521134295 + IsReadOnly.GetHashCode();
            hashCode = hashCode * -1521134295 + IsOpen.GetHashCode();
            hashCode = hashCode * -1521134295 + Length.GetHashCode();
            hashCode = hashCode * -1521134295 + Capacity.GetHashCode();
            hashCode = hashCode * -1521134295 + Position.GetHashCode();
            hashCode = hashCode * -1521134295 + RemainingBytes.GetHashCode();
            hashCode = hashCode * -1521134295 + StartIndex.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <byte[]> .Default.GetHashCode(Raw);

            return(hashCode);
        }
コード例 #9
0
        public void Save()
        {
            if (String.IsNullOrEmpty(Id))
            {
                throw new InvalidOperationException();
            }

            var document = new XDocument(new XElement("deployment",
                                                      new XElement("id", Id),
                                                      new XElement("author", XmlUtility.Sanitize(Author)),
                                                      new XElement("deployer", Deployer),
                                                      new XElement("authorEmail", AuthorEmail),
                                                      new XElement("message", XmlUtility.Sanitize(Message)),
                                                      new XElement("progress", Progress),
                                                      new XElement("status", Status),
                                                      new XElement("statusText", StatusText),
                                                      new XElement("lastSuccessEndTime", LastSuccessEndTime),
                                                      new XElement("receivedTime", ReceivedTime),
                                                      new XElement("startTime", StartTime),
                                                      new XElement("endTime", EndTime),
                                                      new XElement("complete", Complete.ToString()),
                                                      new XElement("is_temp", IsTemporary.ToString()),
                                                      new XElement("is_readonly", IsReadOnly.ToString())
                                                      ));

            _statusLock.LockOperation(() =>
            {
                using (Stream stream = FileSystemHelpers.CreateFile(_statusFile))
                {
                    document.Save(stream);
                }

                OperationManager.Attempt(() =>
                {
                    // Used for ETAG
                    if (FileSystemHelpers.FileExists(_activeFile))
                    {
                        FileSystemHelpers.SetLastWriteTimeUtc(_activeFile, DateTime.UtcNow);
                    }
                    else
                    {
                        FileSystemHelpers.WriteAllText(_activeFile, String.Empty);
                    }
                });

                OperationManager.Attempt(() =>
                {
                    // enable the feature thru configuration
                    if (ScmHostingConfigurations.DeploymentStatusCompleteFileEnabled && Complete)
                    {
                        FileSystemHelpers.CopyFile(_statusFile, _statusCompleteFile);
                    }
                    else if (FileSystemHelpers.FileExists(_statusCompleteFile))
                    {
                        FileSystemHelpers.DeleteFile(_statusCompleteFile);
                    }
                });
            }, "Updating deployment status", DeploymentStatusManager.LockTimeout);
        }
コード例 #10
0
 public void FieldTest()
 {
     Assert.IsFalse(IsReadOnly.Field <TestClass>("A"));
     Assert.IsTrue(IsReadOnly.Field <TestClass>("B"));
     Assert.IsFalse(IsReadOnly.Field <TestClass>("C"));
     Assert.IsFalse(IsReadOnly.Field <TestClass>("D"));
     Assert.IsFalse(IsReadOnly.Field <TestClass>("E"));
 }
コード例 #11
0
 public void PropertyTest()
 {
     Assert.IsFalse(IsReadOnly.Property <TestClass>("A"));
     Assert.IsFalse(IsReadOnly.Property <TestClass>("B"));
     Assert.IsFalse(IsReadOnly.Property <TestClass>("C"));
     Assert.IsTrue(IsReadOnly.Property <TestClass>("D"));
     Assert.IsFalse(IsReadOnly.Property <TestClass>("E"));
 }
コード例 #12
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = elements?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ IsReadOnly.GetHashCode();
         return(hashCode);
     }
 }
コード例 #13
0
ファイル: StudentsList.cs プロジェクト: Tikhon-ql/Epam_Task5
        public override int GetHashCode()
        {
            int hashCode = -695961709;

            hashCode = hashCode * -1521134295 + EqualityComparer <Version> .Default.GetHashCode(Version);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Student> > .Default.GetHashCode(students);

            hashCode = hashCode * -1521134295 + Count.GetHashCode();
            hashCode = hashCode * -1521134295 + IsReadOnly.GetHashCode();
            return(hashCode);
        }
コード例 #14
0
ファイル: ColumnInfo.cs プロジェクト: Jaxelr/Insight.Database
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            int hashCode = 17;

            unchecked
            {
                hashCode += Name.GetHashCode();
                hashCode *= 23;
                hashCode += DataType.GetHashCode();
                hashCode *= 23;
                hashCode += IsNullable.GetHashCode();
                hashCode *= 23;
                hashCode += IsIdentity.GetHashCode();
                hashCode *= 23;
                hashCode += IsReadOnly.GetHashCode();
            }

            return(hashCode);
        }
コード例 #15
0
        public void Save()
        {
            if (String.IsNullOrEmpty(Id))
            {
                throw new InvalidOperationException();
            }

            var document = new XDocument(new XElement("deployment",
                                                      new XElement("id", Id),
                                                      new XElement("author", Author),
                                                      new XElement("deployer", Deployer),
                                                      new XElement("authorEmail", AuthorEmail),
                                                      new XElement("message", Message),
                                                      new XElement("progress", Progress),
                                                      new XElement("status", Status),
                                                      new XElement("statusText", StatusText),
                                                      new XElement("lastSuccessEndTime", LastSuccessEndTime),
                                                      new XElement("receivedTime", ReceivedTime),
                                                      new XElement("startTime", StartTime),
                                                      new XElement("endTime", EndTime),
                                                      new XElement("complete", Complete.ToString()),
                                                      new XElement("is_temp", IsTemporary.ToString()),
                                                      new XElement("is_readonly", IsReadOnly.ToString())
                                                      ));

            _statusLock.LockOperation(() =>
            {
                using (Stream stream = FileSystemHelpers.CreateFile(_statusFile))
                {
                    document.Save(stream);
                }

                // Used for ETAG
                if (FileSystemHelpers.FileExists(_activeFile))
                {
                    FileSystemHelpers.SetLastWriteTimeUtc(_activeFile, DateTime.UtcNow);
                }
                else
                {
                    FileSystemHelpers.WriteAllText(_activeFile, String.Empty);
                }
            }, DeploymentStatusManager.LockTimeout);
        }
コード例 #16
0
        protected internal override void Freeze()
        {
            const string isNotReadOnly = "IsNotReadOnly";

            base.Freeze();
            if (CreateBinding)
            {
                if (IsDirectBinding)
                {
                    Resources.Add("Value", new DirectBinding(BindingOptions, Validators));
                }
                else if (string.IsNullOrEmpty(Key))
                {
                    Resources.Add("Value", LiteralValue.Null);
                }
                else
                {
                    Resources.Add("Value", new DataBinding(Key, BindingOptions, Validators));
                }
            }

            Resources.Add(nameof(IsReadOnly), IsReadOnly ?? LiteralValue.False);
            if (IsReadOnly == null)
            {
                Resources.Add(isNotReadOnly, LiteralValue.True);
            }
            else if (IsReadOnly is LiteralValue literal)
            {
                Resources.Add(isNotReadOnly, new LiteralValue(literal.Value is false));
            }
            else
            {
                Resources.Add(isNotReadOnly, IsReadOnly.Wrap("Negate"));
            }

            Resources.Add(nameof(DefaultValue), DefaultValue ?? new LiteralValue(null));
            Resources.Add(nameof(SelectOnFocus), SelectOnFocus ?? LiteralValue.True);
        }
コード例 #17
0
ファイル: Content.cs プロジェクト: QuantumArt/QA.DPC
        /// <summary>
        /// хеш код по всей глубине контена с учетом того что могут быть циклы
        /// </summary>
        /// <param name="visitedContents">родительские контенты</param>
        internal int GetRecurciveHashCode(ReferenceHashSet <Content> visitedContents)
        {
            if (visitedContents.Contains(this))
            {
                return(HashHelper.CombineHashCodes(ContentId.GetHashCode(), visitedContents.Count.GetHashCode()));
            }

            visitedContents.Add(this);

            int hash = PublishingMode.GetHashCode();

            hash = HashHelper.CombineHashCodes(hash, IsReadOnly.GetHashCode());
            hash = HashHelper.CombineHashCodes(hash, LoadAllPlainFields.GetHashCode());
            hash = HashHelper.CombineHashCodes(hash, ContentId.GetHashCode());

            foreach (Field field in Fields.OrderBy(x => x.FieldId))
            {
                int fieldHash = field.GetRecurciveHashCode(visitedContents);
                hash = HashHelper.CombineHashCodes(hash, fieldHash);
            }

            return(hash);
        }
コード例 #18
0
        public string GetAttributeString()
        {
            string output = "";

            if (IsKey || KeyColumns.Contains(CleanName))
            {
                output += "[Key]\r\n\t\t";
            }
            if (DataType == typeof(string))
            {
                output += $"[MaxLength({Size})]\r\n\t\t";
            }

            output += $"[ReadOnly({IsReadOnly.ToString() .ToLower()})]\r\n\t\t";
            output += $"[Column(\"{CleanName}\", Order = {Index})]\r\n\t\t";

            output += IsAutoIncrement
                          ? $"[DatabaseGenerated(DatabaseGeneratedOption.Identity)]\r\n\t\t"
                          : $"[DatabaseGenerated(DatabaseGeneratedOption.None)]\r\n\t\t";

            output += $"[Display(Name = \"{DisplayName}\", ShortName = \"{DisplayName}\", Order = {Index})]";

            return(output);
        }
コード例 #19
0
ファイル: FormSupport.cs プロジェクト: johanericsson/code
        public static void SetupContainerGrids(EMDataSet emDataSet,
            int contID,QuickGrid bundleGrid,
            QuickGrid weightGrid,
            HelperFunctions.DataGridClientInterface face,IsReadOnly isReadOnly,
            out decimal totalLbs,out decimal totalKgs,
            GetBillOfLadingNumberFunc func)
        {
            string[] bolFieldList = {"*BundleSeqNumber","*PONumber",
                "*ItemName","*SizeOfItem","MetricShipQty",
                "EnglishShipQty","Heat",
                "BayNumber","InvoiceNumber","MillInvoiceDate","BundleAlloySurcharge",
                "BundleScrapSurcharge",
                "EMInvoiceNumber",
                "PickupDate","PickupTerminal","ProofOfDelivery","*CancelDate",
                "ContainerBundleID"};
            EMDataSet.ContainerTblRow contRow = emDataSet.ContainerTbl.FindByContID(contID);
            bool showLessFields = !contRow.IsApplyClosingToEntireContainerNull() &&
                contRow.ApplyClosingToEntireContainer!=0;
            if (showLessFields)
            {
                bolFieldList = new string[]{"*BundleSeqNumber","*PONumber",
                                            "*ItemName","*SizeOfItem","MetricShipQty",
                                            "EnglishShipQty","Heat",
                                            "BayNumber","InvoiceNumber","MillInvoiceDate",
                                            "BundleAlloySurcharge","BundleScrapSurcharge","EMInvoiceNumber",
                                            "*CancelDate",
                                            "ContainerBundleID"};

            }
            BundleFieldHelper bundleFieldHelper = new BundleFieldHelper();
            bundleFieldHelper.m_getter = func;
            GridWizard(bundleGrid,emDataSet.ContBundleTbl,false,
                IsNewAllowed.No,isReadOnly,"BundleSeqNumber",
                new GetFieldDelegate(bundleFieldHelper.GetBundleField),
                face,bolFieldList);

            bundleGrid.SetCancelColumn("CancelDate");

            DataTable weightTable = new DataTable();

            weightTable.Clear();
            weightTable.Columns.Clear();
            weightTable.Columns.Add("PONumber",typeof(string));
            weightTable.Columns.Add("ItemName",typeof(string));
            weightTable.Columns.Add("ItemDesc",typeof(string));
            weightTable.Columns.Add("SizeOfItem",typeof(string));
            weightTable.Columns.Add("MetricShipQty",typeof(decimal));
            weightTable.Columns.Add("EnglishShipQty",typeof(decimal));
            weightTable.Columns.Add("POItemNumber",typeof(int));

            totalKgs = 0;
            totalLbs = 0;
            foreach (EMDataSet.ContBundleTblRow sourceRow in emDataSet.ContBundleTbl.Rows)
            {
                if (!DataInterface.IsRowAlive(sourceRow))
                    continue;
                EMDataSet.POItemTblRow itemRow = sourceRow.POItemTblRow;
                EMDataSet.POHeaderTblRow poRow = itemRow.POHeaderTblRow;
                DataRow weightRow = weightTable.NewRow();
                weightRow["PONumber"] = poRow.PONumber;
                weightRow["ItemName"] = itemRow.ItemTblRow.ItemName;
                weightRow["ItemDesc"] = itemRow["ItemDesc"];
                weightRow["EnglishShipQty"] = sourceRow["EnglishShipQty"];
                if (!sourceRow.IsNull("EnglishShipQty"))
                {
                    totalLbs += (decimal)sourceRow["EnglishShipQty"];
                }
                weightRow["MetricShipQty"] = sourceRow["MetricShipQty"];
                if (!sourceRow.IsNull("MetricShipQty"))
                {
                    totalKgs += (decimal)sourceRow["MetricShipQty"];
                }
                weightRow["SizeOfItem"] = itemRow["SizeOfItem"];
                weightRow["POItemNumber"] = itemRow.POItemNumber;
                weightTable.Rows.Add(weightRow);
            }

            // Collapse the weightTable
            for (int i=0;i<weightTable.Rows.Count;i++)
            {
                DataRow masterRow = weightTable.Rows[i];
                if (!DataInterface.IsRowAlive(masterRow))
                    continue;
                int poItemNumber = (int)masterRow["POItemNumber"];
                for (int j=i+1;j<weightTable.Rows.Count;j++)
                {
                    DataRow compareRow = weightTable.Rows[j];
                    if (!DataInterface.IsRowAlive(compareRow))
                        continue;
                    if (((int)compareRow["POItemNumber"]) == poItemNumber) // same item
                    {
                        if (masterRow.IsNull("MetricShipQty"))
                            masterRow["MetricShipQty"] = (decimal)0;
                        if (masterRow.IsNull("EnglishShipQty"))
                            masterRow["EnglishShipQty"] = (decimal)0;
                        decimal metricShipQty = (decimal)masterRow["MetricShipQty"];
                        decimal englishShipQty = (decimal)masterRow["EnglishShipQty"];
                        if (!compareRow.IsNull("MetricShipQty"))
                            metricShipQty += (decimal)compareRow["MetricShipQty"];
                        if (!compareRow.IsNull("EnglishShipQty"))
                            englishShipQty += (decimal)compareRow["EnglishShipQty"];
                        masterRow["MetricShipQty"] = metricShipQty;
                        masterRow["EnglishShipQty"] = englishShipQty;
                        compareRow.Delete();
                        j--;
                    }
                }
            }
            DataView weightView = new DataView(weightTable,"","ItemName",DataViewRowState.CurrentRows);
            HelperFunctions.UpdateGrid(weightView,weightGrid,null,false,IsNewAllowed.No,
                IsReadOnly.Yes,"PONumber","ItemName","ItemDesc","SizeOfItem",
                "MetricShipQty","EnglishShipQty");
        }
コード例 #20
0
ファイル: ThreadPool.cs プロジェクト: ewin66/Forge
 private void Initialize()
 {
     if (mMinThreadNumber > 0)
     {
         for (int i = 0; i < mMinThreadNumber; i++)
         {
             StartNewThread();
         }
     }
     if (LOGGER.IsInfoEnabled)
     {
         LOGGER.Info(String.Format("THREADPOOL: initialized, Name: {0}, MinThreadNumber: {1}, MaxThreadNumber: {2}, ShutDownIdleThreadTime: {3}, MaxStackSize: {4}, IsReadOnly: {5}", string.IsNullOrEmpty(mName) ? GetHashCode().ToString() : mName, MinThreadNumber, MaxThreadNumber, ShutDownIdleThreadTime, MaxStackSize, IsReadOnly.ToString()));
     }
 }
コード例 #21
0
ファイル: BaseList.cs プロジェクト: avaranovich/xenogears
 public void Insert(int index, T item)
 {
     IsReadOnly.AssertFalse();
     InsertAt(index, item);
 }
コード例 #22
0
ファイル: HelperFunctions.cs プロジェクト: johanericsson/code
        public static void UpdateGrid(DataView itemTable,
            QuickGrid grid,
            DataGridClientInterface face,bool isKg,
            IsNewAllowed allowNew,
            IsReadOnly readOnly,
            params string[] fieldNames)
        {
            fieldNames = (string[])fieldNames.Clone();
            FieldProperties[] properties = GetProperties(ref fieldNames,isKg);
            int numberOfFields = fieldNames.Length;
            DataTable table = new DataTable();
            for (int i = 0;i<numberOfFields;i++)
            {
                System.Type type = properties[i].type;
                table.Columns.Add(fieldNames[i],type);
            }

            HelperFunctions.DataGridClientBridge bridge = null;
            if (face != null)
                bridge = new DataGridClientBridge(face);

            foreach (DataRowView rowView in itemTable)
            {
                DataRow row = rowView.Row;
                if (!DataInterface.IsRowAlive(row))
                    continue;
                DataRow newRow = table.NewRow();
                for (int i = 0;i<numberOfFields;i++)
                {
                    string fieldName = fieldNames[i];
                    if (!row.IsNull(fieldName) && row[fieldName].GetType() ==
                        typeof(System.DateTime))
                    {
                        DateTime d = (DateTime)row[fieldName];
                        newRow[fieldName] = d.ToShortDateString();
                    }
                    else
                        newRow[fieldName] = row[fieldName];
                }
                table.Rows.Add(newRow);
            }
            table.AcceptChanges();
            grid.ClearAllHandlers();
            ArrayList listOfColumnProperties = new ArrayList();
            for (int i=0;i<properties.Length;i++)
            {
                FieldProperties props = properties[i];
                if (props.isKeyField == true)
                    continue;
                if (IsReadOnly.Yes == readOnly)
                    props.readOnly = true;
                QuickGrid.ColumnProperties coll = new QuickGrid.ColumnProperties();
                switch (props.columnStyle)
                {
                    case ColumnStyle.Text:
                        coll.formatString = props.formatString;
                        break;
                    case ColumnStyle.Date:
                        coll.formatString = "d";
                        grid.AddButtonHandler(i,".",new EventHandler(OnDateClick));
                        break;
                    case ColumnStyle.Item:
                    {
                        if (!props.readOnly)
                        {
                            // since we are not allowing the user
                            // to actually edit the field
                            props.readOnly = true;

                            if (face == null)
                                throw new Exception("Oops, you need a handler for the item clicker");
                            grid.AddButtonHandler(i,".",new EventHandler(bridge.OnItemClick));
                        }
                        break;
                    }
                    default:
                        throw new Exception("Ahh no case statement");
                }
                if (props.columnHeading == "Description")
                {
                    coll.multiline = true;
                    coll.variable = true;
                }
                if (props.columnHeading == "Comments")
                {
                    coll.multiline = true;
                }
                coll.comboBoxValues = props.comboBoxItems;
                coll.heading = props.columnHeading;
                coll.size = props.width;
                coll.alignment = props.alignment;
                coll.readOnly = props.readOnly;
                listOfColumnProperties.Add(coll);
            }
            table.ColumnChanged +=new DataColumnChangeEventHandler(DataGridColumnChanged);
            if (bridge != null)
                table.ColumnChanged +=new DataColumnChangeEventHandler(bridge.DataGridColumnChanged);
            QuickGrid.ColumnProperties[] columnProperties = (QuickGrid.ColumnProperties[])listOfColumnProperties.ToArray
                                                (typeof(QuickGrid.ColumnProperties));
            grid.Setup(table,columnProperties,allowNew==IsNewAllowed.Yes?true:false);
        }
コード例 #23
0
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="IsReadOnly" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => IsReadOnly.CreateFrom(sourceValue);
コード例 #24
0
 public int GetHashCode() =>
 ID.GetHashCode() ^ Name.GetHashCode() ^ Category.GetHashCode() ^ IsReadOnly.GetHashCode();
コード例 #25
0
        public void DataIsReadOnlyTest()
        {
            var name = GetMember.Name <Account>(x => x.Data);

            Assert.IsTrue(IsReadOnly.Field <Account>(name));
        }
コード例 #26
0
        public void Show()
        {
            ClearTextFields();
            if (!IsNew)
            {
                LoadVendor(VendorID);
            }
            else
            {
                if (ddlVendor.Items.FindByValue("-1") != null)
                {
                    ddlVendor.SelectedValue = "-1";
                }
                ClearProperties();
                EnableTextboxes(false);
            }

            if (IsReadOnly)
            {
                ScriptManager.RegisterStartupScript(this, typeof(UserControl), "DisableVendorDropDown", "disableVendorDropdown(" + IsReadOnly.ToString().ToLower() + ");", true);
            }
        }
コード例 #27
0
ファイル: FormSupport.cs プロジェクト: johanericsson/code
 public static void GridWizard(QuickGrid grid,
     DataTable table,bool isMetric,IsNewAllowed isNewAllowed,
     IsReadOnly isReadOnly,
     string sortingField,GetFieldDelegate getField,
     HelperFunctions.DataGridClientInterface face,params string[] fieldsIn)
 {
     // When you get the field properties than the leading "*" is stripped
     string[] fields = (string[])fieldsIn.Clone();
     fieldsIn.CopyTo(fields,0);
     HelperFunctions.FieldProperties[] fieldProperties = HelperFunctions.GetProperties(ref fields,isMetric);
     DataTable newTable = new DataTable();
     for (int i=0;i<fields.Length;i++)
     {
         newTable.Columns.Add(fields[i],fieldProperties[i].type);
     }
     for (int i=0;i<table.Rows.Count;i++)
     {
         if (!DataInterface.IsRowAlive(table.Rows[i]))
             continue;
         DataRow targetRow = newTable.NewRow();
         foreach (string fieldName in fields)
         {
             object o = getField(table.Rows[i],isMetric,fieldName);
             targetRow[fieldName] = o;
         }
         newTable.Rows.Add(targetRow);
     }
     DataView view = new DataView(newTable,"",sortingField,
         DataViewRowState.CurrentRows);
     HelperFunctions.UpdateGrid(view,grid,face,isMetric,
         isNewAllowed,isReadOnly,fieldsIn);
 }
コード例 #28
0
        public void DbRecordIsReadOnlyTest()
        {
            var name = GetMember.Name <CurrencyObject>(x => x.DbRecord);

            Assert.IsTrue(IsReadOnly.Field <CurrencyObject>(name));
        }
コード例 #29
0
ファイル: BidObjectTests.cs プロジェクト: viljampp/Bacchus
        [TestMethod] public void DbRecordIsReadOnlyTest()
        {
            var name = GetMember.Name <BidObject>(x => x.DbRecord);

            Assert.IsTrue(IsReadOnly.Field <BidObject>(name));
        }