示例#1
0
 public void OnEnumChange(ChangeEventArgs e, PropertyInfo prop)
 {
     if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition() == typeof(Nullable <>))
     {
         if (e.Value.ToString() == "None")
         {
             prop.SetValue(currentComponent.ThisComponent, null);
         }
         else
         {
             prop.SetValue(currentComponent.ThisComponent, Enum.Parse(prop.PropertyType.GetGenericArguments()[0], e.Value.ToString()));
         }
     }
     else
     {
         prop.SetValue(currentComponent.ThisComponent, Enum.Parse(prop.PropertyType, e.Value.ToString()));
     }
     if (Parent != null)
     {
         Parent.Refresh();
     }
     else if (ParentGroup != null)
     {
         ParentGroup.Refresh();
     }
     else
     {
         this.StateHasChanged();
     }
 }
示例#2
0
        public void DetachSelf(bool keepChildren)
        {
            if (ParentGroup == null)
            {
                return;
            }

            if (IsLeafNode && ParentGroup.ParentGroup != null && ParentGroup.ChildGroups.Count < 2)
            {
                ParentGroup.DetachSelf(false);
            }
            else
            {
                ParentGroup.ChildGroups.Remove(this);

                if (keepChildren)
                {
                    foreach (var child in ChildGroups)
                    {
                        ParentGroup.AddOrJoinBlockGroup(child);
                    }
                }

                ParentGroup = null;
            }
        }
示例#3
0
        public void ParentGroup()
        {
            IQueryable <ParentGroup> ParentGroupCollection = Enumerable.Empty <ParentGroup>().AsQueryable();
            ParentGroup pg = new ParentGroup {
                ParentGroupID = 1, ParentGroupName = "Test PG"
            };

            Mock <IParentGroupRepository> ParentGroupService = new Mock <IParentGroupRepository>();

            try
            {
                ParentGroupService.Setup(x => x.GetAll()).Returns(ParentGroupCollection);
                ParentGroupService.Setup(x => x.Get(It.IsAny <int>())).Returns(pg);
                ParentGroupService.Setup(x => x.Add(It.IsAny <ParentGroup>())).Returns(pg);

                var ParentGroupObject = ParentGroupService.Object;
                var p1 = ParentGroupObject.GetAll();
                var p2 = ParentGroupObject.Get(1);

                Assert.IsAssignableFrom <IQueryable <ParentGroup> >(p1);
                Assert.IsAssignableFrom <ParentGroup>(p2);
                Assert.Equal("Test PG", p2.ParentGroupName);

                ParentGroupObject.Dispose();
            }
            finally
            {
                ParentGroupService = null;
            }
        }
示例#4
0
 private void OnEmpty()
 {
     if (ParentGroup != null)
     {
         ParentGroup.OnChildGroupEmpty(this);
     }
 }
        private void FinishSetupToPlay()
        {
            if (!VarAudio.isPlaying && VarAudio.time > 0f)
            {
                // paused. Do nothing except Play
            }
            else if (useFades && (fadeInTime > 0f || fadeOutTime > 0f))
            {
                fadeMaxVolume = _maxVol;

                if (fadeInTime > 0f)
                {
                    VarAudio.volume = 0f;
                }

                if (VariationUpdater != null)
                {
                    VariationUpdater.enabled = true;
                    VariationUpdater.FadeInOut();
                }
            }

            VarAudio.loop = AudioLoops;
            // restore original loop setting in case it got lost by loop setting code below for a previous play.

            if (_playSndParam.IsPlaying && (_playSndParam.IsChainLoop || _playSndParam.IsSingleSubscribedPlay))
            {
                VarAudio.loop = false;
            }

            if (!_playSndParam.IsPlaying)
            {
                return; // has already been "stop" 'd.
            }

            ParentGroup.AddActiveAudioSourceId(InstanceId);

            if (VariationUpdater != null)
            {
                VariationUpdater.enabled = true;
                VariationUpdater.WaitForSoundFinish(_playSndParam.DelaySoundTime);
            }

            _attachToSource = false;

            var useClipAgePriority = MasterAudio.Instance.prioritizeOnDistance &&
                                     (MasterAudio.Instance.useClipAgePriority || ParentGroup.useClipAgePriority);

            if (!_playSndParam.AttachToSource && !useClipAgePriority)
            {
                return;
            }
            _attachToSource = _playSndParam.AttachToSource;

            if (VariationUpdater != null)
            {
                VariationUpdater.FollowObject(_attachToSource, ObjectToFollow, useClipAgePriority);
            }
        }
