text:
///////////////////////////////////////////////////////////////////////////////
/// \file domain.hpp
/// Contains definition of domain\<\> class template and helpers for
/// defining domains with a generator and a grammar for controlling
/// operator overloading.
//
//  Copyright 2008 Eric Niebler. Distributed under the Boost
//  Software License, Version 1.0. (See accompanying file
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_PROTO_DOMAIN_HPP_EAN_02_13_2007
#define BOOST_PROTO_DOMAIN_HPP_EAN_02_13_2007

#include <boost/ref.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/generate.hpp>

namespace boost { namespace proto
{

    namespace detail
    {
        struct not_a_generator
        {};

        struct not_a_grammar
        {};
    }

    namespace domainns_
    {
        /// \brief For use in defining domain tags to be used
        /// with \c proto::extends\<\>. A \e Domain associates
        /// an expression type with a \e Generator, and optionally
        /// a \e Grammar.
        ///
        /// The Generator determines how new expressions in the
        /// domain are constructed. Typically, a generator wraps
        /// all new expressions in a wrapper that imparts
        /// domain-specific behaviors to expressions within its
        /// domain. (See \c proto::extends\<\>.)
        ///
        /// The Grammar determines whether a given expression is
        /// valid within the domain, and automatically disables
        /// any operator overloads which would cause an invalid
        /// expression to be created. By default, the Grammar
        /// parameter defaults to the wildcard, \c proto::_, which
        /// makes all expressions valid within the domain.
        ///
        /// Example:
        /// \code
        /// template<typename Expr>
        /// struct MyExpr;
        ///
        /// struct MyGrammar
        ///   : or_< terminal<_>, plus<MyGrammar, MyGrammar> >
        /// {};
        ///
        /// // Define MyDomain, in which all expressions are
        /// // wrapped in MyExpr<> and only expressions that
        /// // conform to MyGrammar are allowed.
        /// struct MyDomain
        ///   : domain<generator<MyExpr>, MyGrammar>
        /// {};
        ///
        /// // Use MyDomain to define MyExpr
        /// template<typename Expr>
        /// struct MyExpr
        ///   : extends<Expr, MyExpr<Expr>, MyDomain>
        /// {
        ///     // ...
        /// };
        /// \endcode
        ///
        template<
            typename Generator // = default_generator
          , typename Grammar   // = proto::_
        >
        struct domain
          : Generator
        {
            typedef Generator proto_generator;
            typedef Grammar proto_grammar;

            /// INTERNAL ONLY
            typedef void proto_is_domain_;
        };

        /// \brief The domain expressions have by default, if
        /// \c proto::extends\<\> has not been used to associate
        /// a domain with an expression.
        ///
        struct default_domain
          : domain<>
        {};

        /// \brief A pseudo-domain for use in functions and
        /// metafunctions that require a domain parameter. It
        /// indicates that the domain of the parent node should
        /// be inferred from the domains of the child nodes.
        ///
        /// \attention \c deduce_domain is not itself a valid domain.
        ///
        struct deduce_domain
          : domain<detail::not_a_generator, detail::not_a_grammar>
        {};
    }

    namespace result_of
    {
        /// A metafunction that returns \c mpl::true_
        /// if the type \c T is the type of a Proto domain;
        /// \c mpl::false_ otherwise. If \c T inherits from
        /// \c proto::domain\<\>, \c is_domain\<T\> is
        /// \c mpl::true_.
        template<typename T, typename Void  /* = void*/>
        struct is_domain
          : mpl::false_
        {};

        /// INTERNAL ONLY
        ///
        template<typename T>
        struct is_domain<T, typename T::proto_is_domain_>
          : mpl::true_
        {};

        /// A metafunction that returns the domain of
        /// a given type. If \c T is a Proto expression
        /// type, it returns that expression's associated
        /// domain. If not, it returns
        /// \c proto::default_domain.
        template<typename T, typename Void /* = void*/>
        struct domain_of
        {
            typedef default_domain type;
        };

        /// INTERNAL ONLY
        ///
        template<typename T>
        struct domain_of<T, typename T::proto_is_expr_>
        {
            typedef typename T::proto_domain type;
        };

        /// INTERNAL ONLY
        ///
        template<typename T>
        struct domain_of<T &, void>
        {
            typedef typename domain_of<T>::type type;
        };

        /// INTERNAL ONLY
        ///
        template<typename T>
        struct domain_of<boost::reference_wrapper<T>, void>
        {
            typedef typename domain_of<T>::type type;
        };

        /// INTERNAL ONLY
        ///
        template<typename T>
        struct domain_of<boost::reference_wrapper<T> const, void>
        {
            typedef typename domain_of<T>::type type;
        };
    }
}}

#endif


text:
package tommy.naivedemos.a04_ble.rxjava;

/**
 * @author : Tommy
 * 中央设备是否对低功耗蓝牙的支持与中央设备是否
 */

public interface BleSupportListener {

    void onNoSupportListener();

    void onBtDisableListener();
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * Hardware Composer Test Library Header
 */

#include <sstream>
#include <string>

#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>

#include <utils/Log.h>
#include <testUtil.h>

#include <hardware/hwcomposer.h>

// Characteristics of known graphic formats
const struct hwcTestGraphicFormat {
    uint32_t format;
    const char *desc;
    uint32_t wMod, hMod; // Width/height mod this value must equal zero
} hwcTestGraphicFormat[] = {
    {HAL_PIXEL_FORMAT_RGBA_8888, "RGBA8888", 1, 1},
    {HAL_PIXEL_FORMAT_RGBX_8888, "RGBX8888", 1, 1},
    {HAL_PIXEL_FORMAT_RGB_888,   "RGB888",   1, 1},
    {HAL_PIXEL_FORMAT_RGB_565,   "RGB565",   1, 1},
    {HAL_PIXEL_FORMAT_BGRA_8888, "BGRA8888", 1, 1},
    {HAL_PIXEL_FORMAT_YV12,      "YV12",     2, 2},
};

// Represent RGB color as fraction of color components.
// Each of the color components are expected in the range [0.0, 1.0]
class ColorFract {
  public:
    ColorFract(): _c1(0.0), _c2(0.0), _c3(0.0) {};
    ColorFract(float c1, float c2, float c3): _c1(c1), _c2(c2), _c3(c3) {};
    float c1(void) const { return _c1; }
    float c2(void) const { return _c2; }
    float c3(void) const { return _c3; }

    operator std::string();

  private:
    float _c1;
    float _c2;
    float _c3;
};

// Represent RGB color as fraction of color components.
// Each of the color components are expected in the range [0.0, 1.0]
class ColorRGB {
  public:
    ColorRGB(): _r(0.0), _g(0.0), _b(0.0) {};
    ColorRGB(float f): _r(f), _g(f), _b(f) {}; // Gray
    ColorRGB(float r, float g, float b): _r(r), _g(g), _b(b) {};
    float r(void) const { return _r; }
    float g(void) const { return _g; }
    float b(void) const { return _b; }

  private:
    float _r;
    float _g;
    float _b;
};

// Dimension - width and height of a rectanguler area
class HwcTestDim {
  public:
    HwcTestDim(): _w(0), _h(0) {};
    HwcTestDim(uint32_t w, uint32_t h) : _w(w), _h(h) {}
    uint32_t width(void) const { return _w; }
    uint32_t height(void) const { return _h; }
    void setWidth(uint32_t w) { _w = w; }
    void setHeight(uint32_t h) { _h = h; }

    operator std::string();
    operator hwc_rect() const;

  private:
    uint32_t _w;
    uint32_t _h;
};

// Function Prototypes
void hwcTestInitDisplay(bool verbose, EGLDisplay *dpy, EGLSurface *surface,
    EGLint *width, EGLint *height);
void hwcTestOpenHwc(hwc_composer_device_1_t **hwcDevicePtr);
const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(const char *desc);
const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(uint32_t id);
const char *hwcTestGraphicFormat2str(uint32_t format);
std::string hwcTestRect2str(const struct hwc_rect& rect);

hwc_display_contents_1_t *hwcTestCreateLayerList(size_t numLayers);
void hwcTestFreeLayerList(hwc_display_contents_1_t *list);
void hwcTestDisplayList(hwc_display_contents_1_t *list);
void hwcTestDisplayListPrepareModifiable(hwc_display_contents_1_t *list);
void hwcTestDisplayListHandles(hwc_display_contents_1_t *list);

uint32_t hwcTestColor2Pixel(uint32_t format, ColorFract color, float alpha);
void hwcTestColorConvert(uint32_t fromFormat, uint32_t toFormat,
                  ColorFract& color);
void hwcTestSetPixel(android::GraphicBuffer *gBuf, unsigned char *buf,
                     uint32_t x, uint32_t y, uint32_t pixel);
void hwcTestFillColor(android::GraphicBuffer *gBuf, ColorFract color,
                      float alpha);
void hwcTestFillColorHBlend(android::GraphicBuffer *gBuf,
                            uint32_t colorFormat,
                            ColorFract startColor, ColorFract endColor);
ColorFract hwcTestParseColor(std::istringstream& in, bool& error);
struct hwc_rect hwcTestParseHwcRect(std::istringstream& in, bool& error);
HwcTestDim hwcTestParseDim(std::istringstream& in, bool& error);


text:
package org.teavm.ast;

public interface MethodNodeVisitor {
    void visit(RegularMethodNode methodNode);

    void visit(AsyncMethodNode methodNode);
}


text:
export {};
export {};
//# sourceMappingURL=rx-storage.d.js.map


text:
#ifndef EX_TRANSACTION_H
#define EX_TRANSACTION_H
/* -*-C++-*-
 *****************************************************************************
 *
 * File:         ex_transaction.h
 * Description:  TCB/TDB for transaction-related SQL statements
 *               and ExTransaction object that represents a TMF transaction
 *
 * Created:      7/10/95
 * Language:     C++
 *
 *
 *
 *
 *****************************************************************************
 */

// -----------------------------------------------------------------------

#include "ex_stdh.h"
#include "ComTdb.h"
#include "ex_tcb.h"
#include  "ex_error.h"

#include "Int64.h"

struct TmfPhandle_Struct {
  short  Data[10];
};

class CliGlobals;

class ExTransaction : public NABasicObject
{
public:
  ExTransaction(CliGlobals * cliGlob, CollHeap *heap);
  virtual ~ExTransaction();

