예제 #1
0
    void ReadElementsFromXml(EwsServiceXmlReader reader)
    {
        this.ClientExtensions.Clear();
        base.ReadElementsFromXml(reader);

        reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.ClientExtensions);

        if (!reader.IsEmptyElement)
        {
            // Because we don't have an element for count of returned object,
            // we have to test the element to determine if it is StartElement of return object or EndElement
            reader.Read();

            while (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.ClientExtension))
            {
                ClientExtension clientExtension = new ClientExtension();
                clientExtension.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ClientExtension);
                this.ClientExtensions.Add(clientExtension);

                reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Types, XmlElementNames.ClientExtension);
                reader.Read();
            }

            reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Messages, XmlElementNames.ClientExtensions);
        }

        reader.Read();
        if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.ClientExtensionRawMasterTableXml))
        {
            this.rawMasterTableXml = reader.ReadElementValue();
        }
    }
     : super()
 {
     this.Namespace = XmlNamespace.Types;
     this.setClientExtensionActionId = setClientExtensionActionId;
     this.extensionId     = extensionId;
     this.clientExtension = clientExtension;
 }
예제 #3
0
        public static async Task StartDev(TelegramBotClient client, Telegram.Bot.Types.Message message, string baseAdress, string port)
        {
            using (var host = new HttpClient())
            {
                ClientExtension.PrepareHeaderForJenkins(host);
                var lastBuild = await ParseJson.ResponseJson <JenkisBuildJson>(host, $"http://{baseAdress}:{port}/job/first/lastBuild/api/json");

                var result = await host.GetAsync($"http://{baseAdress}:{port}/job/first/build?token=someAuthorizationFuckingTocketThatICantFindWhereToGenerate");

                JenkisBuildJson resId;
                do
                {
                    Thread.Sleep(1000);
                    resId = await ParseJson.ResponseJson <JenkisBuildJson>(host, $"http://{baseAdress}:{port}/job/first/lastBuild/api/json");
                } while (lastBuild.number == resId.number);
                if (resId.result != null && resId.result.Equals("SUCCESS"))
                {
                    await client.SendTextMessageAsync(message.Chat.Id, $"Готово, билд{resId.displayName}");
                }
                else
                {
                    await client.SendTextMessageAsync(message.Chat.Id, $"Что то пошло не так:(, билд{resId.displayName}");
                }
            }
        }
예제 #4
0
 // Token: 0x06000B53 RID: 2899 RVA: 0x0002DE04 File Offset: 0x0002C004
 internal static void ConfigureOrgExtension(string domain, string extensionId, bool isEnabled, bool isMandatory, bool isEnabledByDefault, ClientExtensionProvidedTo providedTo, string[] specificUsers)
 {
     OrgExtensionTable.ExecuteWebServicesAction(delegate
     {
         OrgExtensionTable.RequestData arg = new OrgExtensionTable.RequestData();
         ExchangeService exchangeService   = OrgExtensionTable.CreateExchangeServiceDelegate(domain, arg);
         if (exchangeService == null)
         {
             return;
         }
         ClientExtension clientExtension = new ClientExtension(0, 0, null, null, null, isEnabled, isMandatory, isEnabledByDefault, providedTo, (specificUsers == null) ? null : new StringList(specificUsers), string.Empty, string.Empty);
         exchangeService.SetClientExtension(new List <SetClientExtensionAction>
         {
             new SetClientExtensionAction(2, extensionId, clientExtension)
         });
     });
 }
예제 #5
0
 // Token: 0x06000B52 RID: 2898 RVA: 0x0002DD30 File Offset: 0x0002BF30
 internal static void SetOrgExtension(string domain, SetClientExtensionActionId actionId, string extensionId, ExtensionData extensionData)
 {
     OrgExtensionTable.ExecuteWebServicesAction(delegate
     {
         OrgExtensionTable.RequestData arg = new OrgExtensionTable.RequestData();
         ExchangeService exchangeService   = OrgExtensionTable.CreateExchangeServiceDelegate(domain, arg);
         if (exchangeService == null)
         {
             return;
         }
         MemoryStream memoryStream = null;
         XmlWriter xmlWriter       = null;
         try
         {
             ClientExtension clientExtension = null;
             if (extensionData != null)
             {
                 memoryStream = new MemoryStream();
                 xmlWriter    = new XmlTextWriter(memoryStream, Encoding.UTF8);
                 extensionData.Manifest.WriteTo(xmlWriter);
                 xmlWriter.Flush();
                 memoryStream.Position = 0L;
                 clientExtension       = new ClientExtension(extensionData.Type.Value, extensionData.Scope.Value, memoryStream, extensionData.MarketplaceAssetID, extensionData.MarketplaceContentMarket, extensionData.IsAvailable, extensionData.IsMandatory, extensionData.IsEnabledByDefault, extensionData.ProvidedTo, (extensionData.SpecificUsers == null) ? null : new StringList(extensionData.SpecificUsers), extensionData.AppStatus, extensionData.Etoken);
             }
             exchangeService.SetClientExtension(new List <SetClientExtensionAction>
             {
                 new SetClientExtensionAction(actionId, extensionId, clientExtension)
             });
         }
         finally
         {
             if (xmlWriter != null)
             {
                 xmlWriter.Close();
             }
             if (memoryStream != null)
             {
                 memoryStream.Close();
             }
         }
     });
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SetClientExtensionAction"/> class.
 /// </summary>
 /// <param name="setClientExtensionActionId">Set action such as install, uninstall and configure</param>
 /// <param name="extensionId">ExtensionId, required by configure and uninstall actions</param>
 /// <param name="clientExtension">Extension data object, e.g. required by configure action</param>
 SetClientExtensionAction(
     SetClientExtensionActionId setClientExtensionActionId,
     String extensionId,
     ClientExtension clientExtension)
     : super()