示例#6
0
 /// <summary>
 /// Refreshes this node by first calling <see cref="Clear"/>, then reconsidering all items
 /// belonging to the parent node for membership in this node.
 /// </summary>
 protected virtual void Refresh()
 {
     Clear();
     if (ParentGroup != null)
     {
         AddItems(ParentGroup.GetItems());
     }
 }
示例#7
0
        /// <summary>
        /// This method allows you to stop the audio being played by this Variation.
        /// </summary>
        /// <param name="stopEndDetection">Do not ever pass this in.</param>
        /// <param name="skipLinked">Do not ever pass this in.</param>
        public void Stop(bool stopEndDetection = false, bool skipLinked = false)
        {
            var waitStopped = false;

            if (stopEndDetection || _isWaitingForDelay)
            {
                if (VariationUpdater != null)
                {
                    VariationUpdater.StopWaitingForFinish(); // turn off the chain loop endless repeat
                    waitStopped = true;
                }
            }

            if (!skipLinked)
            {
                PlayEndLinkedGroups();
            }

            _objectToFollow      = null;
            _objectToTriggerFrom = null;
            ParentGroup.RemoveActiveAudioSourceId(InstanceId);
            MasterAudio.StopTrackingOcclusionForSource(GameObj);

            VarAudio.Stop();

            VarAudio.time = 0f;
            if (VariationUpdater != null)
            {
                VariationUpdater.StopFollowing();
                VariationUpdater.StopFading();
            }

            if (!waitStopped)
            {
                if (VariationUpdater != null)
                {
                    VariationUpdater.StopWaitingForFinish();
                }
            }

            _playSndParam.IsPlaying = false;

            if (SoundFinished != null)
            {
                var willAbort = _previousSoundFinishedFrame == AudioUtil.FrameCount;
                _previousSoundFinishedFrame = AudioUtil.FrameCount;

                if (!willAbort)
                {
                    SoundFinished();  // parameters aren't used
                }
                SoundFinished = null; // clear it out so subscribers don't have to clean up
            }

            Trans.localPosition = Vector3.zero;

            MaybeUnloadClip();
        }
示例#8
0
        public void SyncFromPowerBI(PBIAPIClient powerBiAPI = null)
        {
            if (powerBiAPI == null)
            {
                if (ParentPowerBIAPI == null)
                {
                    throw new Exception("No PowerBI API Object was supplied!");
                }
                else
                {
                    powerBiAPI = ParentPowerBIAPI;
                }
            }

            PBIDataset temp;

            try
            {
                if (string.IsNullOrEmpty(this.Id))
                {
                    if (ParentGroup == null)
                    {
                        temp = powerBiAPI.GetDatasetByName(this.Name);
                    }
                    else
                    {
                        temp = ParentGroup.GetDatasetByName(this.Name);
                    }
                }
                else
                if (ParentGroup == null)
                {
                    temp = powerBiAPI.GetDatasetByID(this.Id);
                }
                else
                {
                    temp = ParentGroup.GetDatasetByID(this.Id);
                }

                if (temp != null)
                {
                    this.Id = temp.Id;
                    this.AddRowsAPIEnabled  = temp.AddRowsAPIEnabled;
                    this.ConfiguredBy       = temp.ConfiguredBy;
                    this.DefaultMode        = temp.DefaultMode;
                    this.Relationships      = temp.Relationships;
                    this.Datasources        = temp.Datasources;
                    this.GatewayDatasources = temp.GatewayDatasources;

                    this.LoadTablesFromPowerBI();
                    this.LoadDatasourcesFromPowerBI();
                }
            }
            catch (Exception e)
            {
            }
        }