  //////////////////////////////////////////////////////////////
  // Methods to perform transaction related operations.
  // Used for explicit (called by application via cli calls)
  // and implicit (called internally when a statement requires
  // a transaction and one is not already running) transaction
  // operations.
  //////////////////////////////////////////////////////////////
  short beginTransaction();
  short suspendTransaction();
  short resumeTransaction();

  //////////////////////////////////////////////////////////////
  // RollbackStatement ALWAYS rollbacks Xn. Used unless stmt
  // atomicity support is in.
  // RollbackTransaction
  // only rollbacks if executor started the Xn.
  //////////////////////////////////////////////////////////////
  short rollbackStatement();
  short rollbackTransaction(NABoolean isWaited = FALSE);
  short rollbackTransactionWaited();
  short doomTransaction();
  short waitForRollbackCompletion(Int64 transid);

  void cleanupTransaction();
  short commitTransaction(NABoolean waited = FALSE);
  short waitForCommitCompletion(Int64 transid);

  short inheritTransaction();
  short validateTransaction();
  short setProcessTransToContextTrans
    (TmfPhandle_Struct * oldProcessTransId, /* out */
     NABoolean & processTransactionChanged /* out */);
  short resetProcessTrans(TmfPhandle_Struct * oldProcessTransId);

  NABoolean xnInProgress()	{ return xnInProgress_; }
  TransMode * getTransMode()	{ return transMode_; }
  TransMode * getUserTransMode();
  TransMode * getTransModeNext(){ return &transModeNext_; }
  short setTransMode(TransMode * trans_mode);

  // Soln 10-050210-4624
  /* This method retrieves from TMF and returns the TCBREF associated with the
   * currently active transaction. If the optional parameters, transId and
   * txHandle, are supplied, the transaction identifier and handle also are
   * returned.
   */
  short getCurrentXnId(Int64 *tcbref,
		       Int64 *transId = 0, short *txHandle = NULL);

  short getCurrentTxHandle(short * txHandle);

  // this method returns the current Xn Id as known to executor.
  Int64 getExeXnId()		{ return exeXnId_; }

  // Soln 10-050210-4624
  // This method returns the id of the current transaction.
  Int64 getTransid()            { return transid_;}

  // this method returns the current savepoint id, if dp2 savepoint is
  // being used for this stmt. -1, if they are not.
  Int64 getSavepointId()        { return savepointId_; }
  // this method generates a savepoint id. Its a juliantimestamp, for now.
  // If a transaction is not in progress, no savepoint id is generated.
  void  generateSavepointId();

  NABoolean exeStartedXn() 	{ return exeStartedXn_; }

  NABoolean exeStartedXnDuringRecursiveCLICall()
    { return exeStartedXnDuringRecursiveCLICall_; }

  NABoolean &implicitXn() 	{ return implicitXn_; }

  NABoolean userEndedExeXn() 	{ return userEndedExeXn_; }

  void setTransId(Int64 transid);
  void disableAutoCommit();
  void enableAutoCommit();

  // returns TRUE, if auto commit is on. Otherwise, returns FALSE.
  NABoolean autoCommit()
  {
    if ((transMode_) &&
	(transMode_->autoCommit() == TransMode::ON_))
      return TRUE;
    else
      return FALSE;
  }

 // returns TRUE, if multi commit is on. Otherwise, returns FALSE.
  NABoolean multiCommit()
  {
    if ((transMode_) &&
	(transMode_->multiCommit() == TransMode::MC_ON_))
      return TRUE;
    else
      return FALSE;
  }

  ComDiagsArea *getDiagsArea() {return transDiagsArea_;}
  inline CliGlobals *getCliGlobals() { return cliGlob_;}

  void updateROVal(Int16 roval)
  {
   roVal_ = roval;
  }
  Int16 getROVal()            { return roVal_;}

  void updateRBVal(Int16 rbval)
  {
   rbVal_ = rbval;
  }
  Int16 getRBVal()            { return rbVal_;}

  void updateAIVal(Int32 aival)
  {
   aiVal_ = aival;
  }
  Int32 getAIVal()            { return aiVal_;}

  void setMayAlterDb(NABoolean x)
  {
    mayAlterDb_ = x;
  }

  NABoolean mayAlterDb()  { return mayAlterDb_; }

  void setMayHoldLock(NABoolean x)
  {
    mayHoldLock_ = x;
  }

  NABoolean mayHoldLock()  { return mayHoldLock_; }

  void setDp2Xns(NABoolean x)
  {
    dp2Xns_ = x;
  }

  NABoolean dp2Xns()  { return dp2Xns_; }

  void resetXnState();

private:

  // pointer to executor globals. Used to get to the open
  // cursor list. This list is needed to close all open
  // cursors at commit/rollback time.
  CliGlobals * cliGlob_;

  // transaction attributes
  TransMode * transMode_;

  // user transaction attributes that may be different to default trans mode
  TransMode * userTransMode_;

  TransMode   transModeNext_;	// mode to use AFTER this trans completes
                                // (see ComTdbControl.cpp)

  // Diagnostics Area for the transaction operation.
  // The transaction methods such as beginTransaction()... can be
  // called by the cli directly. This member is provided to
  // hold the diagnostics for such callers, who's request
  // are not sent thro' the conventional down queues.
  ComDiagsArea *transDiagsArea_;
  ComCondition* errorCond_;
  CollHeap* heap_;

  short local_or_encompassing_trans;

  // if a transaction is/was in progress from executor's point of view.
  // This may not be the current transaction.
  NABoolean xnInProgress_;

  // TRUE, if executor started the transaction.
  NABoolean exeStartedXn_;

  // The next flag is set if the executor started this transaction
  // during a recursive call (e.g. a metadata lookup or resource
  // fork read during fixup). Such implicitly started transactions
  // must be committed before returning from the top-level CLI
  // call, otherwise data integrity problems could result in
  // multi-context applications.
  NABoolean exeStartedXnDuringRecursiveCLICall_;

  // TRUE, if executor started the transaction implicitely.
  // FALSE, if the app started Xn by calling CLI or by starting
  // it in the application.
  NABoolean implicitXn_;

  // set to TRUE, if user application ended (committed/aborted/started)
  // an executor started Xn (xnInProgress_ is TRUE).
  // According to ANSI, only a SQL agent that started the XN can
  // end it.
  // Exe will stay in this state until user application 'ends' the
  // transaction by calling SQL commit/rollback.
  NABoolean userEndedExeXn_;

  // transaction id as known to executor, if a Xn is running.
  // Otherwise, set to -1.
  Int64 exeXnId_;

  // Soln 10-050210-4624
  // The actual transaction id as known to the executor. Note that exeXnId_ is
  // actually the TCBREF associated with the transaction. exeXnId_ will be used
  // in all the messaging with DP2, MXCMP and MXESP.
  // This field will be used for interacting with TMF.
  Int64 transid_;

  Int64 savepointId_;

  TmfPhandle_Struct exeTxHandle_;

  // set to TRUE, if the autoCommit mode was temporarily
  // disabled because a BEGIN WORK statement was issued.
  NABoolean autoCommitDisabled_;

  // If a volatile schema already exists when this transaction is started,
  // remember that.
  // if a volatile schema was created after this transaction was started,
  // and this transaction is aborted, then this flag is used to reset the
  // volatile schema state in executor and mxcmp.
  NABoolean volatileSchemaExists_;

  // Creates the diagsArea for the caller. This also sets
  // the optional integer and optional string for the diagnostics
  // area.
  void createDiagsArea(Int32 error, Int32 retCode, const char *string);

  Int16 roVal_;
  Int16 rbVal_;
  Int32 aiVal_;

  // Two flags that help track whether a transaction can be suspended.
  NABoolean mayAlterDb_;
  NABoolean mayHoldLock_;

  // if set to TRUE, then dp2 transactions are allowed. DP2 transactions
  // are currently allowed for single row unique queries which are being
  // executed in auto commit mode. It could be either implicit autocommit
  // where exe commits the Xn at the end, or explicit autocommit mode where
  // the app commits the Xn after each stmt.
  // If they are allowed, then their use is determined in PartitionAccess
  // operator based on other conditions.
  NABoolean dp2Xns_;
  int transtag_;
};

///////////////////////////////////////////////////////
// class ExTransTdb
///////////////////////////////////////////////////////
#include "ComTdbTransaction.h"

// -----------------------------------------------------------------------
// Classes defined in this file
// -----------------------------------------------------------------------
class ExTransTdb;

// -----------------------------------------------------------------------
// Classes referenced in this file
// -----------------------------------------------------------------------
class ex_tcb;

// -----------------------------------------------------------------------
// ExTransTdb
// -----------------------------------------------------------------------
class ExTransTdb : public ComTdbTransaction
{
public:

  // ---------------------------------------------------------------------
  // Constructor is only called to instantiate an object used for
  // retrieval of the virtual table function pointer of the class while
  // unpacking. An empty constructor is enough.
  // ---------------------------------------------------------------------
  NA_EIDPROC ExTransTdb()
  {}

  NA_EIDPROC virtual ~ExTransTdb()
  {}

  // ---------------------------------------------------------------------
  // Build a TCB for this TDB. Redefined in the Executor project.
  // ---------------------------------------------------------------------
  NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);

private:
  // ---------------------------------------------------------------------
  // !!!!!!! IMPORTANT -- NO DATA MEMBERS ALLOWED IN EXECUTOR TDB !!!!!!!!
  // *********************************************************************
  // The Executor TDB's are only used for the sole purpose of providing a
  // way to supplement the Compiler TDB's (in comexe) with methods whose
  // implementation depends on Executor objects. This is done so as to
  // decouple the Compiler from linking in Executor objects unnecessarily.
  //
  // When a Compiler generated TDB arrives at the Executor, the same data
  // image is "cast" as an Executor TDB after unpacking. Therefore, it is
  // a requirement that a Compiler TDB has the same object layout as its
  // corresponding Executor TDB. As a result of this, all Executor TDB's
  // must have absolutely NO data members, but only member functions. So,
  // if you reach here with an intention to add data members to a TDB, ask
  // yourself two questions:
  //
  // 1. Are those data members Compiler-generated?
  //    If yes, put them in the ComTdbTransaction instead.
  //    If no, they should probably belong to someplace else (like TCB).
  //
  // 2. Are the classes those data members belong defined in the executor
  //    project?
  //    If your answer to both questions is yes, you might need to move
  //    the classes to the comexe project.
  // ---------------------------------------------------------------------
};

