当前位置: 首页>>代码示例>>C#>>正文


C# IObject.get_Value方法代码示例

本文整理汇总了C#中IObject.get_Value方法的典型用法代码示例。如果您正苦于以下问题:C# IObject.get_Value方法的具体用法?C# IObject.get_Value怎么用?C# IObject.get_Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObject的用法示例。


在下文中一共展示了IObject.get_Value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetDynamicValues

        public bool SetDynamicValues(IObject inObject, string mode, out List<IObject> ChangeFeatureList, out List<IObject> NewFeatureList, out List<IObject> ChangeFeatureGeoList)
        {
            NumberFormatInfo nfi = new CultureInfo(A4LGSharedFunctions.Localizer.GetString("AA_CultureInfo"), false).NumberFormat;
            nfi.NumberGroupSeparator = "";

            ChangeFeatureList = null;
            NewFeatureList = null;
            ChangeFeatureGeoList = null;

            IMSegmentation mseg = null;
            INetworkFeature netFeat = null;

            IJunctionFeature iJuncFeat = null;
            IEdgeFeature iEdgeFeat = null;

            //ProgressBar
            //ESRI.ArcGIS.Framework.IProgressDialogFactory progressDialogFactory = null;
            //ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = null;
            //ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog = null;
            //// Create a CancelTracker
            //ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel = new ESRI.ArcGIS.Display.CancelTrackerClass();
            //trackCancel.CancelOnKeyPress = true;
            // trackCancel.CancelOnClick = true;

            try
            {
                AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14d"));
                if (AAState.PerformUpdates == false)
                {
                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14a"));

                }
                if (AAState.PerformUpdates && AAState._dv == null)
                {

                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14b") + AAState._defaultsTableName);

                    AAState.PerformUpdates = false;
                    return false;
                }

                if (AAState.PerformUpdates && AAState._dv != null)
                {
                    if (AAState._dv.Table == null)
                    {

                        AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14c"));

                        return false;
                    }

                    if (inObject == null)
                    {
                        AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14e"));

                        return false;
                    }
                    if (inObject.Table == AAState._tab)
                    {

                        if (inObject.get_Value(inObject.Fields.FindField("VALUEMETHOD")).ToString().ToUpper() == "LAST_VALUE")
                        {
                            if (inObject.get_Value(inObject.Fields.FindField("FIELDNAME")) != null)
                            {
                                if (inObject.get_Value(inObject.Fields.FindField("FIELDNAME")) != DBNull.Value)
                                {
                                    try
                                    {
                                        LastValueEntry lstVal = AAState.lastValueProperties.GetProperty(inObject.get_Value(inObject.Fields.FindField("FIELDNAME")).ToString()) as LastValueEntry;
                                        if (lstVal != null)
                                        {
                                            lstVal.On_Manual = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_MANUAL")).ToString());
                                            lstVal.On_Create = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_CREATE")).ToString());
                                            lstVal.On_ChangeAtt = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_CHANGE")).ToString());

                                            if (inObject.Fields.FindField("ON_CHANGEGEO") >= 0)
                                            {
                                                lstVal.On_ChangeGeo = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_CHANGEGEO")).ToString());
                                            }
                                        }
                                        AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14f"));
                                    }
                                    catch
                                    {
                                        //property does not exist

                                    }
                                }
                            }

                        }
                        else
                        {
                            AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14g"));
                        }
                        return false;
                    }

                    string modeVal;

//.........这里部分代码省略.........
开发者ID:rlwarford,项目名称:local-government-desktop-addins,代码行数:101,代码来源:AttributeAssistantEditorExtension.cs

示例2: SetDynamicValues


//.........这里部分代码省略.........
                    _currentDatasetNameItems = _currentDataset.Name.Split('.');
                    tableName = _currentDatasetNameItems[_currentDatasetNameItems.GetLength(0) - 1];

                    stepProgressor.Message = "Checking rules for edited feature: " + inObject.Class.AliasName;
                    progressDialog.Description = "Checking rules for edited feature: " + inObject.Class.AliasName;
                    AAState.WriteLine("***********************************************************");
                    AAState.WriteLine("############ " + DateTime.Now + " ################");

                    AAState.WriteLine("");
                    AAState.WriteLine("  Setting sort order: Field - RUNORDER");

                    if (AAState._dv.Table.Columns.Contains("RUN_WEIGHT"))
                        AAState._dv.Sort = "RUN_WEIGHT DESC";

                    AAState.WriteLine("  Querying table for Last Value for layer: " + inObject.Class.AliasName);
                    AAState.WriteLine("  Query Used: (TABLENAME = '*' OR TABLENAME = '" + tableName + "' OR TABLENAME like '" + tableName + "|*' OR TABLENAME like '" + tableName + "|%') AND VALUEMETHOD = 'Last_Value'");
                    AAState._dv.RowFilter = "(TABLENAME = '*' OR TABLENAME = '" + tableName + "' OR TABLENAME like '" + tableName + "|*' OR TABLENAME like '" + tableName + "|%') AND VALUEMETHOD = 'Last_Value'";
                    AAState.WriteLine("  Number of results: " + AAState._dv.Count.ToString());

                    if (AAState._dv.Count > 0)
                    {
                        IRowChanges pRowChLast = inObject as IRowChanges;
                        for (int retRows = 0; retRows < AAState._dv.Count; retRows++)
                        {
                            DataRowView drv = AAState._dv[retRows];
                            AAState.WriteLine("       Looking for " + drv["FIELDNAME"].ToString());

                            int fldLoc = inObject.Fields.FindField(drv["FIELDNAME"].ToString());

                            if (fldLoc > 0)
                            {
                                AAState.WriteLine("       " + drv["FIELDNAME"].ToString() + " field found at position: " + fldLoc);

                                if (pRowChLast.get_ValueChanged(fldLoc))
                                {
                                    AAState.WriteLine("       " + drv["FIELDNAME"].ToString() + " Has Changed");

                                    try
                                    {
                                        if (inObject.get_Value(fldLoc) != null)
                                        {
                                            if (inObject.get_Value(fldLoc) != DBNull.Value)
                                            {
                                                if (AAState.lastValueProperties.GetProperty(drv["FIELDNAME"].ToString()) != null)
                                                {
                                                    AAState.WriteLine("                      Setting Last Value");
                                                    AAState.WriteLine("                           " + drv["FIELDNAME"].ToString() + ": " + inObject.get_Value(fldLoc).ToString());
                                                    AAState.lastValueProperties.SetProperty(drv["FIELDNAME"].ToString(), inObject.get_Value(fldLoc));
                                                }

                                                else
                                                {
                                                    AAState.WriteLine("                      Setting Last Value");
                                                    AAState.WriteLine("                           " + drv["FIELDNAME"].ToString() + ": " + inObject.get_Value(fldLoc));

                                                    AAState.lastValueProperties.SetProperty(drv["FIELDNAME"].ToString(), inObject.get_Value(fldLoc));
                                                }
                                            }
                                            else
                                            {
                                                if (mode == "ON_CREATE")
                                                {
                                                    AAState.WriteLine("                      Skipping null on create");

                                                }
                                                else
开发者ID:riordabr,项目名称:3d-cities-template,代码行数:67,代码来源:AttributeAssistantEditorExtension.cs

示例3: setDynamicDefaults

        private void setDynamicDefaults(IObject inObject, string mode)
        {
            try
            {
                //Convert row to feature (test for feature is null before using - this could be a table update)
                IFeature inFeature = inObject as IFeature;

                // Skip Orphan Junctions (saves time)
                if (inFeature != null)
                {
                    INetworkFeature inNetFeat = inObject as INetworkFeature;
                    if ((inNetFeat != null) &&
                        (inFeature.Class.ObjectClassID == inNetFeat.GeometricNetwork.OrphanJunctionFeatureClass.ObjectClassID))
                        return;
                }

                //Get cursor to dynamic values table retriving only
                ICursor tabCursor;
                getDefaultRows(inObject, out tabCursor);
                IRow row = null;
                if (tabCursor != null)
                    row = tabCursor.NextRow();

                //for each row in the matching rows (matched by table name or wildcard) returned from the config table
                while (row != null)
                {
                    //get fieldname
                    string fieldName = row.get_Value(dynTargetField).ToString();

                    //if this field is found in the feature/object being added or modified...
                    int fieldNum = inObject.Fields.FindField(fieldName);
                    if (fieldNum > -1)
                    {
                        // get requested method and any data parameters
                        string valMethod = row.get_Value(dynMethodField).ToString();
                        string valData = row.get_Value(dynDataField).ToString();

                        switch (mode)
                        {
                            case "OnCreate":
                                //Continue to next field in config table if create events were not requested
                                if (row.get_Value(dynCreateField).ToString() == "0")
                                {
                                    row = tabCursor.NextRow();
                                    continue;
                                }
                                break;
                            case "OnChange":
                                // Collect value for changed feature (stored for LAST VALUE method)
                                IRowChanges inChanges = inObject as IRowChanges;
                                bool changed = inChanges.get_ValueChanged(fieldNum);
                                if (changed)
                                    lastValueProperties.SetProperty(fieldName, inObject.get_Value(fieldNum));
                                //Continue to next field in config table if change events were not requested
                                if (row.get_Value(dynChangeField).ToString() == "0")
                                {
                                    row = tabCursor.NextRow();
                                    continue;
                                }
                                break;
                        }

                        // set values as specified
                        switch (valMethod)
                        {
                            case "TIMESTAMP":

                                inObject.set_Value(fieldNum, DateTime.Now);
                                break;

                            case "LAST_VALUE":

                                if (mode == "OnCreate")
                                {
                                    //if (inObject.get_Value(fieldNum) == null)
                                    //{
                                    object lastValue = lastValueProperties.GetProperty(fieldName);
                                    if (lastValue != null)
                                        inObject.set_Value(fieldNum, lastValue);
                                    //}
                                }

                                break;

                            case "FIELD":

                                // verify that field to copy exists
                                int fieldCopy = inObject.Fields.FindField(valData as string);
                                if (fieldCopy > -1)
                                {
                                    //copy value only if current field is empty
                                    string currentValue = inObject.get_Value(fieldNum).ToString();
                                    if (currentValue == "")
                                        inObject.set_Value(fieldNum, inObject.get_Value(fieldCopy));
                                }
                                break;

                            case "CURRENT_USER":

                                if (lastEditorName == null)
//.........这里部分代码省略.........
开发者ID:jorik041,项目名称:utilities-telecom-desktop-addins,代码行数:101,代码来源:FiberEditorExtension.cs

示例4: SetDynamicValues


//.........这里部分代码省略.........
                                proc = false;
                            }
                            else
                            {
                                proc = true;
                            }
                        }
                        if (proc)
                        {

                            AAState.WriteLine("          Value Entry Rows found: " + AAState._dv.Count);
                            AAState.WriteLine("          ----------------------------------------------");
                            // Get requested method and any data parameters
                            AAState.WriteLine("          Looping through Value Methods");
                            AAState.WriteLine("                  ------------------------");
                            foreach (DataRowView drv in AAState._dv)
                            {

                                AAState.WriteLine("                  Checking for Subtype Restriction");
                                valFC = drv["TABLENAME"].ToString().Trim();
                                if (valFC.Contains("|"))
                                {
                                    AAState.WriteLine("                  Subtype restriction Found");
                                    string[] spliVal = valFC.Split('|');

                                    if (Globals.IsInteger(spliVal[1]))
                                    {
                                        int SubVal = Convert.ToInt32(spliVal[1]);
                                        ISubtypes pSub = inObject.Class as ISubtypes;
                                        if (pSub != null)
                                        {
                                            if (pSub.HasSubtype)
                                            {
                                                int obSubVal = (int)inObject.get_Value(pSub.SubtypeFieldIndex);
                                                if (obSubVal == SubVal)
                                                {
                                                    AAState.WriteLine("                  Subtypes match");
                                                }
                                                else
                                                {
                                                    AAState.WriteLine("                  Skipping, not the subtype defined");
                                                    continue;
                                                }
                                            }
                                            else
                                            {
                                                AAState.WriteLine("                  ERROR: Layer does not have subtypes");
                                            }
                                        }
                                        else
                                        {
                                            AAState.WriteLine("                  ERROR: Layer does not have subtypes");
                                        }
                                    }
                                    else
                                    {
                                        AAState.WriteLine("                  ERROR: Subtype not an integar");
                                    }
                                }
                                valMethod = drv["VALUEMETHOD"].ToString().ToUpper().Trim();
                                valData = drv["VALUEINFO"].ToString().Trim();

                                AAState.WriteLine("                  VALUEMETHOD: " + valMethod);
                                AAState.WriteLine("                  VALUEINFO: " + valData);
                                AAState.WriteLine("                  ------------------------");
                                //set field value based on specified method
开发者ID:riordabr,项目名称:3d-cities-template,代码行数:67,代码来源:Copy+of+AttributeAssistantEditorExtension.cs


注:本文中的IObject.get_Value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。