示例#9
0
        private void OnItemRemoved(object sender, ListEventArgs <T> e)
        {
            OnItemRemoved(e.Item);

            if (ParentGroup != null)
            {
                ParentGroup.OnChildItemRemoved(e.Item);
            }
        }
示例#10
0
        public void Unassign()
        {
            if (ParentGroup == null)
            {
                return;
            }

            ParentGroup.RemoveLight(this);
            ParentGroup = null;
        }
示例#11
0
 protected void OnAllocationChanged()
 {
     if (ParentGroup != null)
     {
         ParentGroup.OnAllocationChanged();
     }
     else
     {
         AllocationChanged?.Invoke(this, EventArgs.Empty);
     }
 }
        public void SyncFromPowerBI(PBIAPIClient powerBiAPI = null)
        {
            if (powerBiAPI == null)
            {
                if (ParentPowerBIAPI == null)
                {
                    throw new Exception("No PowerBI API Object was supplied!");
                }
                else
                {
                    powerBiAPI = ParentPowerBIAPI;
                }
            }

            PBIDataset temp;

            try
            {
                if (string.IsNullOrEmpty(this.Id))
                {
                    if (ParentGroup == null)
                    {
                        temp = powerBiAPI.GetDatasetByName(this.Name);
                    }
                    else
                    {
                        temp = ParentGroup.GetDatasetByName(this.Name);
                    }
                }
                else
                if (ParentGroup == null)
                {
                    temp = powerBiAPI.GetDatasetByID(this.Id);
                }
                else
                {
                    temp = ParentGroup.GetDatasetByID(this.Id);
                }

                if (temp != null)
                {
                    this.Id = temp.Id;
                    this.AddRowsAPIEnabled = temp.AddRowsAPIEnabled;

                    foreach (PBITable table in temp.Tables)
                    {
                        this.AddOrUpdateTable(table);
                    }
                }
            }
            catch (Exception e)
            {
            }
        }
示例#13
0
        public override void Process()
        {
            try
            {
                var source = DataManager.I.RequestRecordById <AdmsSource>(Name);
                if (source == null)
                {
                    Warn("Source does not exist in ADMS db");
                }
                else
                {
                    string basekV = Node.Attribute(IdfDeviceBasekV).Value;

                    Node.SetAttributeValue(IdfSourcePosSeqX, source[AdmsSourcePosSeqX]);
                    Node.SetAttributeValue(IdfSourcePosSeqR, source[AdmsSourcePosSeqR]);
                    Node.SetAttributeValue(IdfSourceZeroSeqX, source[AdmsSourceZeroSeqX]);
                    Node.SetAttributeValue(IdfSourceZeroSeqR, source[AdmsSourceZeroSeqR]);
                    Node.SetAttributeValue(IdfSourcePhase1Angle, source[AdmsSourcePhase1Angle]);
                    Node.SetAttributeValue(IdfSourcePhase2Angle, source[AdmsSourcePhase2Angle]);
                    Node.SetAttributeValue(IdfSourcePhase3Angle, source[AdmsSourcePhase3Angle]);
                    Node.SetAttributeValue(IdfDeviceVoltageType, IdfSourceVoltageTypeLL);

                    XElement x = new XElement(IdfEl);
                    x.SetAttributeValue(IdfElementType, IdfElementTypeScada);
                    x.SetAttributeValue(IdfElementId, Id);
                    //these should be phase voltages
                    double v = double.Parse(basekV);
                    v /= Math.Sqrt(3);
                    x.SetAttributeValue(IdfDeviceVoltageReference, v.ToString("F2"));

                    var p1Voltage = DataManager.I.RequestRecordByColumn <OsiScadaAnalog>(ScadaName, source[AdmsSourcePhase1VoltageRef], SearchMode.Exact);
                    if (p1Voltage != null)
                    {
                        x.SetAttributeValue(IdfDeviceP1kV, p1Voltage.Key);
                    }
                    var p2Voltage = DataManager.I.RequestRecordByColumn <OsiScadaAnalog>(ScadaName, source[AdmsSourcePhase2VoltageRef], SearchMode.Exact);
                    if (p2Voltage != null)
                    {
                        x.SetAttributeValue(IdfDeviceP2kV, p2Voltage.Key);
                    }
                    var p3Voltage = DataManager.I.RequestRecordByColumn <OsiScadaAnalog>(ScadaName, source[AdmsSourcePhase3VoltageRef], SearchMode.Exact);
                    if (p3Voltage != null)
                    {
                        x.SetAttributeValue(IdfDeviceP3kV, p3Voltage.Key);
                    }
                    ParentGroup.AddGroupElement(x);
                }
                Program.Enricher.Model.AddSource(Node, ParentGroup.Id);
            }
            catch (Exception ex)
            {
                Fatal($"Uncaught exception: {ex.Message}");
            }
        }