//
// Task control block
//
class ExTransTcb : public ex_tcb
{
  friend class ExTransTdb;
  friend class ExTransPrivateState;

public:
  enum Step
  {
    EMPTY_,
    PROCESSING_,
    DONE_,
    CANCELLED_
  };

  ExTransTcb(const ExTransTdb & trans_tdb,
	    ex_globals * glob = 0);

  ~ExTransTcb();

  virtual short work();
// warning elimination (removed "inline")
  ex_queue_pair getParentQueue() const{return qparent_;};
  inline Int32 orderedQueueProtocol() const{return ((const ExTransTdb &)tdb).orderedQueueProtocol();}

  void freeResources(){};  // LCOV_EXCL_LINE Code not used

  Int32 numChildren() const { return 0; }

  const ex_tcb* getChild(Int32 /*pos*/) const { return 0; }  // LCOV_EXCL_LINE Code not used

private:
  ex_queue_pair	qparent_;

  atp_struct *workAtp_;

  inline ExTransTdb & transTdb() const{return (ExTransTdb &) tdb;};
  inline ex_expr * diagAreaSizeExpr() const
  { return transTdb().diagAreaSizeExpr_; };

  // if diagsArea is not NULL, then its error code is used.
  // Otherwise, err is used to handle error.
  void handleErrors(ex_queue_entry *pentry_down,
		    ComDiagsArea* diagsArea,
		    ExeErrorCode err = EXE_INTERNAL_ERROR);
};

class ExTransPrivateState : public ex_tcb_private_state
{
  friend class ExTransTcb;

public:
  ExTransPrivateState(const ExTransTcb * tcb); //constructor
  ~ExTransPrivateState();	// destructor
  ex_tcb_private_state * allocate_new(const ex_tcb * tcb);

private:
  ExTransTcb::Step step_;

};

#endif


text:
package com.quixote;

import android.content.Context;

public class Library {

