Delete

IFrameCollection.Delete metodu: Nesneleri koleksiyondan siler

Nesneleri koleksiyondan siler

Ad alanı: Scada.AddIn.Contracts.Frame

Assembly: Scada.AddIn.Contracts (Scada.AddIn.Contracts.dll içinde) Version=16.0.0.0

C#

                  bool Delete(
    string identification
)

Parametreler

identification (Tip: String)

Dönüş değeri

Tip: Boolean

'Template' nesnesini 'Templates' koleksiyonundan siler.

OrtamKullanılabilirlik
Engineering StudioKullanılabilir
Service EngineKullanılmaz
C#

                  using System;
using Scada.AddIn.Contracts;
using Scada.AddIn.Contracts.Frame;

namespace Samples
{
    [AddInExtension("Frame.FrameCollection.Delete", "Wizard to delete a frame", "Samples")]
    public class EditorWizardExtension_Frame_FrameCollection_Delete : IEditorWizardExtension
    {
        public void Run(IEditorApplication context, IBehavior behavior)
        {
            if (context.Workspace.ActiveProject == null)
            {
                context.DebugPrint("No reference to an active zenon project", DebugPrintStyle.Error);
                return;
            }

            IProject activeProject = context.Workspace.ActiveProject;

            IFrame tempFrame = activeProject.FrameCollection["Add-In Frame"];

            if (tempFrame == null)
            {
                activeProject.FrameCollection.Create("Add-In Frame", true);
            }

            bool result = activeProject.FrameCollection.Delete("Add-In Frame");

            if (result)
            {
                context.DebugPrint("Frame was deleted!", DebugPrintStyle.Standard);
            }
            else
            {
                context.DebugPrint("Frame couldn't be deleted!", DebugPrintStyle.Standard);
            }
        }
    }
}
Bu sayfa, COPA-DATA zenon 16 çevrimiçi yardımının Türkçe çevirisidir. Menü ve ayar adları, programdaki gibi bulmanız için İngilizce bırakılmıştır.