示例#14
0
 public virtual bool IsNextToMargin(Gtk.PositionType margin, bool visibleOnly)
 {
     if (ParentGroup == null)
     {
         return(true);
     }
     if (!ParentGroup.IsNextToMargin(margin, visibleOnly))
     {
         return(false);
     }
     return(ParentGroup.IsChildNextToMargin(margin, this, visibleOnly));
 }
示例#15
0
 public void Update(GroupResponse?other)
 {
     if (other is null)
     {
         return;
     }
     if (!Detail.DeepEquals(other.Detail))
     {
         Detail.Update(other.Detail);
         OnPropertyChanged(nameof(Detail));
     }
     if (!Founder.DeepEquals(other.Founder))
     {
         Founder.Update(other.Founder);
         OnPropertyChanged(nameof(Founder));
     }
     if (!AlliedIds.DeepEqualsListNaive(other.AlliedIds))
     {
         AlliedIds = other.AlliedIds;
         OnPropertyChanged(nameof(AlliedIds));
     }
     if (!ParentGroup.DeepEquals(other.ParentGroup))
     {
         ParentGroup.Update(other.ParentGroup);
         OnPropertyChanged(nameof(ParentGroup));
     }
     if (AllianceStatus != other.AllianceStatus)
     {
         AllianceStatus = other.AllianceStatus;
         OnPropertyChanged(nameof(AllianceStatus));
     }
     if (GroupJoinInviteCount != other.GroupJoinInviteCount)
     {
         GroupJoinInviteCount = other.GroupJoinInviteCount;
         OnPropertyChanged(nameof(GroupJoinInviteCount));
     }
     if (CurrentUserMembershipsInactiveForDestiny != other.CurrentUserMembershipsInactiveForDestiny)
     {
         CurrentUserMembershipsInactiveForDestiny = other.CurrentUserMembershipsInactiveForDestiny;
         OnPropertyChanged(nameof(CurrentUserMembershipsInactiveForDestiny));
     }
     if (!CurrentUserMemberMap.DeepEqualsDictionary(other.CurrentUserMemberMap))
     {
         CurrentUserMemberMap = other.CurrentUserMemberMap;
         OnPropertyChanged(nameof(CurrentUserMemberMap));
     }
     if (!CurrentUserPotentialMemberMap.DeepEqualsDictionary(other.CurrentUserPotentialMemberMap))
     {
         CurrentUserPotentialMemberMap = other.CurrentUserPotentialMemberMap;
         OnPropertyChanged(nameof(CurrentUserPotentialMemberMap));
     }
 }
