• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# QueryFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中QueryFilter的典型用法代码示例。如果您正苦于以下问题:C# QueryFilter类的具体用法?C# QueryFilter怎么用?C# QueryFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



QueryFilter类属于命名空间,在下文中一共展示了QueryFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddAreaFieldToFeatureClass

        public int AddAreaFieldToFeatureClass(String feature_class, String field_name)
        {
            try
            {

                IGPUtilities ipUtils = new GPUtilities();
                IFeatureClass ipFeatureClass;

                // Open FC
                try
                {
                    ipFeatureClass = ipUtils.OpenFeatureClassFromString(feature_class);
                }
                catch(Exception)
                {
                    return -1;
                }

                // Find field
                int fieldIndex;
                try
                {
                    fieldIndex = ipFeatureClass.FindField(field_name);
                }
                catch(Exception)
                {
                    return -2;
                }

                // Set up query and filter
                IQueryFilter ipFilter = new QueryFilter();
                IFeatureCursor ipCursor;
                IFeature ipRow;
                IGeometry ipShape;

                // Open cursor on feature class
                ipCursor = ipFeatureClass.Update(ipFilter, false);

                for (ipRow = ipCursor.NextFeature();
                     ipRow != null;
                     ipRow = ipCursor.NextFeature())
                {
                    ipShape = ipRow.ShapeCopy;
                    if (ipShape.GeometryType != esriGeometryType.esriGeometryPolygon)
                        return -3;

                    IArea ipArea = ipShape as IArea;
                    double area = ipArea.Area;
                    ipRow.Value[fieldIndex] = area;

                    ipRow.Store();
                }

                return 0;
            }
            catch (Exception)
            {
                return -4;
            }
        }
开发者ID:Esri,项目名称:interop-examples-python,代码行数:60,代码来源:ExecuteTool.cs


示例2: Delete

 public bool Delete(UUID ownerID, string friend)
 {
     QueryFilter filter = new QueryFilter();
     filter.andFilters["PrincipalID"] = ownerID;
     filter.andFilters["Friend"] = friend;
     return GD.Delete(m_realm, filter);
 }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:7,代码来源:LocalFriendsConnector.cs


示例3: GetFriends

        public FriendInfo[] GetFriends(UUID principalID)
        {
            List<FriendInfo> infos = new List<FriendInfo>();

            QueryTables tables = new QueryTables();
            tables.AddTable(m_realm, "my");
            tables.AddTable(m_realm, "his", JoinType.Inner,
                            new[,] {{"my.Friend", "his.PrincipalID"}, {"my.PrincipalID", "his.Friend"}});
            QueryFilter filter = new QueryFilter();
            filter.andFilters["my.PrincipalID"] = principalID;
            List<string> query = GD.Query(new string[]
                                              {
                                                  "my.Friend",
                                                  "my.Flags",
                                                  "his.Flags"
                                              }, tables, filter, null, null, null);

            //These are used to get the other flags below
            for (int i = 0; i < query.Count; i += 3)
            {
                FriendInfo info = new FriendInfo
                                      {
                                          PrincipalID = principalID,
                                          Friend = query[i],
                                          MyFlags = int.Parse(query[i + 1]),
                                          TheirFlags = int.Parse(query[i + 2])
                                      };
                infos.Add(info);
            }
            return infos.ToArray();
        }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:31,代码来源:LocalFriendsConnector.cs


示例4: Delete

 public bool Delete(UUID id, bool ignoreFlags)
 {
     try
     {
         if (!ignoreFlags)
         {
             AssetBase asset = GetAsset(id, false);
             if (asset == null)
                 return false;
             if ((int) (asset.Flags & AssetFlags.Maptile) != 0 || //Depriated, use Deletable instead
                 (int) (asset.Flags & AssetFlags.Deletable) != 0)
                 ignoreFlags = true;
         }
         if (ignoreFlags)
         {
             QueryFilter filter = new QueryFilter();
             filter.andFilters["id"] = id;
             m_Gd.Delete("assets", filter);
         }
     }
     catch (Exception e)
     {
         if (MainConsole.Instance != null)
             MainConsole.Instance.Error("[LocalAssetDatabase] Error while deleting asset " + e);
     }
     return true;
 }
开发者ID:CaseyraeStarfinder,项目名称:WhiteCore-Dev,代码行数:27,代码来源:LocalAssetMainConnector.cs