    public static String getHelloMessage(Context context) {
        return context.getString(R.string.hello);
    }

}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18408
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace S22.Imap.Test.Properties {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("S22.Imap.Test.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to attr.zip.
        /// </summary>
        internal static string AttachmentName {
            get {
                return ResourceManager.GetString("AttachmentName", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Byte[].
        /// </summary>
        internal static byte[] GifContent {
            get {
                object obj = ResourceManager.GetObject("GifContent", resourceCulture);
                return ((byte[])(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to * LIST (\HasNoChildren) "/" "INBOX"
        ///* LIST (\Noselect \HasChildren) "/" "[Gmail]"
        ///* LIST (\HasChildren \HasNoChildren \All) "/" "[Gmail]/&A4wDuwOx- &A8QDsQ- &A7wDtwO9A80DvAOxA8QDsQ-"
        ///* LIST (\HasNoChildren \Junk) "/" "[Gmail]/&A5EDvQO1A8ADuQO4A80DvAO3A8QDsQ-"
        ///* LIST (\HasChildren \HasNoChildren \Sent) "/" "[Gmail]/&A5EDwAO1A8MDxAOxA7sDvAOtA70DsQ-"
        ///* LIST (\HasChildren \HasNoChildren \Trash) "/" "[Gmail]/&A5oDrAO0A78Dwg- &A7EDwAO,A8EDwQO5A7wDvAOsA8QDyQO9-"
        ///* LIST (\HasNoChildren \Flagged) "/" "[Gmail]/ [rest of string was truncated]";.
        /// </summary>
        internal static string ImapListResponse {
            get {
                return ResourceManager.GetString("ImapListResponse", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to MLAXXX_XX.Mu-lti+sub@s_u-b.nifty.com.
        /// </summary>
        internal static string MailFromAddress {
            get {
                return ResourceManager.GetString("MailFromAddress", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Hiroyuki Tanaka, Japan.
        /// </summary>
        internal static string MailFromName {
            get {
                return ResourceManager.GetString("MailFromName", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to From: "Hiroyuki Tanaka, Japan" <MLAXXX_XX.Mu-lti+sub@s_u-b.nifty.com>
        ///Subject: =?iso-2022-jp?B?GyRCIVpFbEZ8S1xCZz9MOlIhWxsoQg==?=
        ///	=?iso-2022-jp?B?GyRCRWw1fklwQiJMbkI/S2AlLyVpJVYkTjxoQUgkXyFWJF8bKEI=?=
        ///	=?iso-2022-jp?B?GyRCJHMkSiRHJEQkSiQsJG0kJiEhMjszWiROGyhCV0E=?=
        ///	=?iso-2022-jp?B?IRskQiFXJVclbSU4JSclLyVIGyhC?=
        ///Date: Fri, 8 Jul 2011 21:45:55 +0900
        ///MIME-Version: 1.0
        ///Content-Type: multipart/alternative;
        ///	boundary="----=_NextPart_000_0202_01CC3DB8.948199A0"
        ///Priority: Urgent
        ///X-Priority: 6
        ///X-MSMail-P [rest of string was truncated]";.
        /// </summary>
        internal static string MailHeader {
            get {
                return ResourceManager.GetString("MailHeader", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to 【東日本大震災】東京武蔵野多摩クラブの取組み「みんなでつながろう 音楽のWA!」プロジェクト.
        /// </summary>
        internal static string MailSubject {
            get {
                return ResourceManager.GetString("MailSubject", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to iso-2022-jp.
        /// </summary>
        internal static string MailSubjectEncoding {
            get {
                return ResourceManager.GetString("MailSubjectEncoding", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Date: Sun, 10 Nov 2002 23:54:21 +0800
        ///MIME-Version: 1.0
        ///Content-Type: text/plain;
        ///	name="=?koi8-r?B?1MXT1C50eHQ=?="
        ///Content-Transfer-Encoding: 7bit
        ///Content-Disposition: attachment;
        ///	filename="=?koi8-r?B?1MXT1C50eHQ=?="
        ///
        ///This is an attachment. See issue #28.
        ///.
        /// </summary>
        internal static string MailWithEncodedAttachmentName {
            get {
                return ResourceManager.GetString("MailWithEncodedAttachmentName", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to X-UIDL-JANA-SERVER: 255392621.1369491686@Jana-Server
        ///From: "Systemadministrator"
        ///Sender: "Systemadministrator"
        ///To: broxi@lcoalmail.loc
        ///Subject: Unzustellbar: test
        ///Date: Sat, 25 May 2013 16:21:24 +0200
        ///Message-ID:
        ///MIME-Version: 1.0
        ///Content-Type: application/ms-tnef; name="winmail.dat"
        ///Content-Transfer-Encoding: base64
        ///Content-Disposition: attachment; filename="winmail.dat"
        ///X-Mailer: Microsoft Outlook 15.0
        ///Thread-Index: AQIWacilbO2h+QbxaliA6L/xOzdkTQ==
        ///
        ///Hello World. See issue #50.
        ///
        ///.
        /// </summary>
        internal static string MailWithInvalidFromHeader {
            get {
                return ResourceManager.GetString("MailWithInvalidFromHeader", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Return-Path: <example_from@dc.edu>
        ///X-SpamCatcher-Score: 1 [X]
        ///Received: from [136.167.40.119] (HELO dc.edu)
        ///	by fe3.dc.edu (CommuniGate Pro SMTP 4.1.8)
        ///	with ESMTP-TLS id 61258719 for example_to@mail.dc.edu; Mon, 23 Aug 2004 11:40:10 -0400
        ///Message-ID: <4129F3CA.2020509@dc.edu>
        ///Date: Mon, 23 Aug 2005 11:40:36 -0400
        ///From: "Taylor (John) Evans" <example_from@dc.edu>
        ///User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
        ///X-Accept-Language: en-us, en
        ///MIME-Vers [rest of string was truncated]";.
        /// </summary>
        internal static string MailWithMIMEComments {
            get {
                return ResourceManager.GetString("MailWithMIMEComments", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to From: "xxxxxxx" <xxxxxxx@ms19.hinet.net>
        ///To: "=?big5?B?pUS3UqTAqMm69A==?=" <xxxxxxx@ms19.hinet.net>
        ///Subject: =?big5?B?tbmvuKr4qrqkQKvKq0g=?=
        ///Date: Sun, 10 Nov 2002 23:54:21 +0800
        ///MIME-Version: 1.0
        ///Content-Type: multipart/related;
        ///	boundary="----=_NextPart_000_000A_01C28914.95B89B50";
        ///	type="multipart/alternative"
        ///X-Priority: 3
        ///X-MSMail-Priority: Normal
        ///X-Unsent: 1
        ///X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
        ///
        ///This is a multi-part message in MIME format.
        ///
        ///------=_NextPart_000_000A_ [rest of string was truncated]";.
        /// </summary>
        internal static string MailWithMultipleParts {
            get {
                return ResourceManager.GetString("MailWithMultipleParts", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Received: from xxx.xxxxx.com (xx.xxxx.com [123.45.67.89])
        ///	by xxxx.asxxx.se (Postfix) with ESMTP id E357F2CCC6A
        ///	for <faktxxx@xxxxxx.se>; Thu,  7 Feb 2013 17:12:05 +0100 (CET)
        ///MIME-Version: 1.0
        ///From: <invxxxxx@xxxxx.com>
        ///To: <faktxxx@xxxxxx.se>
        ///Date: Thu, 7 Feb 2013 17:12:02 +0100
        ///Subject: Fakt__xxxx___xxxx___07_02_2013
        ///Content-Type: multipart/mixed;
        ///	boundary="--boundary_0_6cb33448-390c-4f02-b75a-2738f1d6dd45"
        ///Message-ID: <44967f46-57cc-47c4-ab9f-1c450e1d87bb@XXXXI0123.xx.xxxx.com>
        ///
        ///----boundar [rest of string was truncated]";.
        /// </summary>
        internal static string MailWithoutDisposition {
            get {
                return ResourceManager.GetString("MailWithoutDisposition", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Return-Path: <xxxxxxx@canon.no>
        ///Received: from mail-gtw.canon.no (mail.canon.no [194.248.71.4])
        ///	by mail29.nsc.no (8.9.3p2/8.9.3) with ESMTP id LAA17991
        ///	for <xxxxxxxx@online.no>; Fri, 4 Jul 2003 11:07:01 +0200 (MEST)
        ///From: "Helpdesk/NL-NOTES,.CANON"@canon.no
        ///Sensitivity:
        ///Subject: =?ISO-8859-1?Q?Feil_p=E5_PowerShot_A70?=
        ///To: "Martin Bergersen" <xxxxxxxx@online.no>
        ///X-Mailer: Lotus Notes Release 5.0.11   July 24, 2002
        ///Message-ID: <OFA7E5D94E.E33F8ECB-ONC1256D59.0031C285-C1256D59.0031E75A@canon.no>
        /// [rest of string was truncated]";.
        /// </summary>
        internal static string MailWithQuotedPrintables {
            get {
                return ResourceManager.GetString("MailWithQuotedPrintables", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Return-Path: <foo@example.org>
        ///Delivered-To: bar@example.org
        ///Received: (qmail 2543 invoked from network); 4 Sep 1999 09:27:32 -0000
        ///Received: from deathstar.example.org (HELO deathstar.example.org) (192.168.2.2)
        ///  by tie-fighter.example.org with SMTP; 4 Sep 1999 09:27:31 -0000
        ///MIME-Version: 1.0
        ///Subject: RFC 2231
        ///From: foo <foo@example.org>
        ///To: bar <bar@example.org>
        ///X-Mailer: tie-bomber
        ///Date: Sat, 04 Sep 1999 18:26:50 +0900
        ///Message-ID: <19990904092850.5963.foo@example.org>
        ///Content-Type: multipart/mixed; boun [rest of string was truncated]";.
        /// </summary>
        internal static string MailWithRfc2231Headers {
            get {
                return ResourceManager.GetString("MailWithRfc2231Headers", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Return-Path: <foo@example.org>
        ///Delivered-To: bar@example.org
        ///Received: (qmail 2543 invoked from network); 4 Sep 1999 09:27:32 -0000
        ///Received: from deathstar.example.org (HELO deathstar.example.org) (192.168.2.2)
        ///  by tie-fighter.example.org with SMTP; 4 Sep 1999 09:27:31 -0000
        ///MIME-Version: 1.0
        ///Subject: RFC 2231
        ///From: foo <foo@example.org>
        ///To: bar <bar@example.org>
        ///X-Mailer: tie-bomber
        ///Date: Sat, 04 Sep 1999 18:26:50 +0900
        ///Message-ID: <19990904092850.5963.foo@example.org>
        ///Content-Type: multipart/mixed; boun [rest of string was truncated]";.
        /// </summary>
        internal static string MailWithRfc2231Headers2 {
            get {
                return ResourceManager.GetString("MailWithRfc2231Headers2", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to >From msu.ru!pooh Wed Nov 29 16:17:10 2000 remote from botik
        ///Received: from thicket.nmd.msu.ru([193.232.112.60])
        ///	by pier.botik.ru (Smail-3.2.0.98/botik-0.15 1999-Sep-9 #28) with smtp
        ///	for <xxxxx@botik.ru> id m14176f-002ngXC; Wed, 29 Nov 2000 16:17:05 +0300 (MSK)
        ///Received: (qmail 4233 invoked from network); 29 Nov 2000 13:17:02 -0000
        ///Received: from localhost (HELO msu.ru) (127.0.0.1)
        ///  by localhost with SMTP; 29 Nov 2000 13:17:02 -0000
        ///Message-ID: <3A2501CD.6090804@msu.ru>
        ///Date: Wed, 29 Nov 2000 16: [rest of string was truncated]";.
        /// </summary>
        internal static string MailWithZipAttachment {
            get {
                return ResourceManager.GetString("MailWithZipAttachment", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Produced By Microsoft MimeOLE V6.0.6002.18463.
        /// </summary>
        internal static string MailXMimeOLE {
            get {
                return ResourceManager.GetString("MailXMimeOLE", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Byte[].
        /// </summary>
        internal static byte[] MidiContent {
            get {
                object obj = ResourceManager.GetObject("MidiContent", resourceCulture);
                return ((byte[])(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Hei!
        ///Jeg har nå nylig kjøpt et "PowerShot  A70" digital kamera fra min onkel i
        ///Canon. Det har fungert helt  fint, helt til forige lørdag. Da jeg skrudde
        ///det av, gikk ikke linsen inn  igjen. Og når jeg skrur det på igjen, kommer
        ///"startup" bilde, men så  begynner det å pipe, og viser med beskjeden E18,
        ///og skrur seg  av igjen. Og linsa er fortsatt ute!
        ///Lenger har jeg ikke kommet. Nytter ikke og bytte  batterier, flash card,
        ///eller koble til pc'n. Prøvde å finne et oppslagsverk  etter E18 også, men
        ///forgj [rest of string was truncated]";.
        /// </summary>
        internal static string QuotedPrintableText {
            get {
                return ResourceManager.GetString("QuotedPrintableText", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Byte[].
        /// </summary>
        internal static byte[] ZipAttachment {
            get {
                object obj = ResourceManager.GetObject("ZipAttachment", resourceCulture);
                return ((byte[])(obj));
            }
        }
    }
}


text:
* Use `send(:construct_query)` on object association to get query for associated objects (Fixes #21).
* Added `CONTRIBUTING.md` for Hydra projects.
* Added CSS classes to datastream list table, rows, and columns.
* Added I18n key for display when datastream label is blank.
* Added #safe_pid methods to ActiveFedora::Base and ActiveFedora::Datastream decorators.
* Added tests for datastreams index view.

### 0.6.0 (2013-06-27)

* Feature: Display Solr index record for object.
* Removed Blacklight document show partial from object summary view
* Added models to object properties partial.
* Custom permissions are now set from configuration, not using aliases.
* Minor changes to default labels.

#### 0.5.5 (2013-06-07)

* Upgraded Rubydora to version 1.6.5 (for Rubydora::DigitalObject#object_xml)
* Datastream downloads now routed through FcrpeoAdmin::DownloadController, which uses Hydra::Controller::DownloadBehavior.
* Added fcrepo_admin:ci rake task for CI build and hooked into Travis.

#### 0.5.4 (2013-05-24)

* Changed config setting `associated_objects_sort_param` (v0.5.3) to `association_collection_query_sort_param`.
* Changed config setting `associated_objects_per_page` (v0.5.1) to `association_show_docs_per_page`.

#### 0.5.3 (2013-05-23)

* Added configuration setting `associated_objects_sort_param` to specify Solr query sort clause for retrieving associated objects. Default is `nil`, meaning that no sort clause is used.

#### 0.5.2 (2013-05-22)

* Fixed association show view pagination by working around Kaminari.
* Object XML (FOXML) accessible from object context nav.
* Catalog show document actions displayed in object show view (summary).

#### 0.5.1 (2013-05-21)

* Association show view paginated (Fixes #18).
* Association show view uses blacklight document list rendering.
* Object show action loads Solr document for object and show view incorporates Blacklight document show fields.

### 0.5.0 (2013-05-17)

* Feature: Configurable settings.
* Context navigation menus refactored: customizations now done through helpers and configuration settings, not by overriding partials.
* ActiveFedora::Base and ActiveFedora::Datastream classes extended by decorators.
* Tests added.

#### 0.4.1 (2013-05-14)

* Feature: Datastream history view.
* Feature: Support for asOfDateTime parameter added to datastream read views to display content and profile information for datastream versions.

### 0.4.0 (2013-05-03)

* Feature: Display object's associations.
* Require inclusion of CanCan action aliases in application's Ability class.
* Tabbed object show view ("summary") replaced with separate views.

#### 0.3.5 (2013-04-30)

* Requires active-fedora 6.1.

#### 0.3.4 (2013-04-29)

* Moved FcrepoAdmin::BlacklightHelperBehavior to FcrepoAdmin::Helpers::BlacklightHelperBehavior.
* FcrepoAdmin::ObjectsHelper methods can now be easily overridden.
* FcrepoAdmin::DatastreamsHelper module added.
* Shared helper methods in new module FcrepoAdmin::Helpers::FcrepoAdminHelperBehavior.
* Objects and datastreams controller behaviors are now easily overrideable.
* Refactored object and datastream context navs for greater reusability.

#### 0.3.3 (2013-04-25)

* Audit trail functionality fails gracefully (i.e., if object does not implement ActiveFedora::Auditable)

#### 0.3.2 (2013-04-19)

* Separated datastream and object context navigation menus.
* Added object helpers.

#### 0.3.1 (2013-04-18)

* Object and datastream context nav menus added.
* Audit trail moved into objects controller.

### 0.3.0 (2013-04-16)

* Feature: Permissions and inherited permissions added to object show view.

### 0.2.0 (2013-04-12)

* Feature: Datastream content editing.

### 0.1.0 (2013-04-11)

Initial release to RubyGems.


text:
Pattern: Disabled logging for AWS Elasticsearch domain

Issue: -

## Description

AWS Elasticsearch domain should have logging enabled by default.

**Resolution**: Enable logging for Elasticsearch domains.

## Examples

Example of **incorrect** code:

```terraform
resource "aws_elasticsearch_domain" "example" {
  // other config

  // One of the log_publishing_options has to be AUDIT_LOGS
  log_publishing_options {
    cloudwatch_log_group_arn = aws_cloudwatch_log_group.example.arn
    log_type                 = "INDEX_SLOW_LOGS"
  }
}
```

Example of **correct** code:

```terraform
resource "aws_elasticsearch_domain" "example" {
  // other config

  // At minimum we should have AUDIT_LOGS enabled
  log_publishing_options {
    cloudwatch_log_group_arn = aws_cloudwatch_log_group.example.arn
    log_type                 = "AUDIT_LOGS"
  }
}
```


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Dulcet.Twitter;
using Inscribe.Authentication;
using Inscribe.Common;
using Inscribe.Communication.Posting;
using Inscribe.Communication.UserStreams;
using Inscribe.Configuration;
using Inscribe.Core;
using Inscribe.Storage;
using Inscribe.Subsystems;
using Inscribe.Text;
using Inscribe.ViewModels.Common;
using Inscribe.ViewModels.Dialogs;
using Inscribe.ViewModels.PartBlocks.MainBlock;
using Inscribe.ViewModels.PartBlocks.MainBlock.TimelineChild;
using Livet;
using Livet.Commands;
using Livet.Messaging;
using Nightmare.WinAPI;

namespace Inscribe.ViewModels.PartBlocks.InputBlock
{
    public class InputBlockViewModel : ViewModel
    {
        public MainWindowViewModel Parent { get; private set; }
        public InputBlockViewModel(MainWindowViewModel parent)
        {
            this.Parent = parent;
            this._imageStackingViewViewModel = new ImageStackingViewViewModel();
            this._userSelectorViewModel = new UserSelectorViewModel();
            this._userSelectorViewModel.LinkChanged += () => this.LinkUserChanged(this.UserSelectorViewModel.LinkElements);
            this._inputUserSelectorViewModel = new UserSelectorViewModel();
            this._inputUserSelectorViewModel.LinkChanged += this.inputLinkUserChanged;
            this._intelliSenseTextBoxViewModel = new IntelliSenseTextBoxViewModel();
            this._intelliSenseTextBoxViewModel.TextChanged += (o, e) => invalidateTagBindState();
            this._intelliSenseTextBoxViewModel.TextChanged += (o, e) => RaisePropertyChanged(() => IsDirectMessage);
            this._intelliSenseTextBoxViewModel.TextChanged += (o, e) => RaisePropertyChanged(() => DirectMessageTarget);
            this._intelliSenseTextBoxViewModel.TextChanged += (o, e) => RaisePropertyChanged(() => IsInReplyToEnabled);
            this._intelliSenseTextBoxViewModel.ItemsOpening += (o, e) => _intelliSenseTextBoxViewModel_OnItemsOpening();
            this._intelliSenseTextBoxViewModel.FileDrop += (o, e) => AttachImage(e.FilePath);
            // Listen changing tab
            this.Parent.ColumnOwnerViewModel.CurrentTabChanged += new Action<TabViewModel>(CurrentTabChanged);
            RegisterKeyAssign();
            ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (o, e) =>
            {
                RaisePropertyChanged(() => WorkerViewDockOrientation);
                RaisePropertyChanged(() => PostBoxOpenForeground);
                RaisePropertyChanged(() => PostBoxOpenBackground);
                RaisePropertyChanged(() => PostBoxCloseForeground);
                RaisePropertyChanged(() => PostBoxCloseBackground);
                RaisePropertyChanged(() => PostBoxBorder);
            });
        }

        void CurrentTabChanged(TabViewModel tab)
        {
            this.SetCurrentTab(tab);
        }

        UserSelectorViewModel _userSelectorViewModel;
        public UserSelectorViewModel UserSelectorViewModel
        {
            get { return _userSelectorViewModel; }
        }

        UserSelectorViewModel _inputUserSelectorViewModel;
        public UserSelectorViewModel InputUserSelectorViewModel
        {
            get { return _inputUserSelectorViewModel; }
        }

        private void inputLinkUserChanged()
        {
            if (Setting.Instance.InputExperienceProperty.IsEnabledTemporarilyUserSelection)
            {
                this.OverrideTarget(this.InputUserSelectorViewModel.LinkElements);
            }
            else
            {
                this.LinkUserChanged(this.InputUserSelectorViewModel.LinkElements);
            }
        }

        ImageStackingViewViewModel _imageStackingViewViewModel;
        public ImageStackingViewViewModel ImageStackingViewViewModel
        {
            get { return _imageStackingViewViewModel; }
        }

        #region View layout and coloring

        public Dock WorkerViewDockOrientation
        {
            get { return Setting.Instance.InputExperienceProperty.ShowInputBlockInBottom ? Dock.Top : Dock.Bottom; }
        }

        public Brush PostBoxOpenForeground
        {
            get { return Setting.Instance.ColoringProperty.PostBoxOpenForeground.GetBrush(); }
        }

        public Brush PostBoxOpenBackground
        {
            get { return Setting.Instance.ColoringProperty.PostBoxOpenBackground.GetBrush(); }
        }

        public Brush PostBoxCloseForeground
        {
            get { return Setting.Instance.ColoringProperty.PostBoxCloseForeground.GetBrush(); }
        }

        public Brush PostBoxCloseBackground
        {
            get { return Setting.Instance.ColoringProperty.PostBoxCloseBackground.GetBrush(); }
        }

        public Brush PostBoxBorder
        {
            get { return Setting.Instance.ColoringProperty.PostBoxBorder.GetBrush(); }
        }

        #endregion

        #region MenuItems

        #region ShowConfigCommand
        ViewModelCommand _ShowConfigCommand;

        public ViewModelCommand ShowConfigCommand
        {
            get
            {
                if (_ShowConfigCommand == null)
                    _ShowConfigCommand = new ViewModelCommand(ShowConfig);
                return _ShowConfigCommand;
            }
        }

        public void ShowConfig()
        {
            var vm = new SettingViewModel();
            Messenger.Raise(new TransitionMessage(vm, "ShowConfig"));
        }
        #endregion

        #region CreateNewColumnCommand
        ViewModelCommand _CreateNewColumnCommand;

        public ViewModelCommand CreateNewColumnCommand
        {
            get
            {
                if (_CreateNewColumnCommand == null)
                    _CreateNewColumnCommand = new ViewModelCommand(CreateNewColumn);
                return _CreateNewColumnCommand;
            }
        }

        private void CreateNewColumn()
        {
            var col = this.Parent.ColumnOwnerViewModel.CreateColumn();
            col.AddNewTabCommand.Execute();
        }
        #endregion

        #region CreateNewTabCommand
        ViewModelCommand _CreateNewTabCommand;

        public ViewModelCommand CreateNewTabCommand
        {
            get
            {
                if (_CreateNewTabCommand == null)
                    _CreateNewTabCommand = new ViewModelCommand(CreateNewTab);
                return _CreateNewTabCommand;
            }
        }

        private void CreateNewTab()
        {
            this.Parent.ColumnOwnerViewModel.CurrentFocusColumn.AddNewTabCommand.Execute();
        }
        #endregion

        #region CollectTabsCommand
        ViewModelCommand _CollectTabsCommand;

        public ViewModelCommand CollectTabsCommand
        {
            get
            {
                if (_CollectTabsCommand == null)
                    _CollectTabsCommand = new ViewModelCommand(CollectTabs);
                return _CollectTabsCommand;
            }
        }

        private void CollectTabs()
        {
            var tabs = this.Parent.ColumnOwnerViewModel.Columns
                .SelectMany(cvm =>
                    cvm.TabItems.ToArray().Select(t =>
                    {
                        cvm.RemoveTab(t);
                        return t;
                    })).ToArray();
            var nc = this.Parent.ColumnOwnerViewModel.CreateColumn();
            tabs.ForEach(t => nc.AddTab(t));
            this.Parent.ColumnOwnerViewModel.GCColumn();
        }
        #endregion

        #region ClearClosedTabStackCommand
        ViewModelCommand _ClearClosedTabStackCommand;

        public ViewModelCommand ClearClosedTabStackCommand
        {
            get
            {
                if (_ClearClosedTabStackCommand == null)
                    _ClearClosedTabStackCommand = new ViewModelCommand(ClearClosedTabStack);
                return _ClearClosedTabStackCommand;
            }
        }

        private void ClearClosedTabStack()
        {
            this.Parent.ColumnOwnerViewModel.ClearClosedTab();
        }
        #endregion

        #region ShowAssignViewerCommand
        ViewModelCommand _ShowAssignViewerCommand;

        public ViewModelCommand ShowAssignViewerCommand
        {
            get
            {
                if (_ShowAssignViewerCommand == null)
                    _ShowAssignViewerCommand = new ViewModelCommand(ShowAssignViewer);
                return _ShowAssignViewerCommand;
            }
        }

        private void ShowAssignViewer()
        {
            Messenger.Raise(new TransitionMessage("ShowAssignViewer"));
        }
        #endregion

        #region ReconnectStreamsCommand
        ViewModelCommand _ReconnectStreamsCommand;

        public ViewModelCommand ReconnectStreamsCommand
        {
            get
            {
                if (_ReconnectStreamsCommand == null)
                    _ReconnectStreamsCommand = new ViewModelCommand(ReconnectStreams);
                return _ReconnectStreamsCommand;
            }
        }

        private void ReconnectStreams()
        {
            Task.Factory.StartNew(() => ConnectionManager.RefreshReceivers());
        }
        #endregion

        #region RefreshIndividualInfoCommand
        ViewModelCommand _RefreshIndividualInfoCommand;

        public ViewModelCommand RefreshIndividualInfoCommand
        {
            get
            {
                if (_RefreshIndividualInfoCommand == null)
                    _RefreshIndividualInfoCommand = new ViewModelCommand(RefreshIndividualInfo);
                return _RefreshIndividualInfoCommand;
            }
        }

        private void RefreshIndividualInfo()
        {
            Task.Factory.StartNew(() =>
            {
                using (var n = NotifyStorage.NotifyManually("アカウント情報を取得、更新しています..."))
                {
                    AccountStorage.Accounts.ForEach(i => Communication.UserInformationManager.ReceiveInidividualInfo(i));
                }
            });
        }
        #endregion

        #region ClearImageCachesCommand
        ViewModelCommand _ClearImageCachesCommand;

        public ViewModelCommand ClearImageCachesCommand
        {
            get
            {
                if (_ClearImageCachesCommand == null)
                    _ClearImageCachesCommand = new ViewModelCommand(ClearImageCaches);
                return _ClearImageCachesCommand;
            }
        }

        private void ClearImageCaches()
        {
            ImageCacheStorage.ClearAllCache();
        }
        #endregion

        #region ShowAboutCommand
        ViewModelCommand _ShowAboutCommand;

        public ViewModelCommand ShowAboutCommand
        {
            get
            {
                if (_ShowAboutCommand == null)
                    _ShowAboutCommand = new ViewModelCommand(ShowAbout);
                return _ShowAboutCommand;
            }
        }

        private void ShowAbout()
        {
            Messenger.Raise(new TransitionMessage("ShowAbout"));
        }
        #endregion

        #region ShowTwitterStatusCommand
        ViewModelCommand _ShowTwitterStatusCommand;

        public ViewModelCommand ShowTwitterStatusCommand
        {
            get
            {
                if (_ShowTwitterStatusCommand == null)
                    _ShowTwitterStatusCommand = new ViewModelCommand(ShowTwitterStatus);
                return _ShowTwitterStatusCommand;
            }
        }

        private void ShowTwitterStatus()
        {
            Browser.Start(TwitterDefine.TwitterApiStatusUrl);
        }
        #endregion

        #region FeedbackCommand
        ViewModelCommand _FeedbackCommand;

        public ViewModelCommand FeedbackCommand
        {
            get
            {
                if (_FeedbackCommand == null)
                    _FeedbackCommand = new ViewModelCommand(Feedback);
                return _FeedbackCommand;
            }
        }

        private void Feedback()
        {
            Browser.Start(Define.FeedbackUrl);
        }
        #endregion

        #region AboutKampaCommand
        ViewModelCommand _AboutKampaCommand;

        public ViewModelCommand AboutKampaCommand
        {
            get
            {
                if (_AboutKampaCommand == null)
                    _AboutKampaCommand = new ViewModelCommand(AboutKampa);
                return _AboutKampaCommand;
            }
        }

        private void AboutKampa()
        {
            Browser.Start(Define.KampaUrl);
        }
        #endregion

        public bool IsSilentMode
        {
            get { return Setting.Instance.StateProperty.IsInSilentMode; }
            set
            {
                Setting.Instance.StateProperty.IsInSilentMode = value;
                RaisePropertyChanged(() => IsSilentMode);
            }
        }

        #region RestartCommand
        ViewModelCommand _RestartCommand;

        public ViewModelCommand RestartCommand
        {
            get
            {
                if (_RestartCommand == null)
                    _RestartCommand = new ViewModelCommand(Restart);
                return _RestartCommand;
            }
        }

        private void Restart()
        {
            try
            {
                Setting.Instance.Save();
                Process.Start(Process.GetCurrentProcess().MainModule.FileName);
                KernelService.AppShutdown();
            }
            catch { }
        }
        #endregion

        #region ExitCommand
        ViewModelCommand _ExitCommand;

        public ViewModelCommand ExitCommand
        {
            get
            {
                if (_ExitCommand == null)
                    _ExitCommand = new ViewModelCommand(Exit);
                return _ExitCommand;
            }
        }

        private void Exit()
        {
            KernelService.AppShutdown();
        }
        #endregion

        #endregion

        #region Plugin menu

        internal List<PluginMenuItem> pluginMenus = new List<PluginMenuItem>();

        public IEnumerable<PluginMenuItem> PluginMenu
        {
            get
            {
                return pluginMenus;
            }
        }

        public void RefreshPluginMenu()
        {
            RaisePropertyChanged(() => PluginMenu);
        }

        #endregion

        #region Debug menus

        #region FullGCCommand
        ViewModelCommand _FullGCCommand;

        public ViewModelCommand FullGCCommand
        {
            get
            {
                if (_FullGCCommand == null)
                    _FullGCCommand = new ViewModelCommand(FullGC);
                return _FullGCCommand;
            }
        }

        private void FullGC()
        {
            GC.Collect();
        }
        #endregion

        #region RemoveOldTweetsCommand
        ViewModelCommand _RemoveOldTweetsCommand;

        public ViewModelCommand RemoveOldTweetsCommand
        {
            get
            {
                if (_RemoveOldTweetsCommand == null)
                    _RemoveOldTweetsCommand = new ViewModelCommand(RemoveOldTweets);
                return _RemoveOldTweetsCommand;
            }
        }

        private void RemoveOldTweets()
        {
            Task.Factory.StartNew(() =>
            {
                TweetStorage.GetAll(tvm => (DateTime.Now - tvm.CreatedAt).TotalHours > 12)
                    .ForEach(t => TweetStorage.Remove(t.bindingId));
            });

        }
        #endregion

        #region ShowMemoryCommand
        ViewModelCommand _ShowMemoryCommand;

        public ViewModelCommand ShowMemoryCommand
        {
            get
            {
                if (_ShowMemoryCommand == null)
                    _ShowMemoryCommand = new ViewModelCommand(ShowMemory);
                return _ShowMemoryCommand;
            }
        }

        private void ShowMemory()
        {
            NotifyStorage.Notify("Memory: " + GC.GetTotalMemory(false).ToString());
        }
        #endregion

        #endregion

        #region Input control

        private volatile InputDescription _currentInputDescription = null;
        public InputDescription CurrentInputDescription
        {
            get
            {
                if (this._currentInputDescription == null)
                {
                    System.Diagnostics.Debug.WriteLine("input description initialized");
                    this._currentInputDescription = new InputDescription(this._intelliSenseTextBoxViewModel);
                    this._currentInputDescription.PropertyChanged += (o, e) => UpdateCommand.RaiseCanExecuteChanged();
                    this._currentInputDescription.PropertyChanged += (o, e) => RaisePropertyChanged(() => IsEnabledAutoBind);
                    this._currentInputDescription.PropertyChanged += (o, e) => RaisePropertyChanged(() => IsInReplyToEnabled);
                }
                return this._currentInputDescription;
            }
        }

        private IntelliSenseTextBoxViewModel _intelliSenseTextBoxViewModel;
        public IntelliSenseTextBoxViewModel IntelliSenseTextBoxViewModel
        {
            get { return _intelliSenseTextBoxViewModel; }
        }

        void _intelliSenseTextBoxViewModel_OnItemsOpening()
        {
            this._intelliSenseTextBoxViewModel.Items =
                UserStorage.GetAll()
                .Select(u => new IntelliSenseItemViewModel("@" + u.TwitterUser.ScreenName, u.TwitterUser.ProfileImage))
                .Concat(HashtagStorage.GetHashtags()
                    .Select(s => new IntelliSenseItemViewModel("#" + s, null)))
                .OrderBy(s => s.ItemText).ToArray();
        }

        private void ResetInputDescription()
        {
            System.Diagnostics.Debug.WriteLine("input description resetted");
            this._currentInputDescription = null;
            this.OverrideTarget(null);
            RaisePropertyChanged(() => CurrentInputDescription);
            UpdateAccountImages();
        }

        public void SetCurrentTab(TabViewModel tvm)
        {
            if (tvm != null)
                this.UserSelectorViewModel.LinkElements = tvm.TabProperty.LinkAccountInfos;
            else
                this.UserSelectorViewModel.LinkElements = AccountStorage.Accounts;
            UpdateAccountImages();
        }

        public void SetInReplyTo(TweetViewModel tweet)
        {
            if (tweet == null)
            {
                // clear in reply to
                this.CurrentInputDescription.InReplyToId = 0;
            }
            else
            {
                // スクリーン名の取得
                var screen = tweet.Status.User.ScreenName;
                var sid = tweet.Status.Id;
                var ts = tweet.Status as TwitterStatus;
                if (!Setting.Instance.InputExperienceProperty.OfficialRetweetInReplyToRetweeter &&
                    ts != null && ts.RetweetedOriginal != null)
                {
                    screen = ts.RetweetedOriginal.User.ScreenName;
                    sid = ts.RetweetedOriginal.Id;
                }
                if (this.CurrentInputDescription.InputText.StartsWith(".@"))
                {
                    // multi replication mode
                    string remain;
                    var screens = SplitTweet(this.CurrentInputDescription.InputText, out remain);
                    if (screens.FirstOrDefault(s => s.Equals(screen, StringComparison.CurrentCultureIgnoreCase)) != null)
                    {
                        // 選択ユーザーのスクリーン名だけ抜く
                        this.CurrentInputDescription.InputText = "." +
                            screens.Where(s => !s.Equals(screen, StringComparison.CurrentCultureIgnoreCase))
                            .Select(s => "@" + s)
                            .JoinString(" ") + " " +
                            remain;
                    }
                    else
                    {
                        this.CurrentInputDescription.InputText = "." +
                            screens.Select(s => "@" + s).JoinString(" ") + " " +
                            "@" + screen + " " +
                            remain;
                        this.SetInputCaretIndex(this.CurrentInputDescription.InputText.Length);
                    }
                    this.CurrentInputDescription.InReplyToId = 0;
                }
                else if (this.CurrentInputDescription.InReplyToId != 0 && this.CurrentInputDescription.InputText.StartsWith("@"))
                {
                    // single reply mode -> muliti reply mode
                    string remain;
                    var screens = SplitTweet(this.CurrentInputDescription.InputText, out remain);
                    this.CurrentInputDescription.InputText = "." +
                        screens.Select(s => "@" + s).Concat(new[] { "@" + screen }).Distinct().JoinString(" ")
                        + " " + remain;
                    this.CurrentInputDescription.InReplyToId = 0;
                    this.SetInputCaretIndex(this.CurrentInputDescription.InputText.Length);
                    this.overrideTargets = null;
                }
                else
                {
                    // single reply mode
                    this.CurrentInputDescription.InReplyToId = sid;
                    if (tweet.Status is TwitterDirectMessage)
                    {
                        this.OverrideTarget(new[] { AccountStorage.Get(((TwitterDirectMessage)tweet.Status).Recipient.ScreenName) });
                        this.CurrentInputDescription.InputText = "d @" + screen + " ";
                        this.SetInputCaretIndex(this.CurrentInputDescription.InputText.Length);
                    }
                    else
                    {
                        var mentions = RegularExpressions.AtRegex.Matches(tweet.TweetText);
                        var sns = new[] { "@" + screen }.Concat(mentions.Cast<Match>().Select(m => m.Value))
                            .Distinct().Where(s => !AccountStorage.Contains(s)).ToArray();
                        /*
                        if (tweet.Status is TwitterStatus && AccountStorage.Contains(((TwitterStatus)tweet.Status).InReplyToUserScreenName))
                            sns = sns.Except(new[] { "@" + ((TwitterStatus)tweet.Status).InReplyToUserScreenName }).ToArray();
                        */
                        if (sns.Length > 1)
                        {
                            this.CurrentInputDescription.InputText = sns.JoinString(" ") + " ";
                            this.SetInputCaretIndex(sns[0].Length + 1, sns.JoinString(" ").Length - sns[0].Length);
                        }
                        else
                        {
                            this.CurrentInputDescription.InputText = "@" + screen + " ";
                            this.SetInputCaretIndex(this.CurrentInputDescription.InputText.Length);
                        }
                        if (tweet.Status is TwitterStatus && AccountStorage.Contains(((TwitterStatus)tweet.Status).InReplyToUserScreenName))
                        {
                            var ainfo = AccountStorage.Get(((TwitterStatus)tweet.Status).InReplyToUserScreenName);
                            if (ainfo != null && Setting.Instance.InputExperienceProperty.FallbackBackTracking)
                                ainfo = FallbackBackTracking(ainfo);
                            this.OverrideTarget(new[] { ainfo });
                        }
                    }
                }
            }
        }

        private AccountInfo FallbackBackTracking(AccountInfo info, AccountInfo origin = null)
        {
            if (info == null)
                throw new ArgumentNullException("info");
            if (origin == null)
                origin = info;
            var parent = AccountStorage.Accounts.Where(i => i.AccountProperty.FallbackAccount == info.ScreenName).FirstOrDefault();
            if (parent == null)
                return info;
            else if (parent == origin)
                return origin;
            else
                return FallbackBackTracking(parent, origin);
        }

        private IEnumerable<string> SplitTweet(string input, out string after)
        {
            List<string> screens = new List<string>();
            if (input.StartsWith("."))
                input = input.Substring(1);
            var splitted = input.Split(' ');
            int i = 0;
            for (; i < splitted.Length; i++)
            {
                if (splitted[i].Length == 0)
                    continue;
                if (splitted[i][0] == '@' &&
                    splitted[i].Skip(1).All(
                    c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'))
                {
                    // valid screen name
                    screens.Add(splitted[i].Substring(1));
                }
                else
                {
                    // invalid screen name
                    break;
                }
            }
            if (i >= splitted.Length)
                after = String.Empty;
            else
                after = splitted.Skip(i).JoinString(" ");
            return screens.Distinct().ToArray();
        }

        public void SetText(string text)
        {
            this.CurrentInputDescription.InputText = text;
        }

        public void SetInputCaretIndex(int selectionStart, int selectionLength = 0)
        {
            this._intelliSenseTextBoxViewModel.SetCaret(selectionStart, selectionLength);
        }

        IEnumerable<AccountInfo> overrideTargets = null;

        /// <summary>
        /// 現在の投稿対象をオーバーライドします。
        /// </summary>
        public void OverrideTarget(IEnumerable<AccountInfo> accounts)
        {
            this.overrideTargets = accounts;
            if (accounts == null)
            {
                var ctab = this.Parent.ColumnOwnerViewModel.CurrentTab;
                this.overrideTargets = null;
                if (ctab == null) return;
                this.InputUserSelectorViewModel.LinkElements = ctab.TabProperty.LinkAccountInfos;
                UpdateAccountImages();
                UpdateCommand.RaiseCanExecuteChanged();
            }
            else
            {
                if (Setting.Instance.InputExperienceProperty.IsEnabledTemporarilyUserSelection)
                    this.InputUserSelectorViewModel.LinkElements = accounts;
                UpdateAccountImages();
                UpdateCommand.RaiseCanExecuteChanged();
            }
        }

        private void LinkUserChanged(IEnumerable<AccountInfo> info)
        {
            var ctab = this.Parent.ColumnOwnerViewModel.CurrentTab;
            this.overrideTargets = null;
            if (ctab == null) return;
            ctab.TabProperty.LinkAccountInfos = info.ToArray();
            this.UserSelectorViewModel.LinkElements = info;
            this.InputUserSelectorViewModel.LinkElements = info;
            UpdateAccountImages();
            UpdateCommand.RaiseCanExecuteChanged();
        }

        public bool IsSelectedAccountEmpty
        {
            get
            {
                IEnumerable<AccountInfo> currentTarget = null;
                if (this.overrideTargets != null)
                    currentTarget = this.overrideTargets;
                else
                    currentTarget = this.UserSelectorViewModel.LinkElements;
                if (currentTarget != null)
                    return currentTarget.Count() == 0;
                else
                    return false;
            }
        }

        private void UpdateAccountImages()
        {
            IEnumerable<AccountInfo> currentTarget = null;
            if (this.overrideTargets != null)
                currentTarget = this.overrideTargets;
            else
                currentTarget = this.UserSelectorViewModel.LinkElements;
            if (currentTarget != null)
                currentTarget = AccountStorage.Accounts.Where(i => currentTarget.Contains(i)).ToArray();
            Task.Factory.StartNew(() =>
            {
                var profimgs = currentTarget.Select(ai => ai.ProfileImage).ToArray();
                DispatcherHelper.BeginInvoke(() => ImageStackingViewViewModel.ImageUrls = profimgs);
            });
            RaisePropertyChanged(() => IsSelectedAccountEmpty);
        }

        public bool IsDirectMessage
        {
            get
            {
                return RegularExpressions.DirectMessageSendRegex.IsMatch(this._intelliSenseTextBoxViewModel.TextBoxText);
            }
        }

        public string DirectMessageTarget
        {
            get
            {
                var match = RegularExpressions.DirectMessageSendRegex.Match(this._intelliSenseTextBoxViewModel.TextBoxText);
                if (match.Success)
                {
                    return match.Groups[1].Value;
                }
                else
                {
                    return String.Empty;
                }
            }
        }

        public bool IsInReplyToEnabled
        {
            get
            {
                var cur = this._currentInputDescription;
                if (cur == null)
                    return false;
                else
                    return cur.IsInReplyToEnabled && !this.IsDirectMessage;
            }
        }

        #endregion

        #region Hashtag Binding

        private ObservableCollection<string> automaticBoundTags = new ObservableCollection<string>();
        public ObservableCollection<string> AutomaticBoundTags
        {
            get { return automaticBoundTags; }
        }

        private ObservableCollection<string> bindingTags = new ObservableCollection<string>();
        public ObservableCollection<string> BindingTags
        {
            get { return bindingTags; }
        }

        private ObservableCollection<string> bindCandidateTags = new ObservableCollection<string>();
        public ObservableCollection<string> BindCandidateTags
        {
            get { return bindCandidateTags; }
        }

        private bool _isEnabledAutoBind = true;
        public bool IsEnabledAutoBind
        {
            get
            {
                return this._isEnabledAutoBind && !this.IsDirectMessage && (!Setting.Instance.InputExperienceProperty.SuspendAutoBindInReply ||
                    (this._currentInputDescription == null || this._currentInputDescription.InReplyToId == 0));
            }
            set
            {
                this._isEnabledAutoBind = value;
                RaisePropertyChanged(() => IsEnabledAutoBind);
                this.invalidateTagBindState();
            }
        }

        private void invalidateTagBindState()
        {
            // 自動バインドの処理
            if (this.IsEnabledAutoBind)
            {
                var autobinds = Setting.Instance.InputExperienceProperty.HashtagAutoBindDescriptions
                    .Where(d => d.CheckCondition(_intelliSenseTextBoxViewModel.TextBoxText))
                    .Select(d => "#" + d.TagText)
                    .Except(bindingTags).ToArray();
                automaticBoundTags.Except(autobinds).ToArray().ForEach(i => automaticBoundTags.Remove(i));
                autobinds.Except(automaticBoundTags).ForEach(i => automaticBoundTags.Add(i));
            }
            else
            {
                this.automaticBoundTags.Clear();
            }

            // バインドヘルパーの処理
            var unbounds = RegularExpressions.HashRegex.Matches(_intelliSenseTextBoxViewModel.TextBoxText)
                .Cast<Match>().Select(m => m.Value)
                .Except(bindingTags);
            bindCandidateTags.Except(unbounds).ToArray().ForEach(s => bindCandidateTags.Remove(s));
            unbounds.Except(bindCandidateTags).ForEach(s => bindCandidateTags.Add(s));
        }

        #region ClearBindCommand
        ViewModelCommand _ClearBindCommand;

        public ViewModelCommand ClearBindCommand
        {
            get
            {
                if (_ClearBindCommand == null)
                    _ClearBindCommand = new ViewModelCommand(ClearBind);
                return _ClearBindCommand;
            }
        }

        private void ClearBind()
        {
            bindingTags.Clear();
            bindCandidateTags.Clear();
        }
        #endregion

        #region AddBindCommand
        ListenerCommand<string> _AddBindCommand;

        public ListenerCommand<string> AddBindCommand
        {
            get
            {
                if (_AddBindCommand == null)
                    _AddBindCommand = new ListenerCommand<string>(AddBind);
                return _AddBindCommand;
            }
        }

        private void AddBind(string parameter)
        {
            this.bindCandidateTags.Remove(parameter);
            this.bindingTags.Add(parameter);
            invalidateTagBindState();
        }
        #endregion

        #region RemoveBindCommand
        ListenerCommand<string> _RemoveBindCommand;

        public ListenerCommand<string> RemoveBindCommand
        {
            get
            {
                if (_RemoveBindCommand == null)
                    _RemoveBindCommand = new ListenerCommand<string>(RemoveBind);
                return _RemoveBindCommand;
            }
        }

        private void RemoveBind(string parameter)
        {
            this.bindingTags.Remove(parameter);
            // バインド更新
            this.invalidateTagBindState();
        }
        #endregion

        #region EditAutoBindCommand
        ViewModelCommand _EditAutoBindCommand;

        public ViewModelCommand EditAutoBindCommand
        {
            get
            {
                if (_EditAutoBindCommand == null)
                    _EditAutoBindCommand = new ViewModelCommand(EditAutoBind);
                return _EditAutoBindCommand;
            }
        }

        private void EditAutoBind()
        {
            this.Messenger.Raise(new TransitionMessage("EditAutoBind"));
        }
        #endregion

        private void ClearCandidates()
        {
            this.BindCandidateTags.Clear();
        }

        #endregion

        #region State control

        private bool _isOpenInput =false;
        public bool IsOpenInput
        {
            get { return this._isOpenInput; }
            private set
            {
                this._isOpenInput = value;
                RaisePropertyChanged(() => IsOpenInput);
            }
        }

        public void SetOpenText(bool isOpen, bool setFocus = false)
        {
            if (this.IsOpenInput != isOpen)
            {
                this.IsOpenInput = isOpen;
                ResetInputDescription();
            }
            if (setFocus && isOpen)
                this._intelliSenseTextBoxViewModel.SetFocus();
        }

        #endregion

        #region Commands

        #region OpenInputCommand
        ViewModelCommand _OpenInputCommand;

        public ViewModelCommand OpenInputCommand
        {
            get
            {
                if (_OpenInputCommand == null)
                    _OpenInputCommand = new ViewModelCommand(OpenInput);
                return _OpenInputCommand;
            }
        }

        private void OpenInput()
        {
            SetOpenText(true, true);
        }
        #endregion

        #region CloseInputCommand
        ViewModelCommand _CloseInputCommand;

        public ViewModelCommand CloseInputCommand
        {
            get
            {
                if (_CloseInputCommand == null)
                    _CloseInputCommand = new ViewModelCommand(CloseInput);
                return _CloseInputCommand;
            }
        }

        private void CloseInput()
        {
            SetOpenText(false);
        }
        #endregion

        #region RemoveInReplyToCommand
        ViewModelCommand _RemoveInReplyToCommand;

        public ViewModelCommand RemoveInReplyToCommand
        {
            get
            {
                if (_RemoveInReplyToCommand == null)
                    _RemoveInReplyToCommand = new ViewModelCommand(RemoveInReplyTo);
                return _RemoveInReplyToCommand;
            }
        }

        private void RemoveInReplyTo()
        {
            this.CurrentInputDescription.InReplyToId = 0;
        }
        #endregion

        #region AttachImageCommand
        ViewModelCommand _AttachImageCommand;

        public ViewModelCommand AttachImageCommand
        {
            get
            {
                if (_AttachImageCommand == null)
                    _AttachImageCommand = new ViewModelCommand(AttachImage);
                return _AttachImageCommand;
            }
        }

        private void AttachImage()
        {
            if (this.CurrentInputDescription.AttachedImage != null)
            {
                this.CurrentInputDescription.AttachedImage = null;
            }
            else
            {
                var ofn = new Comdlg32.OPENFILENAME();
                var hwndsrc = (HwndSource)HwndSource.FromVisual(Application.Current.MainWindow);
                ofn.lStructSize = (UInt32)Marshal.SizeOf(ofn);
                ofn.hwndOwner = hwndsrc.Handle;
                ofn.lpstrFilter = "画像ファイル(*.jpg;*.png;*.gif;*.bmp)\0*.jpg;*.png;*.gif;*.bmp\0すべてのファイル(*.*)\0*.*\0";
                ofn.lpstrFile = new string('\0', 1024);
                ofn.nMaxFile = 1024;
                ofn.lpstrTitle = "添付する画像を選択";
                ofn.Flags = Comdlg32.OFN_HIDEREADONLY | Comdlg32.OFN_DONTADDTORECENT | Comdlg32.OFN_FILEMUSTEXIST | Comdlg32.OFN_NODEREFERENCELINKS | Comdlg32.OFN_NOTESTFILECREATE | Comdlg32.OFN_PATHMUSTEXIST;
                var ret = Comdlg32.GetOpenFileName(ofn);
                if (ret)
                {
                    AttachImage(ofn.lpstrFile);
                }
            }
        }

        private void AttachImage(string file)
        {
            this.CurrentInputDescription.AttachedImage = file;
        }
        #endregion

        #region AttachFromClipboardCommand
        ViewModelCommand _AttachFromClipboardCommand;

        public ViewModelCommand AttachFromClipboardCommand
        {
            get
            {
                if (_AttachFromClipboardCommand == null)
                    _AttachFromClipboardCommand = new ViewModelCommand(AttachFromClipboard);
                return _AttachFromClipboardCommand;
            }
        }

        private void AttachFromClipboard()
        {
            try
            {
                var img = Clipboard.GetImage();
                if (img == null)
                    throw new NullReferenceException();
                // All pixels' alpha is 0 in img.
                var bmp = new FormatConvertedBitmap(img, PixelFormats.Bgr32, null, 0);
                var temppath = Path.GetTempFileName();
                using (var fs = new FileStream(temppath, FileMode.Create, FileAccess.Write))
                {
                    var encoder = new PngBitmapEncoder();
                    encoder.Frames.Add(BitmapFrame.Create(bmp));
                    encoder.Save(fs);
                }
                this.CurrentInputDescription.AttachedImage = temppath;
            }
            catch
            {
                    this.Messenger.Raise(new InformationMessage(
                        "クリップボードの中身が無いか、画像ではありません。",
                        "クリップボードエラー", "Information"));
            }
        }
        #endregion

        #region UpdateCommand
        ViewModelCommand _UpdateCommand;

        public ViewModelCommand UpdateCommand
        {
            get
            {
                if (_UpdateCommand == null)
                    _UpdateCommand = new ViewModelCommand(Update, CanUpdate);
                return _UpdateCommand;
            }
        }

        private bool CanUpdate()
        {
            return !String.IsNullOrEmpty(this.CurrentInputDescription.InputText)
                && (
                    TweetTextCounter.Count(this.CurrentInputDescription.InputText) <= TwitterDefine.TweetMaxLength ||
                    Setting.Instance.InputExperienceProperty.TrimExceedChars
                ) &&
                (this.overrideTargets != null || this.UserSelectorViewModel.LinkElements.Count() > 0);
        }

        private void Update()
        {
            if (!this.CanUpdate()) return;
            var boundTags = (IsEnabledAutoBind ? (IEnumerable<String>)this.automaticBoundTags : new string[0])
                .Concat(this.bindingTags).Distinct().ToArray();
            var targets = this.overrideTargets;
            if (targets == null)
                targets = this.UserSelectorViewModel.LinkElements;
            var decidedTargets = targets.ToArray();
            if (Setting.Instance.InputExperienceProperty.UseActiveFallback && !IsDirectMessage)
                decidedTargets = targets.Select(a => FallbackAccount(a, a)).Distinct().ToArray();
            this.CurrentInputDescription.ReadyUpdate(this, boundTags, decidedTargets).ForEach(AddUpdateWorker);
            ResetInputDescription();
        }

        private AccountInfo FallbackAccount(AccountInfo original, AccountInfo current)
        {
            if (!PostOffice.IsAccountUnderControlled(current))
                return current;
            var fallback = AccountStorage.Get(current.AccountProperty.FallbackAccount);
            if (fallback == null || fallback == original)
                return current;
            else
                return FallbackAccount(original, fallback);
        }

        #endregion

        #endregion

        #region Posting control

        public void AddUpdateWorker(TweetWorker w)
        {
            AddUpdateWorker(w, null);
        }

        private void AddUpdateWorker(TweetWorker w, AccountInfo fallbackOriginal)
        {
            if (fallbackOriginal == null)
            {
                fallbackOriginal = w.AccountInfo;
            }
            else if (fallbackOriginal == w.AccountInfo)
            {
                ExceptionStorage.Register(new InvalidOperationException("フォールバックがループしています。"), ExceptionCategory.ConfigurationError);
                return;
            }
            DispatcherHelper.BeginInvoke(() => this._updateWorkers.Add(w));
            w.fallbackOriginalAccount = fallbackOriginal;
            w.RemoveRequired += () => DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
            w.FallbackRequired += new Action<TweetWorker>(fw => AddUpdateWorker(fw, fallbackOriginal));
            w.DoWork().ContinueWith(t =>
            {
                if (t.Result)
                {
                    Thread.Sleep(Setting.Instance.ExperienceProperty.PostFinishShowLength);
                    DispatcherHelper.BeginInvoke(() => this._updateWorkers.Remove(w));
                }
            });
        }

        ObservableCollection<TweetWorker> _updateWorkers = new ObservableCollection<TweetWorker>();
        public ObservableCollection<TweetWorker> UpdateWorkers
        {
            get { return this._updateWorkers; }
        }

        #endregion

        #region KeyAssign

        public void RegisterKeyAssign()
        {
            KeyAssignCore.RegisterOperation("OpenInput", () => this.OpenInput());
            KeyAssignCore.RegisterOperation("CloseInput", () =>
            {
                if (this.IntelliSenseTextBoxViewModel.IsItemOpening)
                {
                    this.IntelliSenseTextBoxViewModel.IsItemOpening = false;
                }
                else
                {
                    this.CloseInput();
                    this.Parent.ColumnOwnerViewModel.SetFocus();
                }
            });
            KeyAssignCore.RegisterOperation("ToggleAutoBind", () => this.IsEnabledAutoBind = !this.IsEnabledAutoBind);
            KeyAssignCore.RegisterOperation("RemoveInReplyTo", () => this.RemoveInReplyTo());
            KeyAssignCore.RegisterOperation("AttachImage", () => this.AttachImage());
            KeyAssignCore.RegisterOperation("Post", () => this.Update());
            KeyAssignCore.RegisterOperation("PostAndClose", () =>
            {
                if (!this.CanUpdate()) return;
                this.Update();
                this.CloseInput();
                this.Parent.ColumnOwnerViewModel.SetFocus();
            });
            KeyAssignCore.RegisterOperation("ShowConfig", () => this.ShowConfig());
            KeyAssignCore.RegisterOperation("ShowAbout", () => this.ShowAbout());
            KeyAssignCore.RegisterOperation("SelectNextAccount", () => SelectAccount(AccountSelection.Next));
            KeyAssignCore.RegisterOperation("SelectPreviousAccount", () => SelectAccount(AccountSelection.Previous));
            KeyAssignCore.RegisterOperation("SelectFirstAccount", () => SelectAccount(AccountSelection.First));
            KeyAssignCore.RegisterOperation("SelectAllAccount", () => SelectAccount(AccountSelection.All));
        }

        private enum AccountSelection
        {
            Next,
            Previous,
            First,
            All,
        }

        private void SelectAccount(AccountSelection selection)
        {
            var cselect = this.InputUserSelectorViewModel.LinkElements;
            Action<IEnumerable<AccountInfo>> setAccount = aa =>
                {
                    if (this.IsOpenInput && Setting.Instance.InputExperienceProperty.IsEnabledTemporarilyUserSelection)
                        this.OverrideTarget(aa);
                    else
                        this.LinkUserChanged(aa);
                };
            switch (selection)
            {
                case AccountSelection.Next:
                    var last = AccountStorage.Accounts.LastOrDefault(i => cselect.Contains(i));
                    if (last == null || AccountStorage.Accounts.LastOrDefault() == last)
                        setAccount(new[] { AccountStorage.Accounts.FirstOrDefault() });
                    else
                        setAccount(new[] { AccountStorage.Accounts.SkipWhile(a => a != last).Take(2).Last() });
                    break;
                case AccountSelection.Previous:
                    var first = AccountStorage.Accounts.FirstOrDefault(i => cselect.Contains(i));
                    if (first == null || AccountStorage.Accounts.FirstOrDefault() == first)
                        setAccount(new[] { AccountStorage.Accounts.LastOrDefault() });
                    else
                        setAccount(new[] { AccountStorage.Accounts.TakeWhile(a => a != first).Last() });
                    break;
                case AccountSelection.First:
                    setAccount(new[] { AccountStorage.Accounts.FirstOrDefault() });
                    break;
                case AccountSelection.All:
                    setAccount(AccountStorage.Accounts);
                    break;
            }
        }

        #endregion
    }
}