示例#16
0
        public bool GetDockTarget(DockItem item, int px, int py, Gdk.Rectangle rect, out DockDelegate dockDelegate, out Gdk.Rectangle outrect)
        {
            dockDelegate = null;

            if (item != this.item && this.item.Visible && rect.Contains(px, py))
            {
                int          xdockMargin = (int)((double)rect.Width * (1.0 - DockFrame.ItemDockCenterArea)) / 2;
                int          ydockMargin = (int)((double)rect.Height * (1.0 - DockFrame.ItemDockCenterArea)) / 2;
                DockPosition pos;

                /*				if (ParentGroup.Type == DockGroupType.Tabbed) {
                 *                                  rect = new Gdk.Rectangle (rect.X + xdockMargin, rect.Y + ydockMargin, rect.Width - xdockMargin*2, rect.Height - ydockMargin*2);
                 *                                  pos = DockPosition.CenterAfter;
                 *                          }
                 */
                if (px <= rect.X + xdockMargin && ParentGroup.Type != DockGroupType.Horizontal)
                {
                    outrect = new Gdk.Rectangle(rect.X, rect.Y, xdockMargin, rect.Height);
                    pos     = DockPosition.Left;
                }
                else if (px >= rect.Right - xdockMargin && ParentGroup.Type != DockGroupType.Horizontal)
                {
                    outrect = new Gdk.Rectangle(rect.Right - xdockMargin, rect.Y, xdockMargin, rect.Height);
                    pos     = DockPosition.Right;
                }
                else if (py <= rect.Y + ydockMargin && ParentGroup.Type != DockGroupType.Vertical)
                {
                    outrect = new Gdk.Rectangle(rect.X, rect.Y, rect.Width, ydockMargin);
                    pos     = DockPosition.Top;
                }
                else if (py >= rect.Bottom - ydockMargin && ParentGroup.Type != DockGroupType.Vertical)
                {
                    outrect = new Gdk.Rectangle(rect.X, rect.Bottom - ydockMargin, rect.Width, ydockMargin);
                    pos     = DockPosition.Bottom;
                }
                else
                {
                    outrect = new Gdk.Rectangle(rect.X + xdockMargin, rect.Y + ydockMargin, rect.Width - xdockMargin * 2, rect.Height - ydockMargin * 2);
                    pos     = DockPosition.Center;
                }

                dockDelegate = delegate(DockItem dit)
                {
                    DockGroupItem it = ParentGroup.AddObject(dit, pos, Id);
                    it.SetVisible(true);
                    ParentGroup.FocusItem(it);
                };
                return(true);
            }
            outrect = Gdk.Rectangle.Zero;
            return(false);
        }
        public void MaybeChain()
        {
            if (_hasStartedNextInChain)
            {
                return;
            }

            _hasStartedNextInChain = true;

            var playSnd = GrpVariation.PlaySoundParm;

            var clipsRemaining = MasterAudio.RemainingClipsInGroup(ParentGroup.GameObjectName);
            var totalClips     = MasterAudio.VoicesForGroup(ParentGroup.GameObjectName);

            if (clipsRemaining == totalClips)
            {
                ParentGroup.FireLastVariationFinishedPlay();
            }

            // check if loop count is over.
            if (ParentGroup.chainLoopMode == MasterAudioGroup.ChainedLoopLoopMode.NumberOfLoops && ParentGroup.ChainLoopCount >= ParentGroup.chainLoopNumLoops)
            {
                // done looping
                return;
            }

            var rndDelay = playSnd.DelaySoundTime;

            if (ParentGroup.chainLoopDelayMin > 0f || ParentGroup.chainLoopDelayMax > 0f)
            {
                rndDelay = Random.Range(ParentGroup.chainLoopDelayMin, ParentGroup.chainLoopDelayMax);
            }

            // cannot use "AndForget" methods! Chain loop needs to check the status.
            if (playSnd.AttachToSource || playSnd.SourceTrans != null)
            {
                if (playSnd.AttachToSource)
                {
                    MasterAudio.PlaySound3DFollowTransform(playSnd.SoundType, playSnd.SourceTrans,
                                                           playSnd.VolumePercentage, playSnd.Pitch, rndDelay, null, _clipSchedEndTime, true);
                }
                else
                {
                    MasterAudio.PlaySound3DAtTransform(playSnd.SoundType, playSnd.SourceTrans, playSnd.VolumePercentage,
                                                       playSnd.Pitch, rndDelay, null, _clipSchedEndTime, true);
                }
            }
            else
            {
                MasterAudio.PlaySound(playSnd.SoundType, playSnd.VolumePercentage, playSnd.Pitch, rndDelay, null, _clipSchedEndTime, true);
            }
        }
示例#18
0
 public bool DeepEquals(GroupResponse?other)
 {
     return(other is not null &&
            (Detail is not null ? Detail.DeepEquals(other.Detail) : other.Detail is null) &&
            (Founder is not null ? Founder.DeepEquals(other.Founder) : other.Founder is null) &&
            AlliedIds.DeepEqualsListNaive(other.AlliedIds) &&
            (ParentGroup is not null ? ParentGroup.DeepEquals(other.ParentGroup) : other.ParentGroup is null) &&
            AllianceStatus == other.AllianceStatus &&
            GroupJoinInviteCount == other.GroupJoinInviteCount &&
            CurrentUserMembershipsInactiveForDestiny == other.CurrentUserMembershipsInactiveForDestiny &&
            CurrentUserMemberMap.DeepEqualsDictionary(other.CurrentUserMemberMap) &&
            CurrentUserPotentialMemberMap.DeepEqualsDictionary(other.CurrentUserPotentialMemberMap));
 }
    public void FinishSetupToPlay()
    {
        timesLocationUpdated = 0;

        if (!VarAudio.isPlaying && VarAudio.time > 0f)
        {
            // paused. Do nothing except Play
        }
        else if (useFades && (fadeInTime > 0f || fadeOutTime > 0f))
        {
            fadeMaxVolume   = _maxVol;
            VarAudio.volume = 0f;
            StartCoroutine(FadeInOut());
        }

        VarAudio.loop = this.audioLoops;         // restore original loop setting in case it got lost by loop setting code below for a previous play.

        if (playSndParams != null && (playSndParams.isChainLoop || playSndParams.isSingleSubscribedPlay))
        {
            VarAudio.loop = false;
        }

        if (playSndParams == null)
        {
            return; // has already been "stop" 'd.
        }

        ParentGroup.AddActiveAudioSourceId(InstanceId);

        StartCoroutine(DetectSoundFinished(playSndParams.delaySoundTime));

        attachToSource = false;

        bool useClipAgePriority = MasterAudio.Instance.prioritizeOnDistance && (MasterAudio.Instance.useClipAgePriority || ParentGroup.useClipAgePriority);

        if (playSndParams.attachToSource || useClipAgePriority)
        {
            attachToSource = playSndParams.attachToSource;
            if (ObjectToFollow != null)
            {
                if (ObjectToFollow.root.GetInstanceID() == MasterAudio.ListenerID)
                {
                    AudioUpdater updater = gameObject.AddComponent <AudioUpdater>();
                    updater.FollowTransform = ObjectToFollow;
                    attachToSource          = false;            // Do not modify playParams as the sound group may contain more variations
                    ObjectToFollow          = null;
                }
            }
            StartCoroutine(FollowSoundMaker());
        }
    }