示例5: FolderExists

        public bool FolderExists(UUID folderID)
        {
            QueryFilter filter = new QueryFilter();
            filter.andFilters["folderID"] = folderID;

            return GD.Query(new string[] {"folderID"}, m_foldersrealm, filter, null, null, null).Count > 0;
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:7,代码来源:LocalInventoryConnector.cs


示例6: FindPath

        public IEnumerable<Vector3> FindPath(Vector3 start, Vector3 end, QueryFilter filter, bool hardFail)
        {
            if (!LoadAppropriateTiles(start, end))
                throw new Exception("Correct tiles were not loaded!");

            //LoadAllTiles();

            float[] extents = new[] { 0.5f, 0.5f, 0.5f };
            PolygonReference startRef, endRef;

            float[] transformedStart = start.ToFloatArray();
            float[] transformedEnd = end.ToFloatArray();

            RecastManaged.Helper.Transform(ref transformedStart);
            RecastManaged.Helper.Transform(ref transformedEnd);

            while ((startRef = DetourMesh.FindNearestPolygon(transformedStart, extents, filter)).PolyIndex == 0)
            {
                if (extents[0] > 100.0f)
                    throw new Exception("Extents got too huge");

                extents[0] += 0.5f;
                extents[1] += 0.5f;
                extents[2] += 0.5f;
            }

            extents = new[] { 0.5f, 0.5f, 0.5f };
            while ((endRef = DetourMesh.FindNearestPolygon(transformedEnd, extents, filter)).PolyIndex == 0)
            {
                if (extents[0] > 100.0f)
                    throw new Exception("Extents got too huge");

                extents[0] += 0.5f;
                extents[1] += 0.5f;
                extents[2] += 0.5f;
            }
            var path = DetourMesh.FindPath(startRef, endRef, transformedStart, transformedEnd, filter);

            if (path.Length <= 0)
                return null;

            // if the last poly in the path is not the end poly, a path was not found
            if (hardFail && path[path.Length - 1].PolyIndex != endRef.PolyIndex)
                return null;

            StraightPathFlags[] flags;
            PolygonReference[] straightPathRefs;
            var straightPath = DetourMesh.FindStraightPath(transformedStart, transformedEnd, path, out flags, out straightPathRefs);

            RecastManaged.Helper.InverseTransform(ref straightPath);

            List<Vector3> ret = new List<Vector3>(straightPath.Length / 3);
            for (int i = 0; i < straightPath.Length / 3; i++)
                ret.Add(new Vector3(straightPath[i * 3 + 0], straightPath[i * 3 + 1], straightPath[i * 3 + 2]));

            //for (int i = 0; i < straightPath.Length / 3; i++)
            //    yield return new Vector3(straightPath[i * 3 + 0], straightPath[i * 3 + 1], straightPath[i * 3 + 2]);

            return ret;
        }
开发者ID:Wrongusername,项目名称:IceFlake,代码行数:60,代码来源:Pather.cs


示例7: GetBySession

 public ViewerStatsMessage GetBySession(UUID sessionID)
 {
     QueryFilter filter = new QueryFilter();
     filter.andFilters.Add("session_id", sessionID);
     List<string> results = GD.Query(new string[1] {"*"}, m_realm, filter, null, null, null);
     return BuildSession(results, 0);
 }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:7,代码来源:LocalUserStatsDataConnector.cs


示例8: Get

        public UserInfo Get(string userID, bool checkOnlineStatus, out bool onlineStatusChanged)
        {
            onlineStatusChanged = false;

            QueryFilter filter = new QueryFilter();
            filter.andFilters["UserID"] = userID;
            List<string> query = GD.Query(new string[1] {"*"}, m_realm, filter, null, null, null);

            if (query.Count == 0)
            {
                return null;
            }
            UserInfo user = ParseQuery(query)[0];

            //Check LastSeen
            DateTime timeLastSeen = Util.ToDateTime(int.Parse(query[2]));
            DateTime timeNow = DateTime.Now.ToUniversalTime();
            if (checkOnlineStatus && m_checkLastSeen && user.IsOnline && (timeLastSeen.AddHours(1) < timeNow))
            {
                MainConsole.Instance.Warn("[UserInfoService]: Found a user (" + user.UserID +
                                          ") that was not seen within the last hour " +
                                          "(since " + timeLastSeen.ToLocalTime().ToString() + ", time elapsed " +
                                          (timeNow - timeLastSeen).Days + " days, " + (timeNow - timeLastSeen).Hours +
                                          " hours)! Logging them out.");
                user.IsOnline = false;
                Set(user);
                onlineStatusChanged = true;
            }
            return user;
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:30,代码来源:LocalUserInfoConnector.cs


示例9: AddClassified

        public bool AddClassified(Classified classified)
        {
            object remoteValue = DoRemote(classified);
            if (remoteValue != null || m_doRemoteOnly)
                return remoteValue != null && (bool) remoteValue;

            if (GetUserProfile(classified.CreatorUUID) == null)
                return false;
            string keywords = classified.Description;
            if (keywords.Length > 512)
                keywords = keywords.Substring(keywords.Length - 512, 512);
            //It might be updating, delete the old
            QueryFilter filter = new QueryFilter();
            filter.andFilters["ClassifiedUUID"] = classified.ClassifiedUUID;
            GD.Delete("userclassifieds", filter);
            List<object> values = new List<object>
                                      {
                                          classified.Name,
                                          classified.Category,
                                          classified.SimName,
                                          classified.CreatorUUID,
                                          classified.ScopeID,
                                          classified.ClassifiedUUID,
                                          OSDParser.SerializeJsonString(classified.ToOSD()),
                                          classified.PriceForListing,
                                          keywords
                                      };
            return GD.Insert("userclassifieds", values.ToArray());
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:29,代码来源:LocalProfileConnector.cs


示例10: AbuseReportCount

        /// <summary>
        /// Gets the number of Abuse reports.
        /// </summary>
        /// <returns>The report count.</returns>
        public int AbuseReportCount()
        {
            QueryFilter filter = new QueryFilter ();
            var reports = GD.Query (new string[1] { "count(*)" }, m_abuseReportsTable, filter, null, null, null);
            if ((reports == null) || (reports.Count == 0))
                return 0;

            return int.Parse (reports [0]);
        }
开发者ID:CaseyraeStarfinder,项目名称:WhiteCore-Dev,代码行数:13,代码来源:LocalAbuseReportsConnector.cs


示例11: DeleteFolders

        public virtual bool DeleteFolders(string field, string val, bool safe)
        {
            QueryFilter filter = new QueryFilter();
            filter.andFilters[field] = val;
            if (safe)
                filter.orMultiFilters["type"] = new List<object>() { "-1", "47" };

            return GD.Delete(m_foldersrealm, filter);
        }
开发者ID:VirtualReality,项目名称:Universe,代码行数:9,代码来源:LocalInventoryConnector.cs


示例12: Query

        public Query(QueryScope scope, QueryFilter filter)
        {
            if (scope == null)
                this.scope = new QueryScope(ObjectTypes.AllExcFolders);
            else
                this.scope = scope;

            this.filter = filter;  // null is OK
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:9,代码来源:Query.cs


示例13: FindLSLData

        public List<string> FindLSLData(string token, string key)
        {
            object remoteValue = DoRemote(token, key);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<string>) remoteValue;

            QueryFilter filter = new QueryFilter();
            filter.andFilters["Token"] = token;
            filter.andFilters["KeySetting"] = key;
            return GD.Query(new string[1] {"*"}, "lslgenericdata", filter, null, null, null);
        }
开发者ID:VirtualReality,项目名称:Universe,代码行数:11,代码来源:LocalAssetConnector.cs


示例14: Get

 public SchedulerItem Get(string id)
 {
     if (id != "")
     {
         QueryFilter filter = new QueryFilter();
         filter.andFilters["id"] = id;
         List<string> results = m_Gd.Query(theFields, "scheduler", filter, null, null, null);
         return LoadFromList(results);
     }
     return null;
 }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:11,代码来源:LocalSchedulerConnector.cs


示例15: DeleteAccount

 public bool DeleteAccount(UUID userID, bool archiveInformation)
 {
     if (archiveInformation)
     {
         return GD.Update(m_realm, new Dictionary<string, object> {{"UserLevel", -2}}, null,
                          new QueryFilter {andFilters = new Dictionary<string, object> {{"PrincipalID", userID}}},
                          null, null);
     }
     QueryFilter filter = new QueryFilter();
     filter.andFilters.Add("PrincipalID", userID);
     return GD.Delete(m_realm, filter);
 }
开发者ID:emperorstarfinder,项目名称:My-Aurora-Sim,代码行数:12,代码来源:LocalUserAccountConnector.cs


示例16: ImagesSearch

 public IEnumerable<ImageInformation> ImagesSearch(QueryFilter pars, int maxImages)
 {
     Console.WriteLine("---- ImagesQuery execution ----");
     if (maxImages >= 0)
     {
         Console.WriteLine("Maximum returned images: {0}", maxImages);
     }
     Console.WriteLine(pars);
     
     // ... Implementation details ...
     throw new NotImplementedException();
 }
开发者ID:vilhena,项目名称:PROMPT11-02-AdvancedProgramming.vilhena,代码行数:12,代码来源:ImageService.cs


示例17: Store

        public bool Store (UUID PrincipalID, string Friend, int Flags, int Offered)
        {
            QueryFilter filter = new QueryFilter ();
            filter.andFilters ["PrincipalID"] = PrincipalID;
            filter.andFilters ["Friend"] = Friend;
            GD.Delete (m_realm, filter);
            Dictionary<string, object> row = new Dictionary<string, object> (4);
            row ["PrincipalID"] = PrincipalID;
            row ["Friend"] = Friend;
            row ["Flags"] = Flags;
            row ["Offered"] = Offered;

            return GD.Insert (m_realm, row);
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:14,代码来源:LocalFriendsConnector.cs


示例18: Get

 public AvatarAppearance Get(UUID PrincipalID)
 {
     QueryFilter filter = new QueryFilter();
     filter.andFilters["PrincipalID"] = PrincipalID;
     List<string> data;
     lock (m_lock)
     {
         data = GD.Query(new string[] {"Appearance"}, m_realm, filter, null, null, null);
     }
     if (data.Count == 0)
         return null;
     AvatarAppearance appearance = new AvatarAppearance();
     appearance.FromOSD((OSDMap) OSDParser.DeserializeJson(data[0]));
     return appearance;
 }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:15,代码来源:LocalAvatarConnector.cs


示例19: ajusterNaipfddm

        private void ajusterNaipfddm(ITable pTable)
        {
            // Error Handling
            const string functionName = "addField";

            IRow pRow;
            ICursor pCursor;
            IQueryFilter iQf = new QueryFilter();

            try
            {
                iQf.SubFields = "NAIF1_DDM, ET1_ESS1, ET1_PC1, ET1_ESS2, ET1_PC2, ET1_ESS3, ET1_PC3, ET1_ESS4, ET1_PC4, ET1_ESS5, ET1_PC5, ET1_ESS6, ET1_PC6, ET1_ESS7, ET1_PC7";
                iQf.WhereClause = "naif1_ddm = ''";

                pCursor = pTable.Update(iQf, false);
                pRow = pCursor.NextRow();

                string sFinal;
                int iPourc;

                while (pRow != null)
                {
                    sFinal = "";

                    for (int i = 1; i < SF10_clsBase.i_NAIPFMaxControls; i++)
                    {
                        if (pRow.Value[pRow.Fields.FindField("et1_ess" + i)].ToString().Trim().Length != 0)
                        {
                            iPourc = 100;
                            if (pRow.Value[pRow.Fields.FindField("et1_pc" + i)].ToString().Trim().Length != 0) { iPourc = valeurToPourc(pRow.Value[pRow.Fields.FindField("et1_pc" + i)].ToString().Trim()); }

                            sFinal += pRow.Value[pRow.Fields.FindField("et1_ess" + i)] + iPourc.ToString();
                        }
                    }

                    pRow.Value[pRow.Fields.FindField("NAIF1_DDM")] = sFinal;
                    pCursor.UpdateRow(pRow);
                    pRow = pCursor.NextRow();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(functionName + " :: " + e.Message, "SF10", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
            }
        }
开发者ID:GroupeDDM,项目名称:saisieforestiere10,代码行数:48,代码来源:SF10_frmCreerShapefileSaisie.cs


示例20: ExistsAsset

 public bool ExistsAsset(UUID uuid)
 {
     try
     {
         QueryFilter filter = new QueryFilter();
         filter.andFilters["id"] = uuid;
         return m_Gd.Query(new string[] {"id"}, "assets", filter, null, null, null).Count > 0;
     }
     catch (Exception e)
     {
         if (MainConsole.Instance != null)
             MainConsole.Instance.ErrorFormat(
                 "[LocalAssetDatabase]: Failure fetching asset {0}" + Environment.NewLine + e, uuid);
     }
     return false;
 }
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:16,代码来源:LocalAssetMainConnector.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# QueryFilterClass类代码示例发布时间:2022-05-24
下一篇:
C# QueryField类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap