Пример #1
0
 public static void RaiseNestingFound(object sender, GlobalEventArgs args)
 {
     if (NestingFound != null)
     {
         NestingFound(sender, args);
     }
 }
Пример #2
0
        private void AsyncPartialResult(object entries, GlobalEventArgs args)
        {
            try
            {
                lock (base.ParallelResults)
                { base.ParallelResults.AddRange((List <SearchResultEntry>)entries); }
            }

            catch (Exception ex)
            { var x = 0; }
        }
Пример #3
0
        public static void RaiseNestingFound(string groupSid, SidInfo memberInfo)
        {
            GlobalEventArgs nargs = new GlobalEventArgs();

            EventValue sid = new EventValue();

            sid.SetDefaultValue <string>(groupSid);

            nargs.Values.Add("group", sid);

            EventValue member = new EventValue();

            member.SetDefaultValue <SidInfo>(memberInfo);

            nargs.Values.Add("member", member);

            RaiseNestingFound(null, nargs);
        }
Пример #4
0
        private void AsyncSearchComplete(object sender, GlobalEventArgs args)
        {
            base.AsyncComplete = true;

            try
            {
                base.AsyncConnection.Dispose();

                base.AsyncConnection = null;

                base.IsConnected = false;
            }

            catch (Exception ex)
            { ex.ToDummy(); }

            GlobalEventHandler.AsyncQureyIsCompleted -= AsyncSearchComplete;
        }
Пример #5
0
        private void QuerySingleObjectPaths(object infoStore, GlobalEventArgs args)
        {
            if ((args.ResultEventType & QUERY_RESULT_EVENT_TYPE.FROM_SINGLE_OBJECT_PATH) != QUERY_RESULT_EVENT_TYPE.FROM_SINGLE_OBJECT_PATH)
            {
                return;
            }

            if ((args.ResultEventType & QUERY_RESULT_EVENT_TYPE.IS_COMPLETED) == QUERY_RESULT_EVENT_TYPE.IS_COMPLETED)
            {
                GlobalEventHandler.QueryCompleted -= QuerySingleObjectPaths;
            }

            SearchRequestExtender reqstore = (SearchRequestExtender)infoStore;

            if (!reqstore.HasError)
            {
                GlobalEventHandler.RaiseErrorOccured(String.Format("Found {0} paths to handle", args.Entries.Count));
            }

            reqstore.QueryInfo.CurrentResultEventType = QUERY_RESULT_EVENT_TYPE.IS_PARTIAL;

            int cnt = 0;

            foreach (SearchResultEntry entry in args.Entries)
            {
                cnt++;

                if ((cnt == args.Entries.Count) && (!reqstore.MoreData))
                {
                    reqstore.QueryInfo.CurrentResultEventType = QUERY_RESULT_EVENT_TYPE.NONE;
                }

                Query(reqstore.DC,
                      entry.DistinguishedName,
                      reqstore.LdapFilter,
                      reqstore.Attributes,
                      SearchScope.Base,
                      reqstore.ReferralChasing,
                      reqstore.QueryInfo);

                GlobalEventHandler.RaiseErrorOccured(String.Format("Subsequent query: #{0}", cnt));
            }
        }
Пример #6
0
        private void HandleNesting(object sender, GlobalEventArgs args)
        {
            EventValue gval = args.Values.GetValueSafe("Group");

            string groupsid = gval.GetTypedValue <string>();

            EventValue mval = args.Values.GetValueSafe("Member");

            SidInfo member = (SidInfo)mval.GetTypedValue <object>();

            if (!this.SidList.Contains(groupsid))
            {
                this.Members.Add(member);

                this.SidList.Add(member.Sid);

                GlobalEventHandler.RaiseNestingFound(this.Sid, member);
            }
        }
Пример #7
0
        private void SettingChanged(object settingName, GlobalEventArgs args)
        {
            if (LoadingGui)
            {
                return;
            }

            object ctrlval = this.GetPropertyValue(settingName.ToString());

            if (args.ObjectVal[0] != ctrlval)
            {
                this.SetPropertyValue(settingName.ToString(), args.ObjectVal[0]);

                string sertext = this.SerializeThis();

                string filepath = GetFilePath();

                sertext.WriteToFile(filepath, false);
            }
        }
Пример #8
0
        public void ReceivedCancellation(object sender, GlobalEventArgs args)
        {
            CancelToken = true;

            GlobalEventHandler.SearchCancelled -= ReceivedCancellation;
        }