示例#20
0
        public IActionResult Create([FromBody] ParentGroup newmodel)
        {
            if (ModelState.IsValid)
            {
                _context.ParentGroup.Add(newmodel);
                _context.SaveChanges();

                return(CreatedAtRoute("GetParentGroup", new { id = newmodel.ParentGroupID }, newmodel));
            }
            else
            {
                return(BadRequest());
            }
        }
 public void Reduce()
 {
     if (ParentGroup != null && dockObjects.Count == 1)
     {
         DockObject obj = dockObjects [0];
         int        n   = ParentGroup.GetObjectIndex(this);
         ParentGroup.dockObjects [n] = obj;
         obj.ParentGroup             = ParentGroup;
         obj.CopySizeFrom(this);
         dockObjects.Clear();
         ResetVisibleGroups();
         ParentGroup.ResetVisibleGroups();
     }
 }
        /// <summary>
        /// This method allows you to stop the audio being played by this Variation.
        /// </summary>
        public void Stop(bool stopEndDetection = false)
        {
            var waitStopped = false;

            if (stopEndDetection || _isWaitingForDelay)
            {
                if (VariationUpdater != null)
                {
                    VariationUpdater.StopWaitingForFinish(); // turn off the chain loop endless repeat
                    waitStopped = true;
                }
            }

            _objectToFollow      = null;
            _objectToTriggerFrom = null;
            ParentGroup.RemoveActiveAudioSourceId(InstanceId);

            VarAudio.Stop();

            VarAudio.time = 0f;
            if (VariationUpdater != null)
            {
                VariationUpdater.StopFollowing();
                VariationUpdater.StopFading();
            }

            if (!waitStopped)
            {
                if (VariationUpdater != null)
                {
                    VariationUpdater.StopWaitingForFinish();
                }
            }

            _playSndParam.IsPlaying = false;

            if (SoundFinished != null)
            {
                var willAbort = _previousSoundFinishedFrame == Time.frameCount;
                _previousSoundFinishedFrame = Time.frameCount;

                if (!willAbort)
                {
                    SoundFinished();  // parameters aren't used
                }
                SoundFinished = null; // clear it out so subscribers don't have to clean up
            }

            MaybeUnloadClip();
        }
        internal void UpdateVisible(DockObject child)
        {
            visibleObjects = null;
            bool visChanged;

            CalcNewSizes();
            MarkForRelayout();

            visChanged = child.Visible ? VisibleObjects.Count == 1 : VisibleObjects.Count == 0;

            if (visChanged && ParentGroup != null)
            {
                ParentGroup.UpdateVisible(this);
            }
        }
示例#24
0
        private void UpdateCheckState()
        {
            // update all children:
            if (ChildGroups.Count != 0)
            {
                UpdateChildrenCheckState();
            }

            // update parent item
            if (ParentGroup != null)
            {
                var parentIsChecked = ParentGroup.DetermineCheckState();
                ParentGroup.IsChecked = parentIsChecked;
            }
        }
        public void Remove(DockObject obj)
        {
            dockObjects.Remove(obj);
            Reduce();
            obj.ParentGroup = null;
            visibleObjects  = null;

            if (VisibleObjects.Count > 0)
            {
                CalcNewSizes();
                MarkForRelayout();
            }
            else
            {
                ParentGroup.UpdateVisible(this);
            }
        }
示例#26
0
        protected override void InternalProcessRecord()
        {
            try
            {
                ShouldProcessReason reason;
                bool whatIf = false;
                if (!base.ShouldProcess(null, null, null, out reason))
                {
                    if (reason == ShouldProcessReason.WhatIf)
                    {
                        whatIf         = true;
                        Logger.Verbose = true;
                    }
                }
                Logger.Write("Start Time: {0}", DateTime.Now.ToString());

                ImportTerms import = new ImportTerms(_xml, whatIf);

                switch (ParameterSetName)
                {
                case "TaxonomySession":
                    import.Import(TaxonomySession.Read());
                    break;

                case "TermStore":
                    import.Import(ParentTermStore.Read());
                    break;

                case "Group":
                    import.Import(ParentGroup.Read());
                    break;

                case "TermSet":
                    import.Import(ParentTermSet.Read());
                    break;

                case "Term":
                    import.Import(ParentTerm.Read());
                    break;
                }
            }
            finally
            {
                Logger.Write("Finish Time: {0}", DateTime.Now.ToString());
            }
        }
示例#27
0
        public bool Equals(GroupResponse input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Detail == input.Detail ||
                     (Detail != null && Detail.Equals(input.Detail))
                     ) &&
                 (
                     Founder == input.Founder ||
                     (Founder != null && Founder.Equals(input.Founder))
                 ) &&
                 (
                     AlliedIds == input.AlliedIds ||
                     (AlliedIds != null && AlliedIds.SequenceEqual(input.AlliedIds))
                 ) &&
                 (
                     ParentGroup == input.ParentGroup ||
                     (ParentGroup != null && ParentGroup.Equals(input.ParentGroup))
                 ) &&
                 (
                     AllianceStatus == input.AllianceStatus ||
                     (AllianceStatus != null && AllianceStatus.Equals(input.AllianceStatus))
                 ) &&
                 (
                     GroupJoinInviteCount == input.GroupJoinInviteCount ||
                     (GroupJoinInviteCount.Equals(input.GroupJoinInviteCount))
                 ) &&
                 (
                     CurrentUserMembershipsInactiveForDestiny == input.CurrentUserMembershipsInactiveForDestiny ||
                     (CurrentUserMembershipsInactiveForDestiny != null && CurrentUserMembershipsInactiveForDestiny.Equals(input.CurrentUserMembershipsInactiveForDestiny))
                 ) &&
                 (
                     CurrentUserMemberMap == input.CurrentUserMemberMap ||
                     (CurrentUserMemberMap != null && CurrentUserMemberMap.SequenceEqual(input.CurrentUserMemberMap))
                 ) &&
                 (
                     CurrentUserPotentialMemberMap == input.CurrentUserPotentialMemberMap ||
                     (CurrentUserPotentialMemberMap != null && CurrentUserPotentialMemberMap.SequenceEqual(input.CurrentUserPotentialMemberMap))
                 ));
        }
示例#28
0
        public override string ToString()
        {
            if (ParentGroup == null)
            {
                return(string.Empty);
            }

            var outputString = (Advanced ? "~" : string.Empty) + GroupName;

            var parentOutput = ParentGroup.ToString();

            if (!string.IsNullOrWhiteSpace(parentOutput))
            {
                outputString = parentOutput + (IsLeafNode ? string.Empty : " - " + outputString);
            }

            return(outputString);
        }
        protected override void ProcessRecord()
        {
            if (!base.ShouldProcess("Import"))
            {
                return;
            }

            var ctx = base.Context;

            Validate();
            try
            {
                WriteVerbose(string.Format("Start Time: {0}", DateTime.Now.ToString()));

                ImportTermsHelper import = new ImportTermsHelper(this, ctx, _xml);

                switch (ParameterSetName)
                {
                case "Tenant":
                    import.Import();
                    break;

                case "TermStore":
                    import.Import(ParentTermStore.Read());
                    break;

                case "Group":
                    import.Import(ParentGroup.Read());
                    break;

                case "TermSet":
                    import.Import(ParentTermSet.Read());
                    break;

                case "Term":
                    import.Import(ParentTerm.Read());
                    break;
                }
            }
            finally
            {
                WriteVerbose(string.Format("Finish Time: {0}", DateTime.Now.ToString()));
            }
        }
示例#30
0
 internal void SetVisible(bool value)
 {
     if (visibleFlag != value)
     {
         visibleFlag = value;
         if (visibleFlag)
         {
             item.ShowWidget();
         }
         else
         {
             item.HideWidget();
         }
         if (ParentGroup != null)
         {
             ParentGroup.UpdateVisible(this);
         }
